diff --git a/src/Files.App/App.xaml b/src/Files.App/App.xaml index 017182699a7e4..e44a95a60e564 100644 --- a/src/Files.App/App.xaml +++ b/src/Files.App/App.xaml @@ -47,6 +47,7 @@ + @@ -61,6 +62,7 @@ + @@ -75,6 +77,7 @@ + diff --git a/src/Files.App/Data/Contracts/IResourcesService.cs b/src/Files.App/Data/Contracts/IResourcesService.cs index 1b659e0b378bd..2ceb1de144de6 100644 --- a/src/Files.App/Data/Contracts/IResourcesService.cs +++ b/src/Files.App/Data/Contracts/IResourcesService.cs @@ -26,6 +26,12 @@ public interface IResourcesService /// /// void SetAppThemeAddressBarBackgroundColor(Color appThemeAddressBarBackgroundColor); + + /// + /// Overrides the XAML resource for App.Theme.Toolbar.BackgroundBrush + /// + /// + void SetAppThemeToolbarBackgroundColor(Color appThemeToolbarBackgroundColor); /// /// Overrides the XAML resource for App.Theme.Sidebar.BackgroundBrush diff --git a/src/Files.App/Helpers/UI/AppThemeResourcesHelper.cs b/src/Files.App/Helpers/UI/AppThemeResourcesHelper.cs index ee2443808ad4c..bbc71be01d3ee 100644 --- a/src/Files.App/Helpers/UI/AppThemeResourcesHelper.cs +++ b/src/Files.App/Helpers/UI/AppThemeResourcesHelper.cs @@ -17,6 +17,7 @@ public static void LoadAppResources(this IResourcesService service, IAppearanceS { var appThemeBackgroundColor = appearance.AppThemeBackgroundColor; var appThemeAddressBarBackgroundColor = appearance.AppThemeAddressBarBackgroundColor; + var appThemeToolbarBackgroundColor = appearance.AppThemeToolbarBackgroundColor; var appThemeSidebarBackgroundColor = appearance.AppThemeSidebarBackgroundColor; var appThemeFileAreaBackgroundColor = appearance.AppThemeFileAreaBackgroundColor; var appThemeFontFamily = appearance.AppThemeFontFamily; @@ -27,11 +28,11 @@ public static void LoadAppResources(this IResourcesService service, IAppearanceS } catch { - appearance.AppThemeBackgroundColor = "#00000000"; //migrate to new default + appearance.AppThemeBackgroundColor = "#00000000"; // reset to default service.SetAppThemeBackgroundColor(ColorHelper.ToColor("#00000000").FromWindowsColor()); } - if (!string.IsNullOrWhiteSpace(appThemeAddressBarBackgroundColor) && appThemeAddressBarBackgroundColor != "#00000000") + if (!string.IsNullOrWhiteSpace(appThemeAddressBarBackgroundColor)) { try { @@ -39,13 +40,23 @@ public static void LoadAppResources(this IResourcesService service, IAppearanceS } catch { - appearance.AppThemeAddressBarBackgroundColor = ""; //migrate to new default + appearance.AppThemeAddressBarBackgroundColor = ""; // reset to default } } - else - appearance.AppThemeAddressBarBackgroundColor = ""; //migrate to new default - if (!string.IsNullOrWhiteSpace(appThemeSidebarBackgroundColor) && appThemeSidebarBackgroundColor != "#00000000") + if (!string.IsNullOrWhiteSpace(appThemeToolbarBackgroundColor)) + { + try + { + service.SetAppThemeToolbarBackgroundColor(ColorHelper.ToColor(appThemeToolbarBackgroundColor).FromWindowsColor()); + } + catch + { + appearance.AppThemeAddressBarBackgroundColor = ""; //reset to default + } + } + + if (!string.IsNullOrWhiteSpace(appThemeSidebarBackgroundColor)) { try { @@ -53,13 +64,11 @@ public static void LoadAppResources(this IResourcesService service, IAppearanceS } catch { - appearance.AppThemeSidebarBackgroundColor = ""; //migrate to new default + appearance.AppThemeSidebarBackgroundColor = ""; //reset to default } } - else - appearance.AppThemeSidebarBackgroundColor = ""; //migrate to new default - if (!string.IsNullOrWhiteSpace(appThemeFileAreaBackgroundColor) && appThemeFileAreaBackgroundColor != "#00000000") + if (!string.IsNullOrWhiteSpace(appThemeFileAreaBackgroundColor)) { try { @@ -67,11 +76,9 @@ public static void LoadAppResources(this IResourcesService service, IAppearanceS } catch { - appearance.AppThemeFileAreaBackgroundColor = ""; //migrate to new default + appearance.AppThemeFileAreaBackgroundColor = ""; //reset to default } } - else - appearance.AppThemeFileAreaBackgroundColor = ""; //migrate to new default if (appThemeFontFamily != Constants.Appearance.StandardFont) service.SetAppThemeFontFamily(appThemeFontFamily); diff --git a/src/Files.App/Services/ResourcesService.cs b/src/Files.App/Services/ResourcesService.cs index 81b598355c815..64fd62ebb6e27 100644 --- a/src/Files.App/Services/ResourcesService.cs +++ b/src/Files.App/Services/ResourcesService.cs @@ -26,6 +26,12 @@ public void SetAppThemeAddressBarBackgroundColor(Color appThemeAddressBarBackgro Application.Current.Resources["TabViewItemHeaderBackgroundSelected"] = appThemeAddressBarBackgroundColor.ToWindowsColor(); } + /// + public void SetAppThemeToolbarBackgroundColor(Color appThemeToolbarBackgroundColor) + { + Application.Current.Resources["App.Theme.Toolbar.BackgroundBrush"] = appThemeToolbarBackgroundColor.ToWindowsColor(); + } + /// public void SetAppThemeSidebarBackgroundColor(Color appThemeSidebarBackgroundColor) { diff --git a/src/Files.App/Services/Settings/AppearanceSettingsService.cs b/src/Files.App/Services/Settings/AppearanceSettingsService.cs index a06563d5362c3..55d5ff2ceae93 100644 --- a/src/Files.App/Services/Settings/AppearanceSettingsService.cs +++ b/src/Files.App/Services/Settings/AppearanceSettingsService.cs @@ -48,6 +48,13 @@ public String AppThemeAddressBarBackgroundColor set => Set(value); } + /// + public String AppThemeToolbarBackgroundColor + { + get => Get(""); + set => Set(value); + } + /// public String AppThemeSidebarBackgroundColor { @@ -117,6 +124,7 @@ protected override void RaiseOnSettingChangedEvent(object sender, SettingChanged { case nameof(AppThemeBackgroundColor): case nameof(AppThemeAddressBarBackgroundColor): + case nameof(AppThemeToolbarBackgroundColor): case nameof(AppThemeSidebarBackgroundColor): case nameof(AppThemeFileAreaBackgroundColor): case nameof(AppThemeBackdropMaterial): diff --git a/src/Files.App/Services/Settings/IAppearanceSettingsService.cs b/src/Files.App/Services/Settings/IAppearanceSettingsService.cs index ea59ebbcb89af..63ebf16b5daac 100644 --- a/src/Files.App/Services/Settings/IAppearanceSettingsService.cs +++ b/src/Files.App/Services/Settings/IAppearanceSettingsService.cs @@ -37,6 +37,11 @@ public interface IAppearanceSettingsService : IBaseSettingsService, INotifyPrope /// String AppThemeAddressBarBackgroundColor { get; set; } + /// + /// Gets or sets a value for the app theme toolbar background color. + /// + String AppThemeToolbarBackgroundColor { get; set; } + /// /// Gets or sets a value for the app theme sidebar background color. /// diff --git a/src/Files.App/UserControls/InnerNavigationToolbar.xaml b/src/Files.App/UserControls/InnerNavigationToolbar.xaml index 153f056c95e7f..94daf62c2fcd3 100644 --- a/src/Files.App/UserControls/InnerNavigationToolbar.xaml +++ b/src/Files.App/UserControls/InnerNavigationToolbar.xaml @@ -54,10 +54,7 @@ - + diff --git a/src/Files.App/UserControls/SideBar/SideBarView.properties.cs b/src/Files.App/UserControls/SideBar/SideBarView.properties.cs index 9a0228eccc8d0..5c8ce21778d85 100644 --- a/src/Files.App/UserControls/SideBar/SideBarView.properties.cs +++ b/src/Files.App/UserControls/SideBar/SideBarView.properties.cs @@ -15,6 +15,14 @@ public SidebarDisplayMode DisplayMode public static readonly DependencyProperty DisplayModeProperty = DependencyProperty.Register(nameof(DisplayMode), typeof(SidebarDisplayMode), typeof(SidebarView), new PropertyMetadata(SidebarDisplayMode.Expanded, OnPropertyChanged)); + public UIElement ContentHeader + { + get { return (UIElement)GetValue(ContentHeaderProperty); } + set { SetValue(ContentHeaderProperty, value); } + } + public static readonly DependencyProperty ContentHeaderProperty = + DependencyProperty.Register(nameof(ContentHeader), typeof(UIElement), typeof(SidebarView), new PropertyMetadata(null)); + public UIElement InnerContent { get { return (UIElement)GetValue(InnerContentProperty); } diff --git a/src/Files.App/UserControls/SideBar/SideBarView.xaml b/src/Files.App/UserControls/SideBar/SideBarView.xaml index 53c85990d6bf3..e800f53acac0b 100644 --- a/src/Files.App/UserControls/SideBar/SideBarView.xaml +++ b/src/Files.App/UserControls/SideBar/SideBarView.xaml @@ -99,7 +99,7 @@ Grid.RowSpan="2" Grid.Column="2" MinWidth="4" - Margin="0,8,0,40" + Margin="0,60,0,40" HorizontalAlignment="Left" AllowFocusOnInteraction="True" Background="Transparent" @@ -128,24 +128,39 @@ x:Name="ContentPresenter" Grid.Row="1" Grid.Column="2" - Margin="2,0,0,0" + Margin="2,0,8,0" HorizontalAlignment="Stretch"> + + + + @@ -156,7 +171,7 @@ @@ -180,10 +195,8 @@ - - - + @@ -199,10 +212,8 @@ - - - + diff --git a/src/Files.App/UserControls/StatusBar.xaml b/src/Files.App/UserControls/StatusBar.xaml index 52b6aaa503398..8a9e5cd81a96f 100644 --- a/src/Files.App/UserControls/StatusBar.xaml +++ b/src/Files.App/UserControls/StatusBar.xaml @@ -101,7 +101,7 @@ - + diff --git a/src/Files.App/Views/MainPage.xaml b/src/Files.App/Views/MainPage.xaml index 18e69dd153473..0bb92c5293276 100644 --- a/src/Files.App/Views/MainPage.xaml +++ b/src/Files.App/Views/MainPage.xaml @@ -215,13 +215,27 @@ SelectedItem="{x:Bind SidebarAdaptiveViewModel.SidebarSelectedItem, Mode=TwoWay}" ViewModel="{x:Bind SidebarAdaptiveViewModel}"> + + + + + + + + + - - - - - + diff --git a/src/Files.App/Views/MainPage.xaml.cs b/src/Files.App/Views/MainPage.xaml.cs index d8c875ccdf40e..57ddc4f8ae02d 100644 --- a/src/Files.App/Views/MainPage.xaml.cs +++ b/src/Files.App/Views/MainPage.xaml.cs @@ -390,9 +390,9 @@ private void UpdatePositioning() PaneColumn.Width = new GridLength(0); break; case PreviewPanePositions.Right: - PreviewPane.SetValue(Grid.RowProperty, 1); + PreviewPane.SetValue(Grid.RowProperty, 0); PreviewPane.SetValue(Grid.ColumnProperty, 2); - PaneSplitter.SetValue(Grid.RowProperty, 1); + PaneSplitter.SetValue(Grid.RowProperty, 0); PaneSplitter.SetValue(Grid.ColumnProperty, 1); PaneSplitter.Width = 2; PaneSplitter.Height = RootGrid.ActualHeight; @@ -406,9 +406,9 @@ private void UpdatePositioning() PaneRow.Height = new GridLength(0); break; case PreviewPanePositions.Bottom: - PreviewPane.SetValue(Grid.RowProperty, 3); + PreviewPane.SetValue(Grid.RowProperty, 2); PreviewPane.SetValue(Grid.ColumnProperty, 0); - PaneSplitter.SetValue(Grid.RowProperty, 2); + PaneSplitter.SetValue(Grid.RowProperty, 1); PaneSplitter.SetValue(Grid.ColumnProperty, 0); PaneSplitter.Height = 2; PaneSplitter.Width = RootGrid.ActualWidth;