diff --git a/src/Files.App.Controls/Sidebar/SidebarView.Properties.cs b/src/Files.App.Controls/Sidebar/SidebarView.Properties.cs index c6dfc8460122..966484265344 100644 --- a/src/Files.App.Controls/Sidebar/SidebarView.Properties.cs +++ b/src/Files.App.Controls/Sidebar/SidebarView.Properties.cs @@ -21,6 +21,14 @@ public UIElement InnerContent public static readonly DependencyProperty InnerContentProperty = DependencyProperty.Register(nameof(InnerContent), typeof(UIElement), typeof(SidebarView), new PropertyMetadata(null)); + public UIElement SidebarContent + { + get { return (UIElement)GetValue(SidebarContentProperty); } + set { SetValue(SidebarContentProperty, value); } + } + public static readonly DependencyProperty SidebarContentProperty = + DependencyProperty.Register("SidebarContent", typeof(UIElement), typeof(SidebarView), new PropertyMetadata(null)); + public UIElement Footer { get { return (UIElement)GetValue(FooterProperty); } diff --git a/src/Files.App.Controls/Sidebar/SidebarView.xaml b/src/Files.App.Controls/Sidebar/SidebarView.xaml index 98d2a9770d6d..aae90d4bf35d 100644 --- a/src/Files.App.Controls/Sidebar/SidebarView.xaml +++ b/src/Files.App.Controls/Sidebar/SidebarView.xaml @@ -57,6 +57,15 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Files.App/Assets/Sidebar/EmptySidebar_100_ThemeLight.svg b/src/Files.App/Assets/Sidebar/EmptySidebar_100_ThemeLight.svg new file mode 100644 index 000000000000..9b09b8760503 --- /dev/null +++ b/src/Files.App/Assets/Sidebar/EmptySidebar_100_ThemeLight.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Files.App/Assets/Sidebar/EmptySidebar_200_ThemeDark.svg b/src/Files.App/Assets/Sidebar/EmptySidebar_200_ThemeDark.svg new file mode 100644 index 000000000000..2c0ac5003ea2 --- /dev/null +++ b/src/Files.App/Assets/Sidebar/EmptySidebar_200_ThemeDark.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Files.App/Assets/Sidebar/EmptySidebar_200_ThemeLight.svg b/src/Files.App/Assets/Sidebar/EmptySidebar_200_ThemeLight.svg new file mode 100644 index 000000000000..202e31370a22 --- /dev/null +++ b/src/Files.App/Assets/Sidebar/EmptySidebar_200_ThemeLight.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Files.App/Assets/Sidebar/EmptySidebar_48_ThemeDark.svg b/src/Files.App/Assets/Sidebar/EmptySidebar_48_ThemeDark.svg new file mode 100644 index 000000000000..55ac929e7e6d --- /dev/null +++ b/src/Files.App/Assets/Sidebar/EmptySidebar_48_ThemeDark.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/Files.App/Assets/Sidebar/EmptySidebar_48_ThemeLight.svg b/src/Files.App/Assets/Sidebar/EmptySidebar_48_ThemeLight.svg new file mode 100644 index 000000000000..d2fde0aae14e --- /dev/null +++ b/src/Files.App/Assets/Sidebar/EmptySidebar_48_ThemeLight.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/Files.App/Strings/en-US/Resources.resw b/src/Files.App/Strings/en-US/Resources.resw index c829bb40622f..6a4a933f70a4 100644 --- a/src/Files.App/Strings/en-US/Resources.resw +++ b/src/Files.App/Strings/en-US/Resources.resw @@ -3508,7 +3508,7 @@ Cloning {0} from "{1}" to "{2}" Shown in a StatusCenter card. - + Canceled installing {0} fonts Shown in a StatusCenter card. @@ -3540,7 +3540,7 @@ Installing {0} font(s) from "{1}" Shown in a StatusCenter card. - + Canceled copying {0} item(s) to "{1}" Shown in a StatusCenter card. @@ -4193,4 +4193,7 @@ Enable Omnibar + + You can add sections to the sidebar by right-clicking and selecting the sections you want to add. + \ No newline at end of file diff --git a/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs b/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs index dafd4cb579b3..37c13ec64a7e 100644 --- a/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/SidebarViewModel.cs @@ -59,6 +59,7 @@ public SidebarDisplayMode SidebarDisplayMode if (SetProperty(ref sidebarDisplayMode, value)) { OnPropertyChanged(nameof(IsSidebarCompactSize)); + OnPropertyChanged(nameof(AreSectionsHidden)); IsSidebarOpen = sidebarDisplayMode == SidebarDisplayMode.Expanded; UpdateTabControlMargin(); } @@ -134,6 +135,16 @@ public bool IsSidebarOpen } } + public bool AreSectionsHidden => + !ShowPinnedFoldersSection && + !ShowLibrarySection && + !ShowDrivesSection && + !ShowCloudDrivesSection && + !ShowNetworkSection && + (!ShowWslSection || WSLDistroManager.Distros.Any() == false) && + !ShowFileTagsSection && + SidebarDisplayMode is not SidebarDisplayMode.Compact; + public bool ShowPinnedFoldersSection { get => UserSettingsService.GeneralSettingsService.ShowPinnedSection; @@ -635,30 +646,37 @@ private async void UserSettingsService_OnSettingChangedEvent(object sender, Sett case nameof(UserSettingsService.GeneralSettingsService.ShowPinnedSection): await UpdateSectionVisibilityAsync(SectionType.Pinned, ShowPinnedFoldersSection); OnPropertyChanged(nameof(ShowPinnedFoldersSection)); + OnPropertyChanged(nameof(AreSectionsHidden)); break; case nameof(UserSettingsService.GeneralSettingsService.ShowLibrarySection): await UpdateSectionVisibilityAsync(SectionType.Library, ShowLibrarySection); OnPropertyChanged(nameof(ShowLibrarySection)); + OnPropertyChanged(nameof(AreSectionsHidden)); break; case nameof(UserSettingsService.GeneralSettingsService.ShowCloudDrivesSection): await UpdateSectionVisibilityAsync(SectionType.CloudDrives, ShowCloudDrivesSection); OnPropertyChanged(nameof(ShowCloudDrivesSection)); + OnPropertyChanged(nameof(AreSectionsHidden)); break; case nameof(UserSettingsService.GeneralSettingsService.ShowDrivesSection): await UpdateSectionVisibilityAsync(SectionType.Drives, ShowDrivesSection); OnPropertyChanged(nameof(ShowDrivesSection)); + OnPropertyChanged(nameof(AreSectionsHidden)); break; case nameof(UserSettingsService.GeneralSettingsService.ShowNetworkSection): await UpdateSectionVisibilityAsync(SectionType.Network, ShowNetworkSection); OnPropertyChanged(nameof(ShowNetworkSection)); + OnPropertyChanged(nameof(AreSectionsHidden)); break; case nameof(UserSettingsService.GeneralSettingsService.ShowWslSection): await UpdateSectionVisibilityAsync(SectionType.WSL, ShowWslSection); OnPropertyChanged(nameof(ShowWslSection)); + OnPropertyChanged(nameof(AreSectionsHidden)); break; case nameof(UserSettingsService.GeneralSettingsService.ShowFileTagsSection): await UpdateSectionVisibilityAsync(SectionType.FileTag, ShowFileTagsSection); OnPropertyChanged(nameof(ShowFileTagsSection)); + OnPropertyChanged(nameof(AreSectionsHidden)); break; } } diff --git a/src/Files.App/Views/MainPage.xaml b/src/Files.App/Views/MainPage.xaml index 9cc2f82fb00d..e735afbf2d7d 100644 --- a/src/Files.App/Views/MainPage.xaml +++ b/src/Files.App/Views/MainPage.xaml @@ -31,6 +31,24 @@ + + + ms-appx:///Assets/Sidebar/EmptySidebar_48_ThemeLight.svg + ms-appx:///Assets/Sidebar/EmptySidebar_100_ThemeLight.svg + ms-appx:///Assets/Sidebar/EmptySidebar_200_ThemeLight.svg + + + ms-appx:///Assets/Sidebar/EmptySidebar_48_ThemeDark.svg + ms-appx:///Assets/Sidebar/EmptySidebar_100_ThemeDark.svg + ms-appx:///Assets/Sidebar/EmptySidebar_200_ThemeDark.svg + + + ms-appx:///Assets/Sidebar/EmptySidebar_48_ThemeDark.svg + ms-appx:///Assets/Sidebar/EmptySidebar_100_ThemeDark.svg + ms-appx:///Assets/Sidebar/EmptySidebar_200_ThemeDark.svg + + + True False @@ -259,6 +277,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -337,6 +421,7 @@ + diff --git a/src/Files.App/Views/MainPage.xaml.cs b/src/Files.App/Views/MainPage.xaml.cs index 1ad32eb98844..4d8bf7a8d059 100644 --- a/src/Files.App/Views/MainPage.xaml.cs +++ b/src/Files.App/Views/MainPage.xaml.cs @@ -55,6 +55,8 @@ public MainPage() _updateDateDisplayTimer = DispatcherQueue.CreateTimer(); _updateDateDisplayTimer.Interval = TimeSpan.FromSeconds(1); _updateDateDisplayTimer.Tick += UpdateDateDisplayTimer_Tick; + + ApplySidebarWidthState(); } private async Task PromptForReviewAsync() @@ -120,6 +122,9 @@ private void UserSettingsService_OnSettingChangedEvent(object? sender, SettingCh case nameof(IInfoPaneSettingsService.IsInfoPaneEnabled): LoadPaneChanged(); break; + case nameof(IAppearanceSettingsService.SidebarWidth): + ApplySidebarWidthState(); + break; } } @@ -434,6 +439,16 @@ private void PaneSplitter_ManipulationCompleted(object sender, ManipulationCompl this.ChangeCursor(InputSystemCursor.Create(InputSystemCursorShape.Arrow)); } + private void ApplySidebarWidthState() + { + if (UserSettingsService.AppearanceSettingsService.SidebarWidth > 340) + VisualStateManager.GoToState(this, "LargeSidebarWidthState", true); + else if (UserSettingsService.AppearanceSettingsService.SidebarWidth > 280) + VisualStateManager.GoToState(this, "MediumSidebarWidthState", true); + else + VisualStateManager.GoToState(this, "SmallSidebarWidthState", true); + } + private void LoadPaneChanged() { try