From 601f4a7cd1f90d349a56efacb5d76f9fa913150a Mon Sep 17 00:00:00 2001 From: Maksym Katsydan Date: Wed, 29 Jul 2020 23:20:09 -0400 Subject: [PATCH 01/12] Fluent: Fix high-contrast base colors naming --- src/Avalonia.Themes.Fluent/Accents/Base.xaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Avalonia.Themes.Fluent/Accents/Base.xaml b/src/Avalonia.Themes.Fluent/Accents/Base.xaml index 8358297f8b..46488c1c57 100644 --- a/src/Avalonia.Themes.Fluent/Accents/Base.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/Base.xaml @@ -6,12 +6,12 @@ #FFF0F0F0 #FF000000 - #FF6D6D6D - #FF3399FF - #FFFFFFFF - #FF0066CC - #FFFFFFFF - #FF000000 + #FF6D6D6D + #FF3399FF + #FFFFFFFF + #FF0066CC + #FFFFFFFF + #FF000000 avares://Avalonia.Themes.Fluent/Assets#Roboto 14 From 2c1afac25944877ffcd7e4915bd8524590e1d058 Mon Sep 17 00:00:00 2001 From: Maksym Katsydan Date: Wed, 29 Jul 2020 23:20:50 -0400 Subject: [PATCH 02/12] Fluent: Add NotificationCard missed resources (same as in Default theme) --- .../Accents/FluentControlResourcesDark.xaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml index 653e4733cb..4d21068492 100644 --- a/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml +++ b/src/Avalonia.Themes.Fluent/Accents/FluentControlResourcesDark.xaml @@ -437,6 +437,15 @@ + + + + + + + + + 1 From f3e530e7b506fd6f504eaf3e32777ac9b74a5fe9 Mon Sep 17 00:00:00 2001 From: Maksym Katsydan Date: Wed, 29 Jul 2020 23:29:59 -0400 Subject: [PATCH 03/12] Fluent, Default: #4396 Remove undefined ToggleSwitchKnobStrokeOn and ToggleSwitchKnobStrokeOff --- src/Avalonia.Themes.Default/ToggleSwitch.xaml | 2 -- src/Avalonia.Themes.Fluent/ToggleSwitch.xaml | 2 -- 2 files changed, 4 deletions(-) diff --git a/src/Avalonia.Themes.Default/ToggleSwitch.xaml b/src/Avalonia.Themes.Default/ToggleSwitch.xaml index ded121f5f6..59738f3209 100644 --- a/src/Avalonia.Themes.Default/ToggleSwitch.xaml +++ b/src/Avalonia.Themes.Default/ToggleSwitch.xaml @@ -148,12 +148,10 @@ diff --git a/src/Avalonia.Themes.Fluent/DataValidationErrors.xaml b/src/Avalonia.Themes.Fluent/DataValidationErrors.xaml index f4145a51f5..88c6b661f1 100644 --- a/src/Avalonia.Themes.Fluent/DataValidationErrors.xaml +++ b/src/Avalonia.Themes.Fluent/DataValidationErrors.xaml @@ -1,5 +1,16 @@ - + diff --git a/src/Avalonia.Themes.Fluent/TextBox.xaml b/src/Avalonia.Themes.Fluent/TextBox.xaml index 0327e776e3..be5e21d03d 100644 --- a/src/Avalonia.Themes.Fluent/TextBox.xaml +++ b/src/Avalonia.Themes.Fluent/TextBox.xaml @@ -1,4 +1,13 @@ + + + + + + 0,0,0,4 @@ -42,7 +51,7 @@ @@ -136,7 +145,7 @@ diff --git a/samples/ControlCatalog/App.xaml.cs b/samples/ControlCatalog/App.xaml.cs index 3f1ec289d1..b0fbcc76d2 100644 --- a/samples/ControlCatalog/App.xaml.cs +++ b/samples/ControlCatalog/App.xaml.cs @@ -67,9 +67,9 @@ namespace ControlCatalog public override void Initialize() { - AvaloniaXamlLoader.Load(this); - Styles.Insert(0, FluentDark); + + AvaloniaXamlLoader.Load(this); } public override void OnFrameworkInitializationCompleted() diff --git a/samples/ControlCatalog/MainView.xaml b/samples/ControlCatalog/MainView.xaml index af95e3c356..efc90357ed 100644 --- a/samples/ControlCatalog/MainView.xaml +++ b/samples/ControlCatalog/MainView.xaml @@ -1,9 +1,7 @@ + x:Class="ControlCatalog.MainView"> diff --git a/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml b/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml index 304782dbf9..392ccb57c3 100644 --- a/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml +++ b/samples/ControlCatalog/Pages/ItemsRepeaterPage.xaml @@ -43,7 +43,7 @@ - + diff --git a/samples/ControlCatalog/Pages/ScreenPage.cs b/samples/ControlCatalog/Pages/ScreenPage.cs index d775eb9635..c39f414b44 100644 --- a/samples/ControlCatalog/Pages/ScreenPage.cs +++ b/samples/ControlCatalog/Pages/ScreenPage.cs @@ -29,7 +29,8 @@ namespace ControlCatalog.Pages var screens = w.Screens.All; var scaling = ((IRenderRoot)w).RenderScaling; - Pen p = new Pen(Brushes.Black); + var drawBrush = Brushes.Green; + Pen p = new Pen(drawBrush); if (screens != null) foreach (Screen screen in screens) { @@ -53,19 +54,19 @@ namespace ControlCatalog.Pages }; text.Text = $"Bounds: {screen.Bounds.Width}:{screen.Bounds.Height}"; - context.DrawText(Brushes.Black, boundsRect.Position.WithY(boundsRect.Size.Height), text); + context.DrawText(drawBrush, boundsRect.Position.WithY(boundsRect.Size.Height), text); text.Text = $"WorkArea: {screen.WorkingArea.Width}:{screen.WorkingArea.Height}"; - context.DrawText(Brushes.Black, boundsRect.Position.WithY(boundsRect.Size.Height + 20), text); + context.DrawText(drawBrush, boundsRect.Position.WithY(boundsRect.Size.Height + 20), text); text.Text = $"Scaling: {screen.PixelDensity * 100}%"; - context.DrawText(Brushes.Black, boundsRect.Position.WithY(boundsRect.Size.Height + 40), text); + context.DrawText(drawBrush, boundsRect.Position.WithY(boundsRect.Size.Height + 40), text); text.Text = $"Primary: {screen.Primary}"; - context.DrawText(Brushes.Black, boundsRect.Position.WithY(boundsRect.Size.Height + 60), text); + context.DrawText(drawBrush, boundsRect.Position.WithY(boundsRect.Size.Height + 60), text); text.Text = $"Current: {screen.Equals(w.Screens.ScreenFromBounds(new PixelRect(w.Position, PixelSize.FromSize(w.Bounds.Size, scaling))))}"; - context.DrawText(Brushes.Black, boundsRect.Position.WithY(boundsRect.Size.Height + 80), text); + context.DrawText(drawBrush, boundsRect.Position.WithY(boundsRect.Size.Height + 80), text); } context.DrawRectangle(p, new Rect(w.Position.X / 10f + Math.Abs(_leftMost), w.Position.Y / 10, w.Bounds.Width / 10, w.Bounds.Height / 10)); diff --git a/samples/ControlCatalog/Pages/TextBlockPage.xaml b/samples/ControlCatalog/Pages/TextBlockPage.xaml index 4b8edcf98c..4a1c196917 100644 --- a/samples/ControlCatalog/Pages/TextBlockPage.xaml +++ b/samples/ControlCatalog/Pages/TextBlockPage.xaml @@ -12,7 +12,7 @@ @@ -49,7 +49,7 @@ From b941fd675f7c4f4bd7d382f85dd438f1b260b17d Mon Sep 17 00:00:00 2001 From: Maksym Katsydan Date: Thu, 30 Jul 2020 21:19:33 -0400 Subject: [PATCH 09/12] Default theme: Replace DropDown with ComboBox in ManagedFileChooser --- src/Avalonia.Dialogs/ManagedFileChooser.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Dialogs/ManagedFileChooser.xaml b/src/Avalonia.Dialogs/ManagedFileChooser.xaml index ea45e83812..227cc1afc0 100644 --- a/src/Avalonia.Dialogs/ManagedFileChooser.xaml +++ b/src/Avalonia.Dialogs/ManagedFileChooser.xaml @@ -66,7 +66,7 @@ - Date: Thu, 30 Jul 2020 21:42:30 -0400 Subject: [PATCH 10/12] Default theme: Add ToggleSwitch resources --- .../Accents/BaseDark.xaml | 2 + .../Accents/BaseLight.xaml | 2 + src/Avalonia.Themes.Default/TabItem.xaml | 2 +- src/Avalonia.Themes.Default/ToggleSwitch.xaml | 45 ++++++++++++++----- src/Avalonia.Themes.Fluent/ToggleSwitch.xaml | 2 - 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/src/Avalonia.Themes.Default/Accents/BaseDark.xaml b/src/Avalonia.Themes.Default/Accents/BaseDark.xaml index ffe3e92202..4274f7ee4d 100644 --- a/src/Avalonia.Themes.Default/Accents/BaseDark.xaml +++ b/src/Avalonia.Themes.Default/Accents/BaseDark.xaml @@ -58,6 +58,8 @@ + + 1,1,1,1 0.5 diff --git a/src/Avalonia.Themes.Default/Accents/BaseLight.xaml b/src/Avalonia.Themes.Default/Accents/BaseLight.xaml index c0e5f47eed..b1c0946d0f 100644 --- a/src/Avalonia.Themes.Default/Accents/BaseLight.xaml +++ b/src/Avalonia.Themes.Default/Accents/BaseLight.xaml @@ -61,6 +61,8 @@ + + 1 0.5 diff --git a/src/Avalonia.Themes.Default/TabItem.xaml b/src/Avalonia.Themes.Default/TabItem.xaml index 92482a564c..6e344ce58e 100644 --- a/src/Avalonia.Themes.Default/TabItem.xaml +++ b/src/Avalonia.Themes.Default/TabItem.xaml @@ -2,7 +2,7 @@ - - @@ -262,10 +289,6 @@ - - diff --git a/src/Avalonia.Themes.Fluent/ToggleSwitch.xaml b/src/Avalonia.Themes.Fluent/ToggleSwitch.xaml index 219f6f6742..56249f5986 100644 --- a/src/Avalonia.Themes.Fluent/ToggleSwitch.xaml +++ b/src/Avalonia.Themes.Fluent/ToggleSwitch.xaml @@ -6,8 +6,6 @@ 6 6 154 - 20 - 0 From bf346ff16eb9f52c5529c8f58bb20bca895d9812 Mon Sep 17 00:00:00 2001 From: Maksym Katsydan Date: Thu, 30 Jul 2020 23:10:34 -0400 Subject: [PATCH 11/12] Replace StaticResource with SolidColorBrush+DynamicResource to fix tests --- src/Avalonia.Themes.Default/ToggleSwitch.xaml | 64 +++++++++---------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/src/Avalonia.Themes.Default/ToggleSwitch.xaml b/src/Avalonia.Themes.Default/ToggleSwitch.xaml index 48e92d2283..5c0a3b99f3 100644 --- a/src/Avalonia.Themes.Default/ToggleSwitch.xaml +++ b/src/Avalonia.Themes.Default/ToggleSwitch.xaml @@ -8,38 +8,38 @@ 154 0 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 836203d0337899aacc257eee755b8094aa39fc2d Mon Sep 17 00:00:00 2001 From: amwx Date: Mon, 3 Aug 2020 15:58:34 -0500 Subject: [PATCH 12/12] Fix ArgumentOutOfRange exception --- .../DateTimePickers/DatePickerPresenter.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Avalonia.Controls/DateTimePickers/DatePickerPresenter.cs b/src/Avalonia.Controls/DateTimePickers/DatePickerPresenter.cs index 31527ccb16..eec4615736 100644 --- a/src/Avalonia.Controls/DateTimePickers/DatePickerPresenter.cs +++ b/src/Avalonia.Controls/DateTimePickers/DatePickerPresenter.cs @@ -356,10 +356,17 @@ namespace Avalonia.Controls } if (MonthVisible) + { _monthSelector.SelectedValue = dt.Month; - + _monthSelector.FormatDate = dt.Date; + } + if (YearVisible) + { _yearSelector.SelectedValue = dt.Year; + _yearSelector.FormatDate = dt.Date; + } + _suppressUpdateSelection = false; SetInitialFocus();