From ec2d7717262e2c17d415623b3a3a59b8c6bb1ed8 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Feb 2024 12:25:37 -0500 Subject: [PATCH 1/4] Feature: Update layout size selection state Update LayoutAction.cs Fix Fix --- src/Files.App/Actions/Display/LayoutAction.cs | 8 ++-- .../Helpers/Layout/LayoutSizeKindHelper.cs | 24 +++++------ .../Settings/LayoutSettingsService.cs | 2 +- .../UserControls/InnerNavigationToolbar.xaml | 43 +++++++++++++------ .../UserControls/AddressToolbarViewModel.cs | 39 +++++++++++++++++ .../Data/Enums/ColumnsViewSizeKind.cs | 10 ++--- .../Data/Enums/DetailsViewSizeKind.cs | 10 ++--- src/Files.Core/Data/Enums/GridViewSizeKind.cs | 8 ++-- src/Files.Core/Data/Enums/ListViewSizeKind.cs | 10 ++--- 9 files changed, 106 insertions(+), 48 deletions(-) diff --git a/src/Files.App/Actions/Display/LayoutAction.cs b/src/Files.App/Actions/Display/LayoutAction.cs index 85164ef35bf0..d5f67dcf7244 100644 --- a/src/Files.App/Actions/Display/LayoutAction.cs +++ b/src/Files.App/Actions/Display/LayoutAction.cs @@ -190,7 +190,7 @@ public HotKey MediaHotKey ContentPageContext.PageType is not ContentPageTypes.Home && ((DisplayPageContext.LayoutType == LayoutTypes.Details && UserSettingsService.LayoutSettingsService.DetailsViewSize > DetailsViewSizeKind.Compact) || (DisplayPageContext.LayoutType == LayoutTypes.List && UserSettingsService.LayoutSettingsService.ListViewSize > ListViewSizeKind.Compact) || - (DisplayPageContext.LayoutType == LayoutTypes.Grid && UserSettingsService.LayoutSettingsService.GridViewSize > GridViewSizeKind.Compact) || + (DisplayPageContext.LayoutType == LayoutTypes.Grid && UserSettingsService.LayoutSettingsService.GridViewSize > GridViewSizeKind.Small) || (DisplayPageContext.LayoutType == LayoutTypes.Columns && UserSettingsService.LayoutSettingsService.ColumnsViewSize > ColumnsViewSizeKind.Compact)); public LayoutDecreaseSizeAction() @@ -248,7 +248,7 @@ public Task ExecuteAsync() case LayoutTypes.Tiles: break; case LayoutTypes.Grid: - if (UserSettingsService.LayoutSettingsService.GridViewSize > GridViewSizeKind.Compact) + if (UserSettingsService.LayoutSettingsService.GridViewSize > GridViewSizeKind.Small) UserSettingsService.LayoutSettingsService.GridViewSize -= 1; break; case LayoutTypes.Columns: @@ -283,7 +283,7 @@ public HotKey MediaHotKey ContentPageContext.PageType is not ContentPageTypes.Home && ((DisplayPageContext.LayoutType == LayoutTypes.Details && UserSettingsService.LayoutSettingsService.DetailsViewSize < DetailsViewSizeKind.ExtraLarge) || (DisplayPageContext.LayoutType == LayoutTypes.List && UserSettingsService.LayoutSettingsService.ListViewSize < ListViewSizeKind.ExtraLarge) || - (DisplayPageContext.LayoutType == LayoutTypes.Grid && UserSettingsService.LayoutSettingsService.GridViewSize < GridViewSizeKind.Eleven) || + (DisplayPageContext.LayoutType == LayoutTypes.Grid && UserSettingsService.LayoutSettingsService.GridViewSize < GridViewSizeKind.ExtraLarge) || (DisplayPageContext.LayoutType == LayoutTypes.Columns && UserSettingsService.LayoutSettingsService.ColumnsViewSize < ColumnsViewSizeKind.ExtraLarge)); public LayoutIncreaseSizeAction() @@ -341,7 +341,7 @@ public Task ExecuteAsync() case LayoutTypes.Tiles: break; case LayoutTypes.Grid: - if (UserSettingsService.LayoutSettingsService.GridViewSize < GridViewSizeKind.Eleven) + if (UserSettingsService.LayoutSettingsService.GridViewSize < GridViewSizeKind.ExtraLarge) UserSettingsService.LayoutSettingsService.GridViewSize += 1; break; case LayoutTypes.Columns: diff --git a/src/Files.App/Helpers/Layout/LayoutSizeKindHelper.cs b/src/Files.App/Helpers/Layout/LayoutSizeKindHelper.cs index 557ad9749fe2..430ff0175657 100644 --- a/src/Files.App/Helpers/Layout/LayoutSizeKindHelper.cs +++ b/src/Files.App/Helpers/Layout/LayoutSizeKindHelper.cs @@ -40,29 +40,29 @@ public static int GetGridViewItemWidth(GridViewSizeKind gridViewSizeKind) { switch (gridViewSizeKind) { - case GridViewSizeKind.Compact: - return 80; case GridViewSizeKind.Small: - return 100; + return 80; case GridViewSizeKind.Medium: + return 100; + case GridViewSizeKind.Three: return 120; - case GridViewSizeKind.Large: + case GridViewSizeKind.Four: return 140; - case GridViewSizeKind.ExtraLarge: - return 160; case GridViewSizeKind.Five: - return 180; + return 160; case GridViewSizeKind.Six: - return 200; + return 180; case GridViewSizeKind.Seven: + return 200; + case GridViewSizeKind.Large: return 220; - case GridViewSizeKind.Eight: - return 240; case GridViewSizeKind.Nine: - return 260; + return 240; case GridViewSizeKind.Ten: - return 280; + return 260; case GridViewSizeKind.Eleven: + return 280; + case GridViewSizeKind.ExtraLarge: return 300; default: return 100; diff --git a/src/Files.App/Services/Settings/LayoutSettingsService.cs b/src/Files.App/Services/Settings/LayoutSettingsService.cs index 61892b9cf7e7..5e0a7772fecf 100644 --- a/src/Files.App/Services/Settings/LayoutSettingsService.cs +++ b/src/Files.App/Services/Settings/LayoutSettingsService.cs @@ -31,7 +31,7 @@ public TilesViewSizeKind TilesViewSize public GridViewSizeKind GridViewSize { - get => Get(GridViewSizeKind.ExtraLarge); + get => Get(GridViewSizeKind.Large); set => Set(value); } diff --git a/src/Files.App/UserControls/InnerNavigationToolbar.xaml b/src/Files.App/UserControls/InnerNavigationToolbar.xaml index f3634b86ab23..f2e93e2135fc 100644 --- a/src/Files.App/UserControls/InnerNavigationToolbar.xaml +++ b/src/Files.App/UserControls/InnerNavigationToolbar.xaml @@ -779,12 +779,12 @@ x:Name="DetailsViewSlider" Padding="4,0,4,0" IsThumbToolTipEnabled="False" - Maximum="4" - Minimum="0" + Maximum="5" + Minimum="1" SnapsTo="Ticks" TickFrequency="1" TickPlacement="BottomRight" - Value="{x:Bind UserSettingsService.LayoutSettingsService.DetailsViewSize, Mode=TwoWay, Converter={StaticResource GenericEnumConverter}, ConverterParameter='0-0,1-1,2-2,3-3,4-4'}" /> + Value="{x:Bind UserSettingsService.LayoutSettingsService.DetailsViewSize, Mode=TwoWay, Converter={StaticResource GenericEnumConverter}, ConverterParameter='1-1,2-2,3-3,4-4,5-5'}" /> @@ -803,30 +803,35 @@ Grid.Column="0" Width="28" Height="28" + IsSelected="{x:Bind ViewModel.IsSizeCompact, Mode=OneWay}" Style="{StaticResource ColorIconLayoutSizesCompact}" /> @@ -840,12 +845,12 @@ x:Name="ListViewSlider" Padding="4,0,4,0" IsThumbToolTipEnabled="False" - Maximum="4" - Minimum="0" + Maximum="5" + Minimum="1" SnapsTo="Ticks" TickFrequency="1" TickPlacement="BottomRight" - Value="{x:Bind UserSettingsService.LayoutSettingsService.ListViewSize, Mode=TwoWay, Converter={StaticResource GenericEnumConverter}, ConverterParameter='0-0,1-1,2-2,3-3,4-4'}" /> + Value="{x:Bind UserSettingsService.LayoutSettingsService.ListViewSize, Mode=TwoWay, Converter={StaticResource GenericEnumConverter}, ConverterParameter='1-1,2-2,3-3,4-4,5-5'}" /> @@ -865,30 +870,35 @@ Grid.Column="0" Width="28" Height="28" + IsSelected="{x:Bind ViewModel.IsSizeCompact, Mode=OneWay}" Style="{StaticResource ColorIconLayoutSizesCompact}" /> @@ -918,12 +928,12 @@ x:Name="GridViewSlider" Padding="4,0,4,0" IsThumbToolTipEnabled="False" - Maximum="11" - Minimum="0" + Maximum="12" + Minimum="1" SnapsTo="Ticks" TickFrequency="1" TickPlacement="BottomRight" - Value="{x:Bind UserSettingsService.LayoutSettingsService.GridViewSize, Mode=TwoWay, Converter={StaticResource GenericEnumConverter}, ConverterParameter='0-0,1-1,2-2,3-3,4-4,5-5,6-6,7-7,8-8,9-9,10-10,11-11'}" /> + Value="{x:Bind UserSettingsService.LayoutSettingsService.GridViewSize, Mode=TwoWay, Converter={StaticResource GenericEnumConverter}, ConverterParameter='1-1,2-2,3-3,4-4,5-5,6-6,7-7,8-8,9-9,10-10,11-11,12-12'}" /> @@ -956,24 +966,28 @@ Grid.Column="0" Width="28" Height="28" + IsSelected="{x:Bind ViewModel.IsSizeSmall, Mode=OneWay}" Style="{StaticResource ColorIconLayoutSizesSmall}" /> @@ -987,12 +1001,12 @@ x:Name="ColumnViewSlider" Padding="4,0,4,0" IsThumbToolTipEnabled="False" - Maximum="4" - Minimum="0" + Maximum="5" + Minimum="1" SnapsTo="Ticks" TickFrequency="1" TickPlacement="BottomRight" - Value="{x:Bind UserSettingsService.LayoutSettingsService.ColumnsViewSize, Mode=TwoWay, Converter={StaticResource GenericEnumConverter}, ConverterParameter='0-0,1-1,2-2,3-3,4-4'}" /> + Value="{x:Bind UserSettingsService.LayoutSettingsService.ColumnsViewSize, Mode=TwoWay, Converter={StaticResource GenericEnumConverter}, ConverterParameter='1-1,2-2,3-3,4-4,5-5'}" /> @@ -1011,30 +1025,35 @@ Grid.Column="0" Width="28" Height="28" + IsSelected="{x:Bind ViewModel.IsSizeCompact, Mode=OneWay}" Style="{StaticResource ColorIconLayoutSizesCompact}" /> diff --git a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs index c11050bb32d9..9ab456f93bb7 100644 --- a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs @@ -262,6 +262,16 @@ private void UserSettingsService_OnSettingChangedEvent(object? sender, SettingCh RefreshWidgetsRequested?.Invoke(this, EventArgs.Empty); OnPropertyChanged(e.SettingName); break; + case nameof(UserSettingsService.LayoutSettingsService.DetailsViewSize): + case nameof(UserSettingsService.LayoutSettingsService.ListViewSize): + case nameof(UserSettingsService.LayoutSettingsService.ColumnsViewSize): + case nameof(UserSettingsService.LayoutSettingsService.GridViewSize): + OnPropertyChanged(nameof(IsSizeCompact)); + OnPropertyChanged(nameof(IsSizeSmall)); + OnPropertyChanged(nameof(IsSizeMedium)); + OnPropertyChanged(nameof(IsSizeLarge)); + OnPropertyChanged(nameof(IsSizeExtraLarge)); + break; } } @@ -963,6 +973,11 @@ private void FolderSettings_PropertyChanged(object? sender, PropertyChangedEvent OnPropertyChanged(nameof(IsColumnLayout)); OnPropertyChanged(nameof(IsGridLayout)); OnPropertyChanged(nameof(IsDetailsLayout)); + OnPropertyChanged(nameof(IsSizeCompact)); + OnPropertyChanged(nameof(IsSizeSmall)); + OnPropertyChanged(nameof(IsSizeMedium)); + OnPropertyChanged(nameof(IsSizeLarge)); + OnPropertyChanged(nameof(IsSizeExtraLarge)); break; } } @@ -1017,6 +1032,30 @@ public List SelectedItems public bool IsDetailsLayout => instanceViewModel.FolderSettings.LayoutMode is FolderLayoutModes.DetailsView; public bool IsListLayout => instanceViewModel.FolderSettings.LayoutMode is FolderLayoutModes.ListView; + public bool IsSizeCompact => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Compact) || + (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Compact) || + (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Compact); + + public bool IsSizeSmall => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Small) || + (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Small) || + (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Small) || + (IsGridLayout && UserSettingsService.LayoutSettingsService.GridViewSize == GridViewSizeKind.Small); + + public bool IsSizeMedium => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Medium) || + (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Medium) || + (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Medium) || + (IsGridLayout && UserSettingsService.LayoutSettingsService.GridViewSize == GridViewSizeKind.Medium); + + public bool IsSizeLarge => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Large) || + (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Large) || + (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Large) || + (IsGridLayout && UserSettingsService.LayoutSettingsService.GridViewSize == GridViewSizeKind.Large); + + public bool IsSizeExtraLarge => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.ExtraLarge) || + (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.ExtraLarge) || + (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.ExtraLarge) || + (IsGridLayout && UserSettingsService.LayoutSettingsService.GridViewSize == GridViewSizeKind.ExtraLarge); + public string ExtractToText => IsSelectionArchivesOnly ? SelectedItems.Count > 1 ? string.Format("ExtractToChildFolder".GetLocalizedResource(), $"*{Path.DirectorySeparatorChar}") : string.Format("ExtractToChildFolder".GetLocalizedResource() + "\\", Path.GetFileNameWithoutExtension(selectedItems.First().Name)) : "ExtractToChildFolder".GetLocalizedResource(); diff --git a/src/Files.Core/Data/Enums/ColumnsViewSizeKind.cs b/src/Files.Core/Data/Enums/ColumnsViewSizeKind.cs index 4e773822271b..2952cbf672f9 100644 --- a/src/Files.Core/Data/Enums/ColumnsViewSizeKind.cs +++ b/src/Files.Core/Data/Enums/ColumnsViewSizeKind.cs @@ -5,10 +5,10 @@ namespace Files.Core.Data.Enums { public enum ColumnsViewSizeKind { - Compact = 0, - Small = 1, - Medium = 2, - Large = 3, - ExtraLarge = 4, + Compact = 1, + Small = 2, + Medium = 3, + Large = 4, + ExtraLarge = 5, } } diff --git a/src/Files.Core/Data/Enums/DetailsViewSizeKind.cs b/src/Files.Core/Data/Enums/DetailsViewSizeKind.cs index 6a11a492d757..b04a57e2ac2b 100644 --- a/src/Files.Core/Data/Enums/DetailsViewSizeKind.cs +++ b/src/Files.Core/Data/Enums/DetailsViewSizeKind.cs @@ -5,10 +5,10 @@ namespace Files.Core.Data.Enums { public enum DetailsViewSizeKind { - Compact = 0, - Small = 1, - Medium = 2, - Large = 3, - ExtraLarge = 4, + Compact = 1, + Small = 2, + Medium = 3, + Large = 4, + ExtraLarge = 5, } } diff --git a/src/Files.Core/Data/Enums/GridViewSizeKind.cs b/src/Files.Core/Data/Enums/GridViewSizeKind.cs index 7e1cf480bc02..3fe606cff706 100644 --- a/src/Files.Core/Data/Enums/GridViewSizeKind.cs +++ b/src/Files.Core/Data/Enums/GridViewSizeKind.cs @@ -5,17 +5,17 @@ namespace Files.Core.Data.Enums { public enum GridViewSizeKind { - Compact = 0, Small = 1, Medium = 2, - Large = 3, - ExtraLarge = 4, + Three = 3, + Four = 4, Five = 5, Six = 6, Seven = 7, - Eight = 8, + Large = 8, Nine = 9, Ten = 10, Eleven = 11, + ExtraLarge = 12, } } diff --git a/src/Files.Core/Data/Enums/ListViewSizeKind.cs b/src/Files.Core/Data/Enums/ListViewSizeKind.cs index 08375c218f09..a7315b8629d4 100644 --- a/src/Files.Core/Data/Enums/ListViewSizeKind.cs +++ b/src/Files.Core/Data/Enums/ListViewSizeKind.cs @@ -5,10 +5,10 @@ namespace Files.Core.Data.Enums { public enum ListViewSizeKind { - Compact = 0, - Small = 1, - Medium = 2, - Large = 3, - ExtraLarge = 4, + Compact = 1, + Small = 2, + Medium = 3, + Large = 4, + ExtraLarge = 5, } } From a4805ddb09f47ef314f61f06041d848da3ec26e4 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Feb 2024 12:53:04 -0800 Subject: [PATCH 2/4] Update src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs Co-authored-by: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> --- .../ViewModels/UserControls/AddressToolbarViewModel.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs index 9ab456f93bb7..d7449cb85236 100644 --- a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs @@ -1032,7 +1032,8 @@ public List SelectedItems public bool IsDetailsLayout => instanceViewModel.FolderSettings.LayoutMode is FolderLayoutModes.DetailsView; public bool IsListLayout => instanceViewModel.FolderSettings.LayoutMode is FolderLayoutModes.ListView; - public bool IsSizeCompact => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Compact) || + public bool IsSizeCompact => + (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Compact) || (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Compact) || (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Compact); From 9a9e0369c0e5eb33da4259058bc8cd60a3f193f7 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:57:14 -0500 Subject: [PATCH 3/4] Update AddressToolbarViewModel.cs --- .../UserControls/AddressToolbarViewModel.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs index d7449cb85236..e174f5f5198f 100644 --- a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs @@ -1037,22 +1037,26 @@ public List SelectedItems (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Compact) || (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Compact); - public bool IsSizeSmall => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Small) || + public bool IsSizeSmall => + (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Small) || (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Small) || (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Small) || (IsGridLayout && UserSettingsService.LayoutSettingsService.GridViewSize == GridViewSizeKind.Small); - public bool IsSizeMedium => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Medium) || + public bool IsSizeMedium => + (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Medium) || (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Medium) || (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Medium) || (IsGridLayout && UserSettingsService.LayoutSettingsService.GridViewSize == GridViewSizeKind.Medium); - public bool IsSizeLarge => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Large) || + public bool IsSizeLarge => + (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Large) || (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Large) || (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Large) || (IsGridLayout && UserSettingsService.LayoutSettingsService.GridViewSize == GridViewSizeKind.Large); - public bool IsSizeExtraLarge => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.ExtraLarge) || + public bool IsSizeExtraLarge => + (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.ExtraLarge) || (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.ExtraLarge) || (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.ExtraLarge) || (IsGridLayout && UserSettingsService.LayoutSettingsService.GridViewSize == GridViewSizeKind.ExtraLarge); From 8b5a83f00ca6d2967138ffc89f550b3755736a61 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:58:36 -0500 Subject: [PATCH 4/4] Rename --- .../UserControls/InnerNavigationToolbar.xaml | 38 +++++++++---------- .../UserControls/AddressToolbarViewModel.cs | 30 +++++++-------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/Files.App/UserControls/InnerNavigationToolbar.xaml b/src/Files.App/UserControls/InnerNavigationToolbar.xaml index f2e93e2135fc..c21fc5734faf 100644 --- a/src/Files.App/UserControls/InnerNavigationToolbar.xaml +++ b/src/Files.App/UserControls/InnerNavigationToolbar.xaml @@ -803,35 +803,35 @@ Grid.Column="0" Width="28" Height="28" - IsSelected="{x:Bind ViewModel.IsSizeCompact, Mode=OneWay}" + IsSelected="{x:Bind ViewModel.IsLayoutSizeCompact, Mode=OneWay}" Style="{StaticResource ColorIconLayoutSizesCompact}" /> @@ -870,35 +870,35 @@ Grid.Column="0" Width="28" Height="28" - IsSelected="{x:Bind ViewModel.IsSizeCompact, Mode=OneWay}" + IsSelected="{x:Bind ViewModel.IsLayoutSizeCompact, Mode=OneWay}" Style="{StaticResource ColorIconLayoutSizesCompact}" /> @@ -966,28 +966,28 @@ Grid.Column="0" Width="28" Height="28" - IsSelected="{x:Bind ViewModel.IsSizeSmall, Mode=OneWay}" + IsSelected="{x:Bind ViewModel.IsLayoutSizeSmall, Mode=OneWay}" Style="{StaticResource ColorIconLayoutSizesSmall}" /> @@ -1025,35 +1025,35 @@ Grid.Column="0" Width="28" Height="28" - IsSelected="{x:Bind ViewModel.IsSizeCompact, Mode=OneWay}" + IsSelected="{x:Bind ViewModel.IsLayoutSizeCompact, Mode=OneWay}" Style="{StaticResource ColorIconLayoutSizesCompact}" /> diff --git a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs index e174f5f5198f..81e4ed5f2d19 100644 --- a/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs +++ b/src/Files.App/ViewModels/UserControls/AddressToolbarViewModel.cs @@ -266,11 +266,11 @@ private void UserSettingsService_OnSettingChangedEvent(object? sender, SettingCh case nameof(UserSettingsService.LayoutSettingsService.ListViewSize): case nameof(UserSettingsService.LayoutSettingsService.ColumnsViewSize): case nameof(UserSettingsService.LayoutSettingsService.GridViewSize): - OnPropertyChanged(nameof(IsSizeCompact)); - OnPropertyChanged(nameof(IsSizeSmall)); - OnPropertyChanged(nameof(IsSizeMedium)); - OnPropertyChanged(nameof(IsSizeLarge)); - OnPropertyChanged(nameof(IsSizeExtraLarge)); + OnPropertyChanged(nameof(IsLayoutSizeCompact)); + OnPropertyChanged(nameof(IsLayoutSizeSmall)); + OnPropertyChanged(nameof(IsLayoutSizeMedium)); + OnPropertyChanged(nameof(IsLayoutSizeLarge)); + OnPropertyChanged(nameof(IsLayoutSizeExtraLarge)); break; } } @@ -973,11 +973,11 @@ private void FolderSettings_PropertyChanged(object? sender, PropertyChangedEvent OnPropertyChanged(nameof(IsColumnLayout)); OnPropertyChanged(nameof(IsGridLayout)); OnPropertyChanged(nameof(IsDetailsLayout)); - OnPropertyChanged(nameof(IsSizeCompact)); - OnPropertyChanged(nameof(IsSizeSmall)); - OnPropertyChanged(nameof(IsSizeMedium)); - OnPropertyChanged(nameof(IsSizeLarge)); - OnPropertyChanged(nameof(IsSizeExtraLarge)); + OnPropertyChanged(nameof(IsLayoutSizeCompact)); + OnPropertyChanged(nameof(IsLayoutSizeSmall)); + OnPropertyChanged(nameof(IsLayoutSizeMedium)); + OnPropertyChanged(nameof(IsLayoutSizeLarge)); + OnPropertyChanged(nameof(IsLayoutSizeExtraLarge)); break; } } @@ -1032,30 +1032,30 @@ public List SelectedItems public bool IsDetailsLayout => instanceViewModel.FolderSettings.LayoutMode is FolderLayoutModes.DetailsView; public bool IsListLayout => instanceViewModel.FolderSettings.LayoutMode is FolderLayoutModes.ListView; - public bool IsSizeCompact => + public bool IsLayoutSizeCompact => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Compact) || (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Compact) || (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Compact); - public bool IsSizeSmall => + public bool IsLayoutSizeSmall => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Small) || (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Small) || (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Small) || (IsGridLayout && UserSettingsService.LayoutSettingsService.GridViewSize == GridViewSizeKind.Small); - public bool IsSizeMedium => + public bool IsLayoutSizeMedium => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Medium) || (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Medium) || (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Medium) || (IsGridLayout && UserSettingsService.LayoutSettingsService.GridViewSize == GridViewSizeKind.Medium); - public bool IsSizeLarge => + public bool IsLayoutSizeLarge => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Large) || (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Large) || (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Large) || (IsGridLayout && UserSettingsService.LayoutSettingsService.GridViewSize == GridViewSizeKind.Large); - public bool IsSizeExtraLarge => + public bool IsLayoutSizeExtraLarge => (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.ExtraLarge) || (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.ExtraLarge) || (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.ExtraLarge) ||