From b06850db95022468b58161b82908daaa7942be1c Mon Sep 17 00:00:00 2001 From: U+5BFA Date: Tue, 7 Mar 2023 19:28:11 +0900 Subject: [PATCH 01/18] Refactor SettingsDialog and fix namespaces --- src/Files.App/Dialogs/SettingsDialog.xaml | 40 ++++++++----------- src/Files.App/Dialogs/SettingsDialog.xaml.cs | 33 ++++++--------- src/Files.App/Views/Settings/AboutPage.xaml | 2 +- .../Views/Settings/AboutPage.xaml.cs | 2 +- .../Views/Settings/AdvancedPage.xaml | 2 +- .../Views/Settings/AdvancedPage.xaml.cs | 2 +- .../Views/Settings/AppearancePage.xaml | 2 +- .../Views/Settings/AppearancePage.xaml.cs | 2 +- src/Files.App/Views/Settings/FoldersPage.xaml | 2 +- .../Views/Settings/FoldersPage.xaml.cs | 2 +- .../Views/Settings/PreferencesPage.xaml | 2 +- .../Views/Settings/PreferencesPage.xaml.cs | 2 +- src/Files.App/Views/Settings/TagsPage.xaml | 2 +- src/Files.App/Views/Settings/TagsPage.xaml.cs | 2 +- 14 files changed, 42 insertions(+), 55 deletions(-) diff --git a/src/Files.App/Dialogs/SettingsDialog.xaml b/src/Files.App/Dialogs/SettingsDialog.xaml index 3096aabfa0a8..3ec6b1187d24 100644 --- a/src/Files.App/Dialogs/SettingsDialog.xaml +++ b/src/Files.App/Dialogs/SettingsDialog.xaml @@ -6,9 +6,11 @@ xmlns:helpers="using:Files.App.Helpers" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Closing="ContentDialog_Closing" + DataContext="{x:Bind ViewModel, Mode=OneWay}" RequestedTheme="{x:Bind RootAppElement.RequestedTheme, Mode=OneWay}" Style="{StaticResource DefaultContentDialogStyle}" mc:Ignorable="d"> + 1100 @@ -20,18 +22,13 @@ - + + SelectionChanged="MainSettingsNavigationView_SelectionChanged"> @@ -79,7 +77,7 @@ @@ -88,7 +86,7 @@ @@ -97,7 +95,7 @@ @@ -106,7 +104,7 @@ @@ -116,7 +114,7 @@ @@ -125,12 +123,8 @@ - - + + diff --git a/src/Files.App/Dialogs/SettingsDialog.xaml.cs b/src/Files.App/Dialogs/SettingsDialog.xaml.cs index e8f641b0fe8c..09aa4fa20e06 100644 --- a/src/Files.App/Dialogs/SettingsDialog.xaml.cs +++ b/src/Files.App/Dialogs/SettingsDialog.xaml.cs @@ -1,4 +1,4 @@ -using Files.App.Settings; +using Files.App.Views.Settings; using Files.Backend.ViewModels.Dialogs; using Files.Shared.Enums; using Microsoft.UI.Xaml; @@ -10,38 +10,33 @@ namespace Files.App.Dialogs { public sealed partial class SettingsDialog : ContentDialog, IDialog { - public SettingsDialogViewModel ViewModel - { - get => (SettingsDialogViewModel)DataContext; - set => DataContext = value; - } + public SettingsDialogViewModel ViewModel { get; set; } - // for some reason the requested theme wasn't being set on the content dialog, so this is used to manually bind to the requested app theme - private FrameworkElement RootAppElement => App.Window.Content as FrameworkElement; + private static FrameworkElement RootAppElement + => (FrameworkElement)App.Window.Content; public SettingsDialog() { InitializeComponent(); - SettingsPane.SelectedItem = SettingsPane.MenuItems[0]; + App.Window.SizeChanged += Current_SizeChanged; UpdateDialogLayout(); } - public new async Task ShowAsync() => (DialogResult)await base.ShowAsync(); + public new async Task ShowAsync() + => (DialogResult)await base.ShowAsync(); private void Current_SizeChanged(object sender, WindowSizeChangedEventArgs e) - { - UpdateDialogLayout(); - } + => UpdateDialogLayout(); private void UpdateDialogLayout() { ContainerGrid.Height = App.Window.Bounds.Height <= 760 ? App.Window.Bounds.Height - 70 : 690; ContainerGrid.Width = App.Window.Bounds.Width <= 1100 ? App.Window.Bounds.Width : 1100; - SettingsPane.PaneDisplayMode = App.Window.Bounds.Width < 700 ? NavigationViewPaneDisplayMode.LeftCompact : NavigationViewPaneDisplayMode.Left; + MainSettingsNavigationView.PaneDisplayMode = App.Window.Bounds.Width < 700 ? NavigationViewPaneDisplayMode.LeftCompact : NavigationViewPaneDisplayMode.Left; } - private void SettingsPane_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) + private void MainSettingsNavigationView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) { var selectedItem = (NavigationViewItem)args.SelectedItem; int selectedItemTag = Convert.ToInt32(selectedItem.Tag); @@ -63,9 +58,7 @@ private void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEve App.Window.SizeChanged -= Current_SizeChanged; } - private void ButtonClose_Click(object sender, RoutedEventArgs e) - { - Hide(); - } + private void CloseSettingsDialogButton_Click(object sender, RoutedEventArgs e) + => Hide(); } -} \ No newline at end of file +} diff --git a/src/Files.App/Views/Settings/AboutPage.xaml b/src/Files.App/Views/Settings/AboutPage.xaml index a2adb9bcb972..1205080f355d 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml +++ b/src/Files.App/Views/Settings/AboutPage.xaml @@ -1,5 +1,5 @@ Date: Tue, 7 Mar 2023 21:08:59 +0900 Subject: [PATCH 02/18] Introduce a new style and a new transition --- src/Files.App/Dialogs/SettingsDialog.xaml | 9 + src/Files.App/Dialogs/SettingsDialog.xaml.cs | 2 +- src/Files.App/Files.App.csproj | 6 + .../NavigationViewItemButtonStyle.xaml | 523 ++++++++++++++++++ src/Files.App/Views/Settings/AboutPage.xaml | 13 +- .../Views/Settings/AboutPage.xaml.cs | 9 - .../Views/Settings/AdvancedPage.xaml | 13 +- .../Views/Settings/AppearancePage.xaml | 17 +- src/Files.App/Views/Settings/FoldersPage.xaml | 18 +- .../Views/Settings/PreferencesPage.xaml | 26 +- src/Files.App/Views/Settings/TagsPage.xaml | 11 +- 11 files changed, 585 insertions(+), 62 deletions(-) create mode 100644 src/Files.App/ResourceDictionaries/NavigationViewItemButtonStyle.xaml diff --git a/src/Files.App/Dialogs/SettingsDialog.xaml b/src/Files.App/Dialogs/SettingsDialog.xaml index 3ec6b1187d24..00a754d362cd 100644 --- a/src/Files.App/Dialogs/SettingsDialog.xaml +++ b/src/Files.App/Dialogs/SettingsDialog.xaml @@ -13,6 +13,10 @@ + + + + 1100 0 @@ -28,6 +32,7 @@ + + + + + diff --git a/src/Files.App/Dialogs/SettingsDialog.xaml.cs b/src/Files.App/Dialogs/SettingsDialog.xaml.cs index 09aa4fa20e06..d7966685fee6 100644 --- a/src/Files.App/Dialogs/SettingsDialog.xaml.cs +++ b/src/Files.App/Dialogs/SettingsDialog.xaml.cs @@ -12,7 +12,7 @@ public sealed partial class SettingsDialog : ContentDialog, IDialog (FrameworkElement)App.Window.Content; public SettingsDialog() diff --git a/src/Files.App/Files.App.csproj b/src/Files.App/Files.App.csproj index 9b0fe72a1a5a..06ae38eb8777 100644 --- a/src/Files.App/Files.App.csproj +++ b/src/Files.App/Files.App.csproj @@ -64,6 +64,7 @@ + @@ -120,6 +121,11 @@ + + + MSBuild:Compile + + $(DefaultXamlRuntime) diff --git a/src/Files.App/ResourceDictionaries/NavigationViewItemButtonStyle.xaml b/src/Files.App/ResourceDictionaries/NavigationViewItemButtonStyle.xaml new file mode 100644 index 000000000000..5551c64f8c3d --- /dev/null +++ b/src/Files.App/ResourceDictionaries/NavigationViewItemButtonStyle.xaml @@ -0,0 +1,523 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1,1,1,1 + 36 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Files.App/Views/Settings/AboutPage.xaml b/src/Files.App/Views/Settings/AboutPage.xaml index 1205080f355d..3ee866ad9c2d 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml +++ b/src/Files.App/Views/Settings/AboutPage.xaml @@ -2,24 +2,25 @@ x:Class="Files.App.Views.Settings.AboutPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" - xmlns:i="using:Microsoft.Xaml.Interactivity" - xmlns:ic="using:Microsoft.Xaml.Interactions.Core" xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:vm="using:Files.App.ViewModels.Settings" mc:Ignorable="d"> + + + + - - - + + diff --git a/src/Files.App/Views/Settings/AboutPage.xaml.cs b/src/Files.App/Views/Settings/AboutPage.xaml.cs index 77ba284b03ab..74358e73c9ec 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml.cs +++ b/src/Files.App/Views/Settings/AboutPage.xaml.cs @@ -1,21 +1,12 @@ -using Files.App.ViewModels.Settings; using Microsoft.UI.Xaml.Controls; namespace Files.App.Views.Settings { public sealed partial class AboutPage : Page { - public AboutViewModel ViewModel - { - get => (AboutViewModel)DataContext; - set => DataContext = value; - } - public AboutPage() { InitializeComponent(); - - ViewModel = new AboutViewModel(); } } } diff --git a/src/Files.App/Views/Settings/AdvancedPage.xaml b/src/Files.App/Views/Settings/AdvancedPage.xaml index f45b7be748ab..91822ed09e4f 100644 --- a/src/Files.App/Views/Settings/AdvancedPage.xaml +++ b/src/Files.App/Views/Settings/AdvancedPage.xaml @@ -8,13 +8,15 @@ xmlns:icore="using:Microsoft.Xaml.Interactions.Core" xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:settingsviewmodels="using:Files.App.ViewModels.Settings" + xmlns:vm="using:Files.App.ViewModels.Settings" mc:Ignorable="d"> + + - + @@ -23,9 +25,8 @@ VerticalAlignment="Stretch" Spacing="4"> - - - + + @@ -129,4 +130,4 @@ - \ No newline at end of file + diff --git a/src/Files.App/Views/Settings/AppearancePage.xaml b/src/Files.App/Views/Settings/AppearancePage.xaml index f12f58b9614a..2daa84417fff 100644 --- a/src/Files.App/Views/Settings/AppearancePage.xaml +++ b/src/Files.App/Views/Settings/AppearancePage.xaml @@ -3,15 +3,16 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:appearance="using:Files.App.Views.Settings.Appearance" - xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls" xmlns:converters="using:CommunityToolkit.WinUI.UI.Converters" xmlns:converters1="using:Files.App.ValueConverters" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:settingsviewmodels="using:Files.App.ViewModels.Settings" + xmlns:toolkit="using:CommunityToolkit.WinUI.UI.Controls" + xmlns:vm="using:Files.App.ViewModels.Settings" mc:Ignorable="d"> + @@ -82,8 +83,9 @@ + - + @@ -92,9 +94,8 @@ VerticalAlignment="Stretch" Spacing="4"> - - - + + @@ -139,7 +140,7 @@ - @@ -168,4 +169,4 @@ - \ No newline at end of file + diff --git a/src/Files.App/Views/Settings/FoldersPage.xaml b/src/Files.App/Views/Settings/FoldersPage.xaml index a6b1fcfdd6d1..b67be54be0e9 100644 --- a/src/Files.App/Views/Settings/FoldersPage.xaml +++ b/src/Files.App/Views/Settings/FoldersPage.xaml @@ -2,24 +2,19 @@ x:Class="Files.App.Views.Settings.FoldersPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:UserControls="using:Files.App.UserControls" - xmlns:contract13NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,13)" - xmlns:contract13Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,13)" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:datamodels="using:Files.App.DataModels" xmlns:helpers="using:Files.App.Helpers" - xmlns:i="using:Microsoft.Xaml.Interactivity" - xmlns:icore="using:Microsoft.Xaml.Interactions.Core" xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:muxc="using:Microsoft.UI.Xaml.Controls" - xmlns:settingsviewmodels="using:Files.App.ViewModels.Settings" + xmlns:vm="using:Files.App.ViewModels.Settings" mc:Ignorable="d"> + + - + @@ -28,9 +23,8 @@ VerticalAlignment="Stretch" Spacing="4"> - - - + + diff --git a/src/Files.App/Views/Settings/PreferencesPage.xaml b/src/Files.App/Views/Settings/PreferencesPage.xaml index 0cbb2a9f8f52..5bb6425d7d9f 100644 --- a/src/Files.App/Views/Settings/PreferencesPage.xaml +++ b/src/Files.App/Views/Settings/PreferencesPage.xaml @@ -2,24 +2,22 @@ x:Class="Files.App.Views.Settings.PreferencesPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" - xmlns:UserControls="using:Files.App.UserControls" - xmlns:contract13NotPresent="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractNotPresent(Windows.Foundation.UniversalApiContract,13)" - xmlns:contract13Present="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract,13)" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:datamodels="using:Files.App.DataModels" xmlns:helpers="using:Files.App.Helpers" xmlns:i="using:Microsoft.Xaml.Interactivity" xmlns:icore="using:Microsoft.Xaml.Interactions.Core" xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:muxc="using:Microsoft.UI.Xaml.Controls" - xmlns:settingsviewmodels="using:Files.App.ViewModels.Settings" + xmlns:uc="using:Files.App.UserControls" + xmlns:vm="using:Files.App.ViewModels.Settings" mc:Ignorable="d"> + + - + @@ -28,12 +26,10 @@ VerticalAlignment="Stretch" Spacing="4"> - - - + + - @@ -45,7 +41,7 @@ ItemsSource="{x:Bind ViewModel.AppLanguages}" SelectedIndex="{x:Bind ViewModel.SelectedAppLanguageIndex, Mode=TwoWay}"> - + @@ -68,7 +64,7 @@ ItemsSource="{x:Bind ViewModel.DateFormats}" SelectedIndex="{x:Bind ViewModel.SelectedDateTimeFormatIndex, Mode=TwoWay}"> - + - - \ No newline at end of file + diff --git a/src/Files.App/Views/Settings/TagsPage.xaml b/src/Files.App/Views/Settings/TagsPage.xaml index c6783ee4ed90..2293f170d5c2 100644 --- a/src/Files.App/Views/Settings/TagsPage.xaml +++ b/src/Files.App/Views/Settings/TagsPage.xaml @@ -8,9 +8,10 @@ xmlns:helpers="using:Files.App.Helpers" xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:settingsviewmodels="using:Files.App.ViewModels.Settings" xmlns:vc="using:Files.App.ValueConverters" + xmlns:vm="using:Files.App.ViewModels.Settings" mc:Ignorable="d"> + + - + @@ -34,9 +36,8 @@ VerticalAlignment="Stretch" Spacing="4"> - - - + + From f02b61eb4df05f8fb399a81a0fcdc286e387e633 Mon Sep 17 00:00:00 2001 From: U+5BFA Date: Tue, 7 Mar 2023 21:33:21 +0900 Subject: [PATCH 03/18] Fix build issues --- src/Files.App/Views/Settings/AboutPage.xaml | 2 +- src/Files.App/Views/Settings/AboutPage.xaml.cs | 4 +--- src/Files.App/Views/Settings/AdvancedPage.xaml.cs | 4 +--- src/Files.App/Views/Settings/AppearancePage.xaml.cs | 4 +--- src/Files.App/Views/Settings/FoldersPage.xaml.cs | 4 +--- src/Files.App/Views/Settings/PreferencesPage.xaml.cs | 4 +--- 6 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/Files.App/Views/Settings/AboutPage.xaml b/src/Files.App/Views/Settings/AboutPage.xaml index 3ee866ad9c2d..a51d21a22f05 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml +++ b/src/Files.App/Views/Settings/AboutPage.xaml @@ -10,7 +10,7 @@ mc:Ignorable="d"> - + diff --git a/src/Files.App/Views/Settings/AboutPage.xaml.cs b/src/Files.App/Views/Settings/AboutPage.xaml.cs index 74358e73c9ec..c02466148c2a 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml.cs +++ b/src/Files.App/Views/Settings/AboutPage.xaml.cs @@ -5,8 +5,6 @@ namespace Files.App.Views.Settings public sealed partial class AboutPage : Page { public AboutPage() - { - InitializeComponent(); - } + => InitializeComponent(); } } diff --git a/src/Files.App/Views/Settings/AdvancedPage.xaml.cs b/src/Files.App/Views/Settings/AdvancedPage.xaml.cs index fa5fbade284f..88ca0486e90a 100644 --- a/src/Files.App/Views/Settings/AdvancedPage.xaml.cs +++ b/src/Files.App/Views/Settings/AdvancedPage.xaml.cs @@ -5,8 +5,6 @@ namespace Files.App.Views.Settings public sealed partial class AdvancedPage : Page { public AdvancedPage() - { - InitializeComponent(); - } + => InitializeComponent(); } } diff --git a/src/Files.App/Views/Settings/AppearancePage.xaml.cs b/src/Files.App/Views/Settings/AppearancePage.xaml.cs index b1d51cfdb3b4..c83a51de310c 100644 --- a/src/Files.App/Views/Settings/AppearancePage.xaml.cs +++ b/src/Files.App/Views/Settings/AppearancePage.xaml.cs @@ -5,8 +5,6 @@ namespace Files.App.Views.Settings public sealed partial class AppearancePage : Page { public AppearancePage() - { - InitializeComponent(); - } + => InitializeComponent(); } } diff --git a/src/Files.App/Views/Settings/FoldersPage.xaml.cs b/src/Files.App/Views/Settings/FoldersPage.xaml.cs index f52001854f17..b6a4ee60acf7 100644 --- a/src/Files.App/Views/Settings/FoldersPage.xaml.cs +++ b/src/Files.App/Views/Settings/FoldersPage.xaml.cs @@ -5,8 +5,6 @@ namespace Files.App.Views.Settings public sealed partial class FoldersPage : Page { public FoldersPage() - { - InitializeComponent(); - } + => InitializeComponent(); } } diff --git a/src/Files.App/Views/Settings/PreferencesPage.xaml.cs b/src/Files.App/Views/Settings/PreferencesPage.xaml.cs index 01d02394e910..0a9839cce922 100644 --- a/src/Files.App/Views/Settings/PreferencesPage.xaml.cs +++ b/src/Files.App/Views/Settings/PreferencesPage.xaml.cs @@ -5,8 +5,6 @@ namespace Files.App.Views.Settings public sealed partial class PreferencesPage : Page { public PreferencesPage() - { - InitializeComponent(); - } + => InitializeComponent(); } } From d0a0ddb48fd5b177f1b642243d88f3440b563130 Mon Sep 17 00:00:00 2001 From: U+5BFA Date: Tue, 7 Mar 2023 22:21:15 +0900 Subject: [PATCH 04/18] Introduce new settings controls --- src/Files.App/App.xaml | 1 + src/Files.App/Files.App.csproj | 6 - .../SettingsControlsStyle.xaml | 981 ++++++++++++++++++ .../{ => Outdated}/SettingsBlockControl.xaml | 0 .../SettingsBlockControl.xaml.cs | 0 .../SettingsDisplayControl.xaml | 0 .../SettingsDisplayControl.xaml.cs | 0 .../UserControls/Settings/SettingsCard.cs | 379 +++++++ src/Files.App/Views/Settings/AboutPage.xaml | 92 +- 9 files changed, 1405 insertions(+), 54 deletions(-) create mode 100644 src/Files.App/ResourceDictionaries/SettingsControlsStyle.xaml rename src/Files.App/UserControls/Settings/{ => Outdated}/SettingsBlockControl.xaml (100%) rename src/Files.App/UserControls/Settings/{ => Outdated}/SettingsBlockControl.xaml.cs (100%) rename src/Files.App/UserControls/Settings/{ => Outdated}/SettingsDisplayControl.xaml (100%) rename src/Files.App/UserControls/Settings/{ => Outdated}/SettingsDisplayControl.xaml.cs (100%) create mode 100644 src/Files.App/UserControls/Settings/SettingsCard.cs diff --git a/src/Files.App/App.xaml b/src/Files.App/App.xaml index aa09f953674a..66f9406bbd64 100644 --- a/src/Files.App/App.xaml +++ b/src/Files.App/App.xaml @@ -37,6 +37,7 @@ + diff --git a/src/Files.App/Files.App.csproj b/src/Files.App/Files.App.csproj index 06ae38eb8777..9b0fe72a1a5a 100644 --- a/src/Files.App/Files.App.csproj +++ b/src/Files.App/Files.App.csproj @@ -64,7 +64,6 @@ - @@ -121,11 +120,6 @@ - - - MSBuild:Compile - - $(DefaultXamlRuntime) diff --git a/src/Files.App/ResourceDictionaries/SettingsControlsStyle.xaml b/src/Files.App/ResourceDictionaries/SettingsControlsStyle.xaml new file mode 100644 index 000000000000..6d3f0dcdc398 --- /dev/null +++ b/src/Files.App/ResourceDictionaries/SettingsControlsStyle.xaml @@ -0,0 +1,981 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + 16,16,16,16 + 2,0,20,0 + 148 + 68 + 32 + 32 + 12 + 20 + 13 + 0 + 120 + 2,0,20,0 + 0,8,0,0 + 476 + 286 + 3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Files.App/UserControls/Settings/SettingsBlockControl.xaml b/src/Files.App/UserControls/Settings/Outdated/SettingsBlockControl.xaml similarity index 100% rename from src/Files.App/UserControls/Settings/SettingsBlockControl.xaml rename to src/Files.App/UserControls/Settings/Outdated/SettingsBlockControl.xaml diff --git a/src/Files.App/UserControls/Settings/SettingsBlockControl.xaml.cs b/src/Files.App/UserControls/Settings/Outdated/SettingsBlockControl.xaml.cs similarity index 100% rename from src/Files.App/UserControls/Settings/SettingsBlockControl.xaml.cs rename to src/Files.App/UserControls/Settings/Outdated/SettingsBlockControl.xaml.cs diff --git a/src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml b/src/Files.App/UserControls/Settings/Outdated/SettingsDisplayControl.xaml similarity index 100% rename from src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml rename to src/Files.App/UserControls/Settings/Outdated/SettingsDisplayControl.xaml diff --git a/src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml.cs b/src/Files.App/UserControls/Settings/Outdated/SettingsDisplayControl.xaml.cs similarity index 100% rename from src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml.cs rename to src/Files.App/UserControls/Settings/Outdated/SettingsDisplayControl.xaml.cs diff --git a/src/Files.App/UserControls/Settings/SettingsCard.cs b/src/Files.App/UserControls/Settings/SettingsCard.cs new file mode 100644 index 000000000000..dcb898deeedc --- /dev/null +++ b/src/Files.App/UserControls/Settings/SettingsCard.cs @@ -0,0 +1,379 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Automation; +using Microsoft.UI.Xaml.Automation.Peers; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Controls.Primitives; +using Microsoft.UI.Xaml.Input; + +namespace Files.App.UserControls.Settings +{ + public partial class SettingsCard : ButtonBase + { + private const string NormalState = "Normal"; + private const string PointerOverState = "PointerOver"; + private const string PressedState = "Pressed"; + private const string DisabledState = "Disabled"; + + private const string ActionIconPresenter = "PART_ActionIconPresenter"; + private const string HeaderPresenter = "PART_HeaderPresenter"; + private const string DescriptionPresenter = "PART_DescriptionPresenter"; + private const string HeaderIconPresenterHolder = "PART_HeaderIconPresenterHolder"; + + public SettingsCard() + { + this.DefaultStyleKey = typeof(SettingsCard); + } + + protected override void OnApplyTemplate() + { + base.OnApplyTemplate(); + IsEnabledChanged -= OnIsEnabledChanged; + OnButtonIconChanged(); + OnHeaderChanged(); + OnHeaderIconChanged(); + OnDescriptionChanged(); + OnIsClickEnabledChanged(); + VisualStateManager.GoToState(this, IsEnabled ? NormalState : DisabledState, true); + RegisterAutomation(); + IsEnabledChanged += OnIsEnabledChanged; + } + + private void RegisterAutomation() + { + if (Header is string headerString && headerString != string.Empty) + { + AutomationProperties.SetName(this, headerString); + // We don't want to override an AutomationProperties.Name that is manually set, or if the Content basetype is of type ButtonBase (the ButtonBase.Content will be used then) + if (Content is UIElement element && string.IsNullOrEmpty(AutomationProperties.GetName(element)) && element.GetType().BaseType != typeof(ButtonBase) && element.GetType() != typeof(TextBlock)) + { + AutomationProperties.SetName(element, headerString); + } + } + } + + private void EnableButtonInteraction() + { + DisableButtonInteraction(); + + PointerEntered += Control_PointerEntered; + PointerExited += Control_PointerExited; + PreviewKeyDown += Control_PreviewKeyDown; + PreviewKeyUp += Control_PreviewKeyUp; + } + + private void DisableButtonInteraction() + { + PointerEntered -= Control_PointerEntered; + PointerExited -= Control_PointerExited; + PreviewKeyDown -= Control_PreviewKeyDown; + PreviewKeyUp -= Control_PreviewKeyUp; + } + + private void Control_PreviewKeyUp(object sender, KeyRoutedEventArgs e) + { + if (e.Key == Windows.System.VirtualKey.Enter || e.Key == Windows.System.VirtualKey.Space || e.Key == Windows.System.VirtualKey.GamepadA) + { + VisualStateManager.GoToState(this, NormalState, true); + } + } + + private void Control_PreviewKeyDown(object sender, KeyRoutedEventArgs e) + { + if (e.Key == Windows.System.VirtualKey.Enter || e.Key == Windows.System.VirtualKey.Space || e.Key == Windows.System.VirtualKey.GamepadA) + { + VisualStateManager.GoToState(this, PressedState, true); + } + } + + public void Control_PointerExited(object sender, PointerRoutedEventArgs e) + { + base.OnPointerExited(e); + VisualStateManager.GoToState(this, NormalState, true); + } + + public void Control_PointerEntered(object sender, PointerRoutedEventArgs e) + { + base.OnPointerEntered(e); + VisualStateManager.GoToState(this, PointerOverState, true); + } + + protected override void OnPointerPressed(PointerRoutedEventArgs e) + { + // e.Handled = true; + if (IsClickEnabled) + { + base.OnPointerPressed(e); + VisualStateManager.GoToState(this, PressedState, true); + } + } + + protected override void OnPointerReleased(PointerRoutedEventArgs e) + { + if (IsClickEnabled) + { + base.OnPointerReleased(e); + VisualStateManager.GoToState(this, NormalState, true); + } + } + + protected override AutomationPeer OnCreateAutomationPeer() + { + return new SettingsCardAutomationPeer(this); + } + + private void OnIsClickEnabledChanged() + { + OnButtonIconChanged(); + if (IsClickEnabled) + { + EnableButtonInteraction(); + } + else + { + DisableButtonInteraction(); + } + } + + private void OnIsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e) + { + VisualStateManager.GoToState(this, IsEnabled ? NormalState : DisabledState, true); + } + + private void OnButtonIconChanged() + { + if (GetTemplateChild(ActionIconPresenter) is FrameworkElement buttonIconPresenter) + { + buttonIconPresenter.Visibility = IsClickEnabled + ? Visibility.Visible + : Visibility.Collapsed; + } + } + + private void OnHeaderIconChanged() + { + if (GetTemplateChild(HeaderIconPresenterHolder) is FrameworkElement headerIconPresenter) + { + headerIconPresenter.Visibility = HeaderIcon != null + ? Visibility.Visible + : Visibility.Collapsed; + } + } + + private void OnDescriptionChanged() + { + if (GetTemplateChild(DescriptionPresenter) is FrameworkElement descriptionPresenter) + { + descriptionPresenter.Visibility = Description != null + ? Visibility.Visible + : Visibility.Collapsed; + } + } + + private void OnHeaderChanged() + { + if (GetTemplateChild(HeaderPresenter) is FrameworkElement headerPresenter) + { + headerPresenter.Visibility = Header != null + ? Visibility.Visible + : Visibility.Collapsed; + } + } + } + + public partial class SettingsCard : ButtonBase + { + /// + /// The backing for the property. + /// + public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register( + nameof(Header), + typeof(object), + typeof(SettingsCard), + new PropertyMetadata(defaultValue: null, (d, e) => ((SettingsCard)d).OnHeaderPropertyChanged((object)e.OldValue, (object)e.NewValue))); + + /// + /// The backing for the property. + /// + public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register( + nameof(Description), + typeof(object), + typeof(SettingsCard), + new PropertyMetadata(defaultValue: null, (d, e) => ((SettingsCard)d).OnDescriptionPropertyChanged((object)e.OldValue, (object)e.NewValue))); + + /// + /// The backing for the property. + /// + public static readonly DependencyProperty HeaderIconProperty = DependencyProperty.Register( + nameof(HeaderIcon), + typeof(IconElement), + typeof(SettingsCard), + new PropertyMetadata(defaultValue: null, (d, e) => ((SettingsCard)d).OnHeaderIconPropertyChanged((IconElement)e.OldValue, (IconElement)e.NewValue))); + + /// + /// The backing for the property. + /// + public static readonly DependencyProperty ActionIconProperty = DependencyProperty.Register( + nameof(ActionIcon), + typeof(IconElement), + typeof(SettingsCard), + new PropertyMetadata(defaultValue: "\ue974")); + + /// + /// The backing for the property. + /// + public static readonly DependencyProperty ActionIconToolTipProperty = DependencyProperty.Register( + nameof(ActionIconToolTip), + typeof(string), + typeof(SettingsCard), + new PropertyMetadata(defaultValue: "More")); + + /// + /// The backing for the property. + /// + public static readonly DependencyProperty IsClickEnabledProperty = DependencyProperty.Register( + nameof(IsClickEnabled), + typeof(bool), + typeof(SettingsCard), + new PropertyMetadata(defaultValue: false, (d, e) => ((SettingsCard)d).OnIsClickEnabledPropertyChanged((bool)e.OldValue, (bool)e.NewValue))); + + + /// + /// The backing for the property. + /// + public static readonly DependencyProperty ContentAlignmentProperty = DependencyProperty.Register( + nameof(ContentAlignment), + typeof(ContentAlignment), + typeof(SettingsCard), + new PropertyMetadata(defaultValue: ContentAlignment.Right)); + + /// + /// Gets or sets the Header. + /// + public object Header + { + get => (object)GetValue(HeaderProperty); + set => SetValue(HeaderProperty, value); + } + + /// + /// Gets or sets the description. + /// + public new object Description + { + get => (object)GetValue(DescriptionProperty); + set => SetValue(DescriptionProperty, value); + } + + /// + /// Gets or sets the icon on the left. + /// + public IconElement HeaderIcon + { + get => (IconElement)GetValue(HeaderIconProperty); + set => SetValue(HeaderIconProperty, value); + } + + /// + /// Gets or sets the icon that is shown when IsClickEnabled is set to true. + /// + public IconElement ActionIcon + { + get => (IconElement)GetValue(ActionIconProperty); + set => SetValue(ActionIconProperty, value); + } + + /// + /// Gets or sets the tooltip of the ActionIcon. + /// + public string ActionIconToolTip + { + get => (string)GetValue(ActionIconToolTipProperty); + set => SetValue(ActionIconToolTipProperty, value); + } + + /// + /// Gets or sets if the card can be clicked. + /// + public bool IsClickEnabled + { + get => (bool)GetValue(IsClickEnabledProperty); + set => SetValue(IsClickEnabledProperty, value); + } + + /// + /// Gets or sets the alignment of the Content + /// + public ContentAlignment ContentAlignment + { + get => (ContentAlignment)GetValue(ContentAlignmentProperty); + set => SetValue(ContentAlignmentProperty, value); + } + + protected virtual void OnIsClickEnabledPropertyChanged(bool oldValue, bool newValue) + { + OnIsClickEnabledChanged(); + } + protected virtual void OnHeaderIconPropertyChanged(IconElement oldValue, IconElement newValue) + { + OnHeaderIconChanged(); + } + + protected virtual void OnHeaderPropertyChanged(object oldValue, object newValue) + { + OnHeaderChanged(); + } + + protected virtual void OnDescriptionPropertyChanged(object oldValue, object newValue) + { + OnDescriptionChanged(); + } + } + + public enum ContentAlignment + { + /// + /// The Content is aligned to the right. Default state. + /// + Right, + /// + /// The Content is left-aligned while the Header, HeaderIcon and Description are collapsed. This is commonly used for Content types such as CheckBoxes, RadioButtons and custom layouts. + /// + Left, + /// + /// The Content is vertically aligned. + /// + Vertical + } + + public class SettingsCardAutomationPeer : FrameworkElementAutomationPeer + { + /// + /// Initializes a new instance of the class. + /// + /// SettingsCard + public SettingsCardAutomationPeer(SettingsCard owner) + : base(owner) + { + } + + /// + /// Gets the control type for the element that is associated with the UI Automation peer. + /// + /// The control type. + protected override AutomationControlType GetAutomationControlTypeCore() + { + return AutomationControlType.Group; + } + + /// + /// Called by GetClassName that gets a human readable name that, in addition to AutomationControlType, + /// differentiates the control represented by this AutomationPeer. + /// + /// The string that contains the name. + protected override string GetClassNameCore() + { + string classNameCore = Owner.GetType().Name; + return classNameCore; + } + } +} diff --git a/src/Files.App/Views/Settings/AboutPage.xaml b/src/Files.App/Views/Settings/AboutPage.xaml index a51d21a22f05..4cdb8b37f1bc 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml +++ b/src/Files.App/Views/Settings/AboutPage.xaml @@ -4,8 +4,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" - xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:settingsuc="using:Files.App.UserControls.Settings" xmlns:vm="using:Files.App.ViewModels.Settings" mc:Ignorable="d"> @@ -24,20 +24,16 @@ - + - - + Description="{x:Bind ViewModel.Version}" + Header="{x:Bind ViewModel.AppName}"> + - + - + - - + - + - + @@ -72,30 +68,30 @@ Text="{helpers:ResourceString Name=HelpAndSupport}" /> - - + - + - + - - + + - - + + - - + - - + - - + + - - + - + - + @@ -146,11 +142,11 @@ Text="{helpers:ResourceString Name=OpenSource}" /> - - + + - - + + - - + + - - + - + - + - - + - + - + From ae88ff24f5982678f0d75dbd70f5550ad1ef771e Mon Sep 17 00:00:00 2001 From: U+5BFA Date: Tue, 7 Mar 2023 23:09:02 +0900 Subject: [PATCH 05/18] Update control --- .../SettingsControlsStyle.xaml | 6 +- .../UserControls/Settings/SettingsCard.cs | 2 +- .../UserControls/Settings/StyleExtensions.cs | 117 ++++++++++++++++++ 3 files changed, 121 insertions(+), 4 deletions(-) create mode 100644 src/Files.App/UserControls/Settings/StyleExtensions.cs diff --git a/src/Files.App/ResourceDictionaries/SettingsControlsStyle.xaml b/src/Files.App/ResourceDictionaries/SettingsControlsStyle.xaml index 6d3f0dcdc398..b14d3257c483 100644 --- a/src/Files.App/ResourceDictionaries/SettingsControlsStyle.xaml +++ b/src/Files.App/ResourceDictionaries/SettingsControlsStyle.xaml @@ -87,9 +87,9 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Files.App/UserControls/Settings/Outdated/SettingsBlockControl.xaml b/src/Files.App/UserControls/Settings/SettingsBlockControl.xaml similarity index 100% rename from src/Files.App/UserControls/Settings/Outdated/SettingsBlockControl.xaml rename to src/Files.App/UserControls/Settings/SettingsBlockControl.xaml diff --git a/src/Files.App/UserControls/Settings/Outdated/SettingsBlockControl.xaml.cs b/src/Files.App/UserControls/Settings/SettingsBlockControl.xaml.cs similarity index 100% rename from src/Files.App/UserControls/Settings/Outdated/SettingsBlockControl.xaml.cs rename to src/Files.App/UserControls/Settings/SettingsBlockControl.xaml.cs diff --git a/src/Files.App/UserControls/Settings/SettingsCard.cs b/src/Files.App/UserControls/Settings/SettingsCard.cs deleted file mode 100644 index c2466f6b3353..000000000000 --- a/src/Files.App/UserControls/Settings/SettingsCard.cs +++ /dev/null @@ -1,379 +0,0 @@ -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Automation; -using Microsoft.UI.Xaml.Automation.Peers; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Controls.Primitives; -using Microsoft.UI.Xaml.Input; - -namespace Files.App.UserControls.Settings -{ - public partial class SettingsCard : ButtonBase - { - private const string NormalState = "Normal"; - private const string PointerOverState = "PointerOver"; - private const string PressedState = "Pressed"; - private const string DisabledState = "Disabled"; - - private const string ActionIconPresenter = "PART_ActionIconPresenter"; - private const string HeaderPresenter = "PART_HeaderPresenter"; - private const string DescriptionPresenter = "PART_DescriptionPresenter"; - private const string HeaderIconPresenterHolder = "PART_HeaderIconPresenterHolder"; - - public SettingsCard() - { - this.DefaultStyleKey = typeof(SettingsCard); - } - - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - IsEnabledChanged -= OnIsEnabledChanged; - OnButtonIconChanged(); - OnHeaderChanged(); - OnHeaderIconChanged(); - OnDescriptionChanged(); - OnIsClickEnabledChanged(); - VisualStateManager.GoToState(this, IsEnabled ? NormalState : DisabledState, true); - RegisterAutomation(); - IsEnabledChanged += OnIsEnabledChanged; - } - - private void RegisterAutomation() - { - if (Header is string headerString && headerString != string.Empty) - { - AutomationProperties.SetName(this, headerString); - // We don't want to override an AutomationProperties.Name that is manually set, or if the Content basetype is of type ButtonBase (the ButtonBase.Content will be used then) - if (Content is UIElement element && string.IsNullOrEmpty(AutomationProperties.GetName(element)) && element.GetType().BaseType != typeof(ButtonBase) && element.GetType() != typeof(TextBlock)) - { - AutomationProperties.SetName(element, headerString); - } - } - } - - private void EnableButtonInteraction() - { - DisableButtonInteraction(); - - PointerEntered += Control_PointerEntered; - PointerExited += Control_PointerExited; - PreviewKeyDown += Control_PreviewKeyDown; - PreviewKeyUp += Control_PreviewKeyUp; - } - - private void DisableButtonInteraction() - { - PointerEntered -= Control_PointerEntered; - PointerExited -= Control_PointerExited; - PreviewKeyDown -= Control_PreviewKeyDown; - PreviewKeyUp -= Control_PreviewKeyUp; - } - - private void Control_PreviewKeyUp(object sender, KeyRoutedEventArgs e) - { - if (e.Key == Windows.System.VirtualKey.Enter || e.Key == Windows.System.VirtualKey.Space || e.Key == Windows.System.VirtualKey.GamepadA) - { - VisualStateManager.GoToState(this, NormalState, true); - } - } - - private void Control_PreviewKeyDown(object sender, KeyRoutedEventArgs e) - { - if (e.Key == Windows.System.VirtualKey.Enter || e.Key == Windows.System.VirtualKey.Space || e.Key == Windows.System.VirtualKey.GamepadA) - { - VisualStateManager.GoToState(this, PressedState, true); - } - } - - public void Control_PointerExited(object sender, PointerRoutedEventArgs e) - { - base.OnPointerExited(e); - VisualStateManager.GoToState(this, NormalState, true); - } - - public void Control_PointerEntered(object sender, PointerRoutedEventArgs e) - { - base.OnPointerEntered(e); - VisualStateManager.GoToState(this, PointerOverState, true); - } - - protected override void OnPointerPressed(PointerRoutedEventArgs e) - { - // e.Handled = true; - if (IsClickEnabled) - { - base.OnPointerPressed(e); - VisualStateManager.GoToState(this, PressedState, true); - } - } - - protected override void OnPointerReleased(PointerRoutedEventArgs e) - { - if (IsClickEnabled) - { - base.OnPointerReleased(e); - VisualStateManager.GoToState(this, NormalState, true); - } - } - - protected override AutomationPeer OnCreateAutomationPeer() - { - return new SettingsCardAutomationPeer(this); - } - - private void OnIsClickEnabledChanged() - { - OnButtonIconChanged(); - if (IsClickEnabled) - { - EnableButtonInteraction(); - } - else - { - DisableButtonInteraction(); - } - } - - private void OnIsEnabledChanged(object sender, DependencyPropertyChangedEventArgs e) - { - VisualStateManager.GoToState(this, IsEnabled ? NormalState : DisabledState, true); - } - - private void OnButtonIconChanged() - { - if (GetTemplateChild(ActionIconPresenter) is FrameworkElement buttonIconPresenter) - { - buttonIconPresenter.Visibility = IsClickEnabled - ? Visibility.Visible - : Visibility.Collapsed; - } - } - - private void OnHeaderIconChanged() - { - if (GetTemplateChild(HeaderIconPresenterHolder) is FrameworkElement headerIconPresenter) - { - headerIconPresenter.Visibility = HeaderIcon != null - ? Visibility.Visible - : Visibility.Collapsed; - } - } - - private void OnDescriptionChanged() - { - if (GetTemplateChild(DescriptionPresenter) is FrameworkElement descriptionPresenter) - { - descriptionPresenter.Visibility = Description != null - ? Visibility.Visible - : Visibility.Collapsed; - } - } - - private void OnHeaderChanged() - { - if (GetTemplateChild(HeaderPresenter) is FrameworkElement headerPresenter) - { - headerPresenter.Visibility = Header != null - ? Visibility.Visible - : Visibility.Collapsed; - } - } - } - - public partial class SettingsCard : ButtonBase - { - /// - /// The backing for the property. - /// - public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register( - nameof(Header), - typeof(object), - typeof(SettingsCard), - new PropertyMetadata(defaultValue: null, (d, e) => ((SettingsCard)d).OnHeaderPropertyChanged((object)e.OldValue, (object)e.NewValue))); - - /// - /// The backing for the property. - /// - public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register( - nameof(Description), - typeof(object), - typeof(SettingsCard), - new PropertyMetadata(defaultValue: null, (d, e) => ((SettingsCard)d).OnDescriptionPropertyChanged((object)e.OldValue, (object)e.NewValue))); - - /// - /// The backing for the property. - /// - public static readonly DependencyProperty HeaderIconProperty = DependencyProperty.Register( - nameof(HeaderIcon), - typeof(IconElement), - typeof(SettingsCard), - new PropertyMetadata(defaultValue: null, (d, e) => ((SettingsCard)d).OnHeaderIconPropertyChanged((IconElement)e.OldValue, (IconElement)e.NewValue))); - - /// - /// The backing for the property. - /// - public static readonly DependencyProperty ActionIconProperty = DependencyProperty.Register( - nameof(ActionIcon), - typeof(IconElement), - typeof(SettingsCard), - new PropertyMetadata(defaultValue: "\ue974")); - - /// - /// The backing for the property. - /// - public static readonly DependencyProperty ActionIconToolTipProperty = DependencyProperty.Register( - nameof(ActionIconToolTip), - typeof(string), - typeof(SettingsCard), - new PropertyMetadata(defaultValue: "More")); - - /// - /// The backing for the property. - /// - public static readonly DependencyProperty IsClickEnabledProperty = DependencyProperty.Register( - nameof(IsClickEnabled), - typeof(bool), - typeof(SettingsCard), - new PropertyMetadata(defaultValue: false, (d, e) => ((SettingsCard)d).OnIsClickEnabledPropertyChanged((bool)e.OldValue, (bool)e.NewValue))); - - - /// - /// The backing for the property. - /// - public static readonly DependencyProperty ContentAlignmentProperty = DependencyProperty.Register( - nameof(ContentAlignment), - typeof(ContentAlignment), - typeof(SettingsCard), - new PropertyMetadata(defaultValue: ContentAlignment.Right)); - - /// - /// Gets or sets the Header. - /// - public object Header - { - get => (object)GetValue(HeaderProperty); - set => SetValue(HeaderProperty, value); - } - - /// - /// Gets or sets the description. - /// - public object Description - { - get => (object)GetValue(DescriptionProperty); - set => SetValue(DescriptionProperty, value); - } - - /// - /// Gets or sets the icon on the left. - /// - public IconElement HeaderIcon - { - get => (IconElement)GetValue(HeaderIconProperty); - set => SetValue(HeaderIconProperty, value); - } - - /// - /// Gets or sets the icon that is shown when IsClickEnabled is set to true. - /// - public IconElement ActionIcon - { - get => (IconElement)GetValue(ActionIconProperty); - set => SetValue(ActionIconProperty, value); - } - - /// - /// Gets or sets the tooltip of the ActionIcon. - /// - public string ActionIconToolTip - { - get => (string)GetValue(ActionIconToolTipProperty); - set => SetValue(ActionIconToolTipProperty, value); - } - - /// - /// Gets or sets if the card can be clicked. - /// - public bool IsClickEnabled - { - get => (bool)GetValue(IsClickEnabledProperty); - set => SetValue(IsClickEnabledProperty, value); - } - - /// - /// Gets or sets the alignment of the Content - /// - public ContentAlignment ContentAlignment - { - get => (ContentAlignment)GetValue(ContentAlignmentProperty); - set => SetValue(ContentAlignmentProperty, value); - } - - protected virtual void OnIsClickEnabledPropertyChanged(bool oldValue, bool newValue) - { - OnIsClickEnabledChanged(); - } - protected virtual void OnHeaderIconPropertyChanged(IconElement oldValue, IconElement newValue) - { - OnHeaderIconChanged(); - } - - protected virtual void OnHeaderPropertyChanged(object oldValue, object newValue) - { - OnHeaderChanged(); - } - - protected virtual void OnDescriptionPropertyChanged(object oldValue, object newValue) - { - OnDescriptionChanged(); - } - } - - public enum ContentAlignment - { - /// - /// The Content is aligned to the right. Default state. - /// - Right, - /// - /// The Content is left-aligned while the Header, HeaderIcon and Description are collapsed. This is commonly used for Content types such as CheckBoxes, RadioButtons and custom layouts. - /// - Left, - /// - /// The Content is vertically aligned. - /// - Vertical - } - - public class SettingsCardAutomationPeer : FrameworkElementAutomationPeer - { - /// - /// Initializes a new instance of the class. - /// - /// SettingsCard - public SettingsCardAutomationPeer(SettingsCard owner) - : base(owner) - { - } - - /// - /// Gets the control type for the element that is associated with the UI Automation peer. - /// - /// The control type. - protected override AutomationControlType GetAutomationControlTypeCore() - { - return AutomationControlType.Group; - } - - /// - /// Called by GetClassName that gets a human readable name that, in addition to AutomationControlType, - /// differentiates the control represented by this AutomationPeer. - /// - /// The string that contains the name. - protected override string GetClassNameCore() - { - string classNameCore = Owner.GetType().Name; - return classNameCore; - } - } -} diff --git a/src/Files.App/UserControls/Settings/Outdated/SettingsDisplayControl.xaml b/src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml similarity index 100% rename from src/Files.App/UserControls/Settings/Outdated/SettingsDisplayControl.xaml rename to src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml diff --git a/src/Files.App/UserControls/Settings/Outdated/SettingsDisplayControl.xaml.cs b/src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml.cs similarity index 100% rename from src/Files.App/UserControls/Settings/Outdated/SettingsDisplayControl.xaml.cs rename to src/Files.App/UserControls/Settings/SettingsDisplayControl.xaml.cs diff --git a/src/Files.App/UserControls/Settings/StyleExtensions.cs b/src/Files.App/UserControls/Settings/StyleExtensions.cs deleted file mode 100644 index 27474567c730..000000000000 --- a/src/Files.App/UserControls/Settings/StyleExtensions.cs +++ /dev/null @@ -1,117 +0,0 @@ -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Automation; -using Microsoft.UI.Xaml.Automation.Peers; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Controls.Primitives; -using Microsoft.UI.Xaml.Input; -using System.Collections.Generic; -using System.Linq; - -namespace Files.App.UserControls.Settings -{ - public static partial class StyleExtensions - { - // Used to distinct normal ResourceDictionary and the one we add. - private sealed class StyleExtensionResourceDictionary : ResourceDictionary - { - } - - public static ResourceDictionary GetResources(Style obj) - => (ResourceDictionary)obj.GetValue(ResourcesProperty); - - public static void SetResources(Style obj, ResourceDictionary value) - => obj.SetValue(ResourcesProperty, value); - - public static readonly DependencyProperty ResourcesProperty = DependencyProperty.RegisterAttached( - "Resources", - typeof(ResourceDictionary), - typeof(StyleExtensions), - new PropertyMetadata(null, ResourcesChanged)); - - private static void ResourcesChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) - { - if (sender is not FrameworkElement frameworkElement) - return; - - var mergedDictionaries = frameworkElement.Resources?.MergedDictionaries; - if (mergedDictionaries == null) - return; - - var existingResourceDictionary = mergedDictionaries.FirstOrDefault(c => c is StyleExtensionResourceDictionary); - if (existingResourceDictionary != null) - // Remove the existing resource dictionary - mergedDictionaries.Remove(existingResourceDictionary); - - if (e.NewValue is ResourceDictionary resource) - { - var clonedResources = new StyleExtensionResourceDictionary(); - clonedResources.CopyFrom(resource); - mergedDictionaries.Add(clonedResources); - } - - if (frameworkElement.IsLoaded) - // Only force if the style was applied after the control was loaded - ForceControlToReloadThemeResources(frameworkElement); - } - - private static void ForceControlToReloadThemeResources(FrameworkElement frameworkElement) - { - // Note: - // To force the refresh of all resource references. - // Doesn't work when in high-contrast. - var currentRequestedTheme = frameworkElement.RequestedTheme; - - frameworkElement.RequestedTheme = currentRequestedTheme == ElementTheme.Dark - ? ElementTheme.Light - : ElementTheme.Dark; - - frameworkElement.RequestedTheme = currentRequestedTheme; - } - } - - internal static class ResourceDictionaryExtensions - { - internal static void CopyFrom(this ResourceDictionary destination, ResourceDictionary source) - { - if (source.Source != null) - { - destination.Source = source.Source; - } - else - { - // Clone theme dictionaries - if (source.ThemeDictionaries != null) - { - foreach (var theme in source.ThemeDictionaries) - { - if (theme.Value is ResourceDictionary themedResource) - { - var themeDictionary = new ResourceDictionary(); - themeDictionary.CopyFrom(themedResource); - destination.ThemeDictionaries[theme.Key] = themeDictionary; - } - else - { - destination.ThemeDictionaries[theme.Key] = theme.Value; - } - } - } - - // Clone merged dictionaries - if (source.MergedDictionaries != null) - { - foreach (var mergedResource in source.MergedDictionaries) - { - var themeDictionary = new ResourceDictionary(); - themeDictionary.CopyFrom(mergedResource); - destination.MergedDictionaries.Add(themeDictionary); - } - } - - // Clone all contents - foreach (var item in source) - destination[item.Key] = item.Value; - } - } - } -} diff --git a/src/Files.App/Views/Settings/AboutPage.xaml b/src/Files.App/Views/Settings/AboutPage.xaml index 4cdb8b37f1bc..b28a9b83147c 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml +++ b/src/Files.App/Views/Settings/AboutPage.xaml @@ -24,16 +24,20 @@ - + - - + Description="{x:Bind ViewModel.Version}"> + - + - + Date: Tue, 7 Mar 2023 23:33:33 +0900 Subject: [PATCH 07/18] Revert some changes --- src/Files.App/Dialogs/SettingsDialog.xaml | 12 +-- src/Files.App/Views/Settings/AboutPage.xaml | 86 +++++++++---------- .../Views/Settings/AdvancedPage.xaml | 2 +- .../Views/Settings/AppearancePage.xaml | 2 +- src/Files.App/Views/Settings/FoldersPage.xaml | 2 +- .../Views/Settings/PreferencesPage.xaml | 2 +- src/Files.App/Views/Settings/TagsPage.xaml | 2 +- 7 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/Files.App/Dialogs/SettingsDialog.xaml b/src/Files.App/Dialogs/SettingsDialog.xaml index 00a754d362cd..13b1b228c442 100644 --- a/src/Files.App/Dialogs/SettingsDialog.xaml +++ b/src/Files.App/Dialogs/SettingsDialog.xaml @@ -74,7 +74,7 @@ @@ -84,7 +84,7 @@ @@ -93,7 +93,7 @@ @@ -102,7 +102,7 @@ @@ -111,7 +111,7 @@ @@ -121,7 +121,7 @@ diff --git a/src/Files.App/Views/Settings/AboutPage.xaml b/src/Files.App/Views/Settings/AboutPage.xaml index b28a9b83147c..bce79a4786bd 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml +++ b/src/Files.App/Views/Settings/AboutPage.xaml @@ -4,8 +4,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" + xmlns:local="using:Files.App.UserControls.Settings" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:settingsuc="using:Files.App.UserControls.Settings" xmlns:vm="using:Files.App.ViewModels.Settings" mc:Ignorable="d"> @@ -13,7 +13,7 @@ - + - - + - + - + - - + - + - + @@ -72,30 +72,30 @@ Text="{helpers:ResourceString Name=HelpAndSupport}" /> - - + - + - + - - + + - - + + - - + - - + - - + + - - + - + - + @@ -146,11 +146,11 @@ Text="{helpers:ResourceString Name=OpenSource}" /> - - + + - - + + - - + + - - + - + - + - - + - + - + diff --git a/src/Files.App/Views/Settings/AdvancedPage.xaml b/src/Files.App/Views/Settings/AdvancedPage.xaml index 91822ed09e4f..9a0b2eddaa8f 100644 --- a/src/Files.App/Views/Settings/AdvancedPage.xaml +++ b/src/Files.App/Views/Settings/AdvancedPage.xaml @@ -19,7 +19,7 @@ - + - + - + - + - + Date: Tue, 7 Mar 2023 23:45:50 +0900 Subject: [PATCH 08/18] Fix corner radiuses --- src/Files.App/Dialogs/SettingsDialog.xaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Files.App/Dialogs/SettingsDialog.xaml b/src/Files.App/Dialogs/SettingsDialog.xaml index 13b1b228c442..71e97fe06622 100644 --- a/src/Files.App/Dialogs/SettingsDialog.xaml +++ b/src/Files.App/Dialogs/SettingsDialog.xaml @@ -51,7 +51,6 @@ Background="Transparent" BorderBrush="Transparent" Click="CloseSettingsDialogButton_Click" - CornerRadius="{StaticResource OverlayCornerRadius}" ToolTipService.ToolTip="{helpers:ResourceString Name=Close}"> @@ -113,7 +112,6 @@ AccessKey="E" AutomationProperties.AutomationId="SettingsItemAdvanced" Content="{helpers:ResourceString Name=Advanced}" - CornerRadius="0" Tag="4"> From 9d666a39ca25a3319bda1b6cd2c50be1afd8df97 Mon Sep 17 00:00:00 2001 From: U+5BFA Date: Wed, 8 Mar 2023 00:07:47 +0900 Subject: [PATCH 09/18] Fix up codes --- src/Files.App/Dialogs/SettingsDialog.xaml | 4 ++-- src/Files.App/Views/Settings/AboutPage.xaml | 8 ++++---- src/Files.App/Views/Settings/AboutPage.xaml.cs | 4 +++- src/Files.App/Views/Settings/AdvancedPage.xaml | 7 ++++--- src/Files.App/Views/Settings/AdvancedPage.xaml.cs | 4 +++- src/Files.App/Views/Settings/AppearancePage.xaml | 7 ++++--- src/Files.App/Views/Settings/AppearancePage.xaml.cs | 4 +++- src/Files.App/Views/Settings/FoldersPage.xaml | 7 ++++--- src/Files.App/Views/Settings/FoldersPage.xaml.cs | 4 +++- src/Files.App/Views/Settings/PreferencesPage.xaml | 7 ++++--- src/Files.App/Views/Settings/PreferencesPage.xaml.cs | 4 +++- src/Files.App/Views/Settings/TagsPage.xaml | 7 ++++--- 12 files changed, 41 insertions(+), 26 deletions(-) diff --git a/src/Files.App/Dialogs/SettingsDialog.xaml b/src/Files.App/Dialogs/SettingsDialog.xaml index 71e97fe06622..b266b2993447 100644 --- a/src/Files.App/Dialogs/SettingsDialog.xaml +++ b/src/Files.App/Dialogs/SettingsDialog.xaml @@ -33,7 +33,7 @@ - + - + diff --git a/src/Files.App/Views/Settings/AboutPage.xaml b/src/Files.App/Views/Settings/AboutPage.xaml index bce79a4786bd..599162952142 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml +++ b/src/Files.App/Views/Settings/AboutPage.xaml @@ -13,16 +13,16 @@ - + - - + + + - InitializeComponent(); + { + InitializeComponent(); + } } } diff --git a/src/Files.App/Views/Settings/AdvancedPage.xaml b/src/Files.App/Views/Settings/AdvancedPage.xaml index 9a0b2eddaa8f..2780abba6904 100644 --- a/src/Files.App/Views/Settings/AdvancedPage.xaml +++ b/src/Files.App/Views/Settings/AdvancedPage.xaml @@ -19,14 +19,15 @@ - + - - + + + diff --git a/src/Files.App/Views/Settings/AdvancedPage.xaml.cs b/src/Files.App/Views/Settings/AdvancedPage.xaml.cs index 88ca0486e90a..fa5fbade284f 100644 --- a/src/Files.App/Views/Settings/AdvancedPage.xaml.cs +++ b/src/Files.App/Views/Settings/AdvancedPage.xaml.cs @@ -5,6 +5,8 @@ namespace Files.App.Views.Settings public sealed partial class AdvancedPage : Page { public AdvancedPage() - => InitializeComponent(); + { + InitializeComponent(); + } } } diff --git a/src/Files.App/Views/Settings/AppearancePage.xaml b/src/Files.App/Views/Settings/AppearancePage.xaml index 2798d2784fb0..6d8ff05c553c 100644 --- a/src/Files.App/Views/Settings/AppearancePage.xaml +++ b/src/Files.App/Views/Settings/AppearancePage.xaml @@ -88,14 +88,15 @@ - + - - + + + diff --git a/src/Files.App/Views/Settings/AppearancePage.xaml.cs b/src/Files.App/Views/Settings/AppearancePage.xaml.cs index c83a51de310c..b1d51cfdb3b4 100644 --- a/src/Files.App/Views/Settings/AppearancePage.xaml.cs +++ b/src/Files.App/Views/Settings/AppearancePage.xaml.cs @@ -5,6 +5,8 @@ namespace Files.App.Views.Settings public sealed partial class AppearancePage : Page { public AppearancePage() - => InitializeComponent(); + { + InitializeComponent(); + } } } diff --git a/src/Files.App/Views/Settings/FoldersPage.xaml b/src/Files.App/Views/Settings/FoldersPage.xaml index bbec9ae08a00..d8f89ecffe5e 100644 --- a/src/Files.App/Views/Settings/FoldersPage.xaml +++ b/src/Files.App/Views/Settings/FoldersPage.xaml @@ -17,14 +17,15 @@ - + - - + + + diff --git a/src/Files.App/Views/Settings/FoldersPage.xaml.cs b/src/Files.App/Views/Settings/FoldersPage.xaml.cs index b6a4ee60acf7..f52001854f17 100644 --- a/src/Files.App/Views/Settings/FoldersPage.xaml.cs +++ b/src/Files.App/Views/Settings/FoldersPage.xaml.cs @@ -5,6 +5,8 @@ namespace Files.App.Views.Settings public sealed partial class FoldersPage : Page { public FoldersPage() - => InitializeComponent(); + { + InitializeComponent(); + } } } diff --git a/src/Files.App/Views/Settings/PreferencesPage.xaml b/src/Files.App/Views/Settings/PreferencesPage.xaml index f2195421f95d..99ff743ca45e 100644 --- a/src/Files.App/Views/Settings/PreferencesPage.xaml +++ b/src/Files.App/Views/Settings/PreferencesPage.xaml @@ -20,14 +20,15 @@ - + - - + + + diff --git a/src/Files.App/Views/Settings/PreferencesPage.xaml.cs b/src/Files.App/Views/Settings/PreferencesPage.xaml.cs index 0a9839cce922..01d02394e910 100644 --- a/src/Files.App/Views/Settings/PreferencesPage.xaml.cs +++ b/src/Files.App/Views/Settings/PreferencesPage.xaml.cs @@ -5,6 +5,8 @@ namespace Files.App.Views.Settings public sealed partial class PreferencesPage : Page { public PreferencesPage() - => InitializeComponent(); + { + InitializeComponent(); + } } } diff --git a/src/Files.App/Views/Settings/TagsPage.xaml b/src/Files.App/Views/Settings/TagsPage.xaml index ed73bf3da0eb..e489ec21dbc1 100644 --- a/src/Files.App/Views/Settings/TagsPage.xaml +++ b/src/Files.App/Views/Settings/TagsPage.xaml @@ -30,14 +30,15 @@ - + - - + + + From f4ad264406d131d52e0050155f68875782762f94 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Wed, 8 Mar 2023 11:28:51 -0500 Subject: [PATCH 10/18] Update AboutPage.xaml --- src/Files.App/Views/Settings/AboutPage.xaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Files.App/Views/Settings/AboutPage.xaml b/src/Files.App/Views/Settings/AboutPage.xaml index 8ac4d876eaad..f264f2cd0b4b 100644 --- a/src/Files.App/Views/Settings/AboutPage.xaml +++ b/src/Files.App/Views/Settings/AboutPage.xaml @@ -2,6 +2,7 @@ x:Class="Files.App.Views.Settings.AboutPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="using:Files.App.Helpers" xmlns:local="using:Files.App.UserControls.Settings" @@ -146,19 +147,20 @@ Text="{helpers:ResourceString Name=OpenSource}" /> - + + LinkClicked="MarkdownTextBlock_LinkClicked" + Text="{x:Bind ViewModel.ThirdPartyNotices, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" /> From ef52583c5e92b19568d0b48298d26fd0d5ee24dd Mon Sep 17 00:00:00 2001 From: U+5BFA Date: Thu, 9 Mar 2023 01:33:37 +0900 Subject: [PATCH 11/18] Fix --- src/Files.App/Dialogs/SettingsDialog.xaml | 2 +- src/Files.App/Dialogs/SettingsDialog.xaml.cs | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Files.App/Dialogs/SettingsDialog.xaml b/src/Files.App/Dialogs/SettingsDialog.xaml index b266b2993447..bf74b2961bc3 100644 --- a/src/Files.App/Dialogs/SettingsDialog.xaml +++ b/src/Files.App/Dialogs/SettingsDialog.xaml @@ -65,7 +65,7 @@ IsPaneToggleButtonVisible="False" IsSettingsVisible="False" IsTitleBarAutoPaddingEnabled="False" - OpenPaneLength="224" + OpenPaneLength="260" PaneDisplayMode="Left" SelectionChanged="MainSettingsNavigationView_SelectionChanged"> diff --git a/src/Files.App/Dialogs/SettingsDialog.xaml.cs b/src/Files.App/Dialogs/SettingsDialog.xaml.cs index d7966685fee6..e21bee35cae9 100644 --- a/src/Files.App/Dialogs/SettingsDialog.xaml.cs +++ b/src/Files.App/Dialogs/SettingsDialog.xaml.cs @@ -27,7 +27,9 @@ public SettingsDialog() => (DialogResult)await base.ShowAsync(); private void Current_SizeChanged(object sender, WindowSizeChangedEventArgs e) - => UpdateDialogLayout(); + { + UpdateDialogLayout(); + } private void UpdateDialogLayout() { @@ -59,6 +61,8 @@ private void ContentDialog_Closing(ContentDialog sender, ContentDialogClosingEve } private void CloseSettingsDialogButton_Click(object sender, RoutedEventArgs e) - => Hide(); + { + Hide(); + } } } From 13eb89db2bd01b7390e0b8c7da2c8596fe5f4682 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Wed, 8 Mar 2023 11:55:06 -0500 Subject: [PATCH 12/18] Update App.xaml --- src/Files.App/App.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Files.App/App.xaml b/src/Files.App/App.xaml index aa09f953674a..d75d477b0c8d 100644 --- a/src/Files.App/App.xaml +++ b/src/Files.App/App.xaml @@ -56,7 +56,7 @@ - + From 1785a594134b76826ae837160221a0e1e74127a1 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Wed, 8 Mar 2023 12:04:45 -0500 Subject: [PATCH 13/18] Brushes --- src/Files.App/App.xaml | 3 - src/Files.App/Dialogs/SettingsDialog.xaml | 217 +++++++++++----------- 2 files changed, 109 insertions(+), 111 deletions(-) diff --git a/src/Files.App/App.xaml b/src/Files.App/App.xaml index d75d477b0c8d..aa4e10a5ea79 100644 --- a/src/Files.App/App.xaml +++ b/src/Files.App/App.xaml @@ -44,7 +44,6 @@ - @@ -56,7 +55,6 @@ - @@ -68,7 +66,6 @@ - diff --git a/src/Files.App/Dialogs/SettingsDialog.xaml b/src/Files.App/Dialogs/SettingsDialog.xaml index bf74b2961bc3..4f3fab8ea7fb 100644 --- a/src/Files.App/Dialogs/SettingsDialog.xaml +++ b/src/Files.App/Dialogs/SettingsDialog.xaml @@ -22,118 +22,119 @@ - - - - - - + + + + + - - - + + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - + + From e111d1e16984b81c9781194e155327df554673d5 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Wed, 8 Mar 2023 13:07:58 -0500 Subject: [PATCH 14/18] Update SettingsDialog.xaml --- src/Files.App/Dialogs/SettingsDialog.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Files.App/Dialogs/SettingsDialog.xaml b/src/Files.App/Dialogs/SettingsDialog.xaml index 4f3fab8ea7fb..d310c194b0e3 100644 --- a/src/Files.App/Dialogs/SettingsDialog.xaml +++ b/src/Files.App/Dialogs/SettingsDialog.xaml @@ -25,7 +25,7 @@ + Background="{ThemeResource SolidBackgroundFillColorBase}"> @@ -132,7 +132,7 @@ + Background="{ThemeResource SolidBackgroundFillColorTertiary}" /> From 2c9297936e9368e64ed0e93dacdfd2eb1eeac627 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Wed, 8 Mar 2023 13:19:46 -0500 Subject: [PATCH 15/18] Fixed item height --- .../ResourceDictionaries/NavigationViewItemButtonStyle.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Files.App/ResourceDictionaries/NavigationViewItemButtonStyle.xaml b/src/Files.App/ResourceDictionaries/NavigationViewItemButtonStyle.xaml index 5551c64f8c3d..9e13580a78f6 100644 --- a/src/Files.App/ResourceDictionaries/NavigationViewItemButtonStyle.xaml +++ b/src/Files.App/ResourceDictionaries/NavigationViewItemButtonStyle.xaml @@ -56,7 +56,7 @@ 1,1,1,1 - 36 + 40