-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DatePicker and TimePicker controls #4108
Conversation
Should there also be DatePicker style for default theme? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking great! though i just want to point out things
Also waiting on #3970 to possibly better handle the popup (popup near screen bounds can cause it to be shown well above where the date/time picker is) |
@amwx i merged that PR |
@amwx Tis looking great! Though i hope you can remove the custom DateTimeFormatting stuff.. We dont want to maintain such stuff, at least in-repo... and that code reminds me of a certain british guy ranting about time zones in youtube 😆 |
@jmacato It was removed and now uses normal .net formatting |
@amwx Thank you very much! Will review this later in detail :) |
# Conflicts: # src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml # src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesLight.xaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @amwx - first of all this control looks and works great! However I have some concerns about the implementation - in particular the size. These controls appear to be larger than any other control in the Avalonia codebase which feels excessive given the fact they're date/time pickers.
In addition, LoopingSelector
creates 243 DatePickerPresenterItem
s when the popup is opened!
I will have more feedback, but thought I'd leave my feedback so far now.
I've updated all of the controls here to make a few changes that reduce the overall size of this PR. |
Looking great :D Just tested and it's so fancy :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for the most part :) Also tested :)
Co-authored-by: Jumar Macato <16554748+jmacato@users.noreply.github.com>
# Conflicts: # src/Avalonia.Themes.Fluent/FluentTheme.xaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does the pull request do?
Adds the WinUI style DatePicker and TimePickers & related classes/controls
These are my own implementation, but the APIs are very similar. In WinUI, DatePicker has a both a SelectedDate and Date property, and TimePicker has SelectedDate and Date properties, the selected variants being nullable. I've only included the SelectedDate / SelectedTime properties, as I didn't really see a need for both. Also formatting for DatePicker uses standard .net DateTime formatting rules instead of the UWP/WinUI formatter.