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..c21fc5734faf 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.IsLayoutSizeCompact, 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.IsLayoutSizeCompact, 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.IsLayoutSizeSmall, 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.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 c11050bb32d9..81e4ed5f2d19 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(IsLayoutSizeCompact)); + OnPropertyChanged(nameof(IsLayoutSizeSmall)); + OnPropertyChanged(nameof(IsLayoutSizeMedium)); + OnPropertyChanged(nameof(IsLayoutSizeLarge)); + OnPropertyChanged(nameof(IsLayoutSizeExtraLarge)); + break; } } @@ -963,6 +973,11 @@ private void FolderSettings_PropertyChanged(object? sender, PropertyChangedEvent OnPropertyChanged(nameof(IsColumnLayout)); OnPropertyChanged(nameof(IsGridLayout)); OnPropertyChanged(nameof(IsDetailsLayout)); + OnPropertyChanged(nameof(IsLayoutSizeCompact)); + OnPropertyChanged(nameof(IsLayoutSizeSmall)); + OnPropertyChanged(nameof(IsLayoutSizeMedium)); + OnPropertyChanged(nameof(IsLayoutSizeLarge)); + OnPropertyChanged(nameof(IsLayoutSizeExtraLarge)); break; } } @@ -1017,6 +1032,35 @@ public List SelectedItems public bool IsDetailsLayout => instanceViewModel.FolderSettings.LayoutMode is FolderLayoutModes.DetailsView; public bool IsListLayout => instanceViewModel.FolderSettings.LayoutMode is FolderLayoutModes.ListView; + public bool IsLayoutSizeCompact => + (IsDetailsLayout && UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Compact) || + (IsListLayout && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Compact) || + (IsColumnLayout && UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Compact); + + 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 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 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 IsLayoutSizeExtraLarge => + (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, } }