Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
Rename
  • Loading branch information
yaira2 committed Feb 23, 2024
1 parent 47a93e5 commit 7ab6150
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 71 deletions.
64 changes: 32 additions & 32 deletions src/Files.App/Actions/Display/LayoutAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@ public HotKey MediaHotKey

public bool IsExecutable =>
ContentPageContext.PageType is not ContentPageTypes.Home &&
((DisplayPageContext.LayoutType == LayoutTypes.Details && UserSettingsService.LayoutSettingsService.ItemSizeDetailsView > DetailsViewSizeKind.Compact) ||
(DisplayPageContext.LayoutType == LayoutTypes.List && UserSettingsService.LayoutSettingsService.ItemSizeListView > ListViewSizeKind.Compact) ||
(DisplayPageContext.LayoutType == LayoutTypes.Grid && UserSettingsService.LayoutSettingsService.ItemSizeGridView > GridViewSizeKind.Compact) ||
(DisplayPageContext.LayoutType == LayoutTypes.Columns && UserSettingsService.LayoutSettingsService.ItemSizeColumnsView > ColumnsViewSizeKind.Compact));
((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.Columns && UserSettingsService.LayoutSettingsService.ColumnsViewSize > ColumnsViewSizeKind.Compact));

public LayoutDecreaseSizeAction()
{
Expand Down Expand Up @@ -224,10 +224,10 @@ private void UserSettingsService_PropertyChanged(object? sender, PropertyChanged
{
switch (e.PropertyName)
{
case nameof(ILayoutSettingsService.ItemSizeDetailsView):
case nameof(ILayoutSettingsService.ItemSizeListView):
case nameof(ILayoutSettingsService.ItemSizeGridView):
case nameof(ILayoutSettingsService.ItemSizeColumnsView):
case nameof(ILayoutSettingsService.DetailsViewSize):
case nameof(ILayoutSettingsService.ListViewSize):
case nameof(ILayoutSettingsService.GridViewSize):
case nameof(ILayoutSettingsService.ColumnsViewSize):
OnPropertyChanged(nameof(IsExecutable));
break;
}
Expand All @@ -238,22 +238,22 @@ public Task ExecuteAsync()
switch (DisplayPageContext.LayoutType)
{
case LayoutTypes.Details:
if (UserSettingsService.LayoutSettingsService.ItemSizeDetailsView > DetailsViewSizeKind.Compact)
UserSettingsService.LayoutSettingsService.ItemSizeDetailsView -= 1;
if (UserSettingsService.LayoutSettingsService.DetailsViewSize > DetailsViewSizeKind.Compact)
UserSettingsService.LayoutSettingsService.DetailsViewSize -= 1;
break;
case LayoutTypes.List:
if (UserSettingsService.LayoutSettingsService.ItemSizeListView > ListViewSizeKind.Compact)
UserSettingsService.LayoutSettingsService.ItemSizeListView -= 1;
if (UserSettingsService.LayoutSettingsService.ListViewSize > ListViewSizeKind.Compact)
UserSettingsService.LayoutSettingsService.ListViewSize -= 1;
break;
case LayoutTypes.Tiles:
break;
case LayoutTypes.Grid:
if (UserSettingsService.LayoutSettingsService.ItemSizeGridView > GridViewSizeKind.Compact)
UserSettingsService.LayoutSettingsService.ItemSizeGridView -= 1;
if (UserSettingsService.LayoutSettingsService.GridViewSize > GridViewSizeKind.Compact)
UserSettingsService.LayoutSettingsService.GridViewSize -= 1;
break;
case LayoutTypes.Columns:
if (UserSettingsService.LayoutSettingsService.ItemSizeColumnsView > ColumnsViewSizeKind.Compact)
UserSettingsService.LayoutSettingsService.ItemSizeColumnsView -= 1;
if (UserSettingsService.LayoutSettingsService.ColumnsViewSize > ColumnsViewSizeKind.Compact)
UserSettingsService.LayoutSettingsService.ColumnsViewSize -= 1;
break;
}

Expand Down Expand Up @@ -281,10 +281,10 @@ public HotKey MediaHotKey

public bool IsExecutable =>
ContentPageContext.PageType is not ContentPageTypes.Home &&
((DisplayPageContext.LayoutType == LayoutTypes.Details && UserSettingsService.LayoutSettingsService.ItemSizeDetailsView < DetailsViewSizeKind.ExtraLarge) ||
(DisplayPageContext.LayoutType == LayoutTypes.List && UserSettingsService.LayoutSettingsService.ItemSizeListView < ListViewSizeKind.ExtraLarge) ||
(DisplayPageContext.LayoutType == LayoutTypes.Grid && UserSettingsService.LayoutSettingsService.ItemSizeGridView < GridViewSizeKind.Eleven) ||
(DisplayPageContext.LayoutType == LayoutTypes.Columns && UserSettingsService.LayoutSettingsService.ItemSizeColumnsView < ColumnsViewSizeKind.ExtraLarge));
((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.Columns && UserSettingsService.LayoutSettingsService.ColumnsViewSize < ColumnsViewSizeKind.ExtraLarge));

public LayoutIncreaseSizeAction()
{
Expand Down Expand Up @@ -317,10 +317,10 @@ private void UserSettingsService_PropertyChanged(object? sender, PropertyChanged
{
switch (e.PropertyName)
{
case nameof(ILayoutSettingsService.ItemSizeDetailsView):
case nameof(ILayoutSettingsService.ItemSizeListView):
case nameof(ILayoutSettingsService.ItemSizeGridView):
case nameof(ILayoutSettingsService.ItemSizeColumnsView):
case nameof(ILayoutSettingsService.DetailsViewSize):
case nameof(ILayoutSettingsService.ListViewSize):
case nameof(ILayoutSettingsService.GridViewSize):
case nameof(ILayoutSettingsService.ColumnsViewSize):
OnPropertyChanged(nameof(IsExecutable));
break;
}
Expand All @@ -331,22 +331,22 @@ public Task ExecuteAsync()
switch (DisplayPageContext.LayoutType)
{
case LayoutTypes.Details:
if (UserSettingsService.LayoutSettingsService.ItemSizeDetailsView < DetailsViewSizeKind.ExtraLarge)
UserSettingsService.LayoutSettingsService.ItemSizeDetailsView += 1;
if (UserSettingsService.LayoutSettingsService.DetailsViewSize < DetailsViewSizeKind.ExtraLarge)
UserSettingsService.LayoutSettingsService.DetailsViewSize += 1;
break;
case LayoutTypes.List:
if (UserSettingsService.LayoutSettingsService.ItemSizeListView < ListViewSizeKind.ExtraLarge)
UserSettingsService.LayoutSettingsService.ItemSizeListView += 1;
if (UserSettingsService.LayoutSettingsService.ListViewSize < ListViewSizeKind.ExtraLarge)
UserSettingsService.LayoutSettingsService.ListViewSize += 1;
break;
case LayoutTypes.Tiles:
break;
case LayoutTypes.Grid:
if (UserSettingsService.LayoutSettingsService.ItemSizeGridView < GridViewSizeKind.Eleven)
UserSettingsService.LayoutSettingsService.ItemSizeGridView += 1;
if (UserSettingsService.LayoutSettingsService.GridViewSize < GridViewSizeKind.Eleven)
UserSettingsService.LayoutSettingsService.GridViewSize += 1;
break;
case LayoutTypes.Columns:
if (UserSettingsService.LayoutSettingsService.ItemSizeColumnsView < ColumnsViewSizeKind.ExtraLarge)
UserSettingsService.LayoutSettingsService.ItemSizeColumnsView += 1;
if (UserSettingsService.LayoutSettingsService.ColumnsViewSize < ColumnsViewSizeKind.ExtraLarge)
UserSettingsService.LayoutSettingsService.ColumnsViewSize += 1;
break;
}

Expand Down
4 changes: 2 additions & 2 deletions src/Files.App/Helpers/Layout/LayoutPreferencesManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,10 @@ public uint GetRoundedIconSize()
=> Constants.ShellIconSizes.Large,
FolderLayoutModes.ColumnView
=> Constants.ShellIconSizes.Large,
_ when LayoutMode == FolderLayoutModes.GridView && UserSettingsService.LayoutSettingsService.ItemSizeGridView <= GridViewSizeKind.Small ||
_ when LayoutMode == FolderLayoutModes.GridView && UserSettingsService.LayoutSettingsService.GridViewSize <= GridViewSizeKind.Small ||
LayoutMode == FolderLayoutModes.TilesView
=> 96,
_ when LayoutMode == FolderLayoutModes.GridView && UserSettingsService.LayoutSettingsService.ItemSizeGridView <= GridViewSizeKind.Large
_ when LayoutMode == FolderLayoutModes.GridView && UserSettingsService.LayoutSettingsService.GridViewSize <= GridViewSizeKind.Large
=> 128,
_ => 256,
};
Expand Down
10 changes: 5 additions & 5 deletions src/Files.App/Services/Settings/LayoutSettingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@ public LayoutSettingsService(ISettingsSharingContext settingsSharingContext)
RegisterSettingsContext(settingsSharingContext);
}

public DetailsViewSizeKind ItemSizeDetailsView
public DetailsViewSizeKind DetailsViewSize
{
get => Get(DetailsViewSizeKind.Small);
set => Set(value);
}

public ListViewSizeKind ItemSizeListView
public ListViewSizeKind ListViewSize
{
get => Get(ListViewSizeKind.Small);
set => Set(value);
}

public TilesViewSizeKind ItemSizeTilesView
public TilesViewSizeKind TilesViewSize
{
get => Get(TilesViewSizeKind.Small);
set => Set(value);
}

public GridViewSizeKind ItemSizeGridView
public GridViewSizeKind GridViewSize
{
get => Get(GridViewSizeKind.ExtraLarge);
set => Set(value);
}

public ColumnsViewSizeKind ItemSizeColumnsView
public ColumnsViewSizeKind ColumnsViewSize
{
get => Get(ColumnsViewSizeKind.Small);
set => Set(value);
Expand Down
8 changes: 4 additions & 4 deletions src/Files.App/UserControls/InnerNavigationToolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@
SnapsTo="Ticks"
TickFrequency="1"
TickPlacement="BottomRight"
Value="{x:Bind UserSettingsService.LayoutSettingsService.ItemSizeDetailsView, 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='0-0,1-1,2-2,3-3,4-4'}" />

<!-- Tiles -->
<Slider
Expand All @@ -799,7 +799,7 @@
SnapsTo="Ticks"
TickFrequency="1"
TickPlacement="BottomRight"
Value="{x:Bind UserSettingsService.LayoutSettingsService.ItemSizeListView, 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='0-0,1-1,2-2,3-3,4-4'}" />

<!-- Grid -->
<Slider
Expand All @@ -811,7 +811,7 @@
TickFrequency="1"
TickPlacement="BottomRight"
Visibility="{x:Bind ViewModel.IsGridLayout, Mode=OneWay}"
Value="{x:Bind UserSettingsService.LayoutSettingsService.ItemSizeGridView, 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='0-0,1-1,2-2,3-3,4-4,5-5,6-6,7-7,8-8,9-9,10-10,11-11'}" />

<!-- Columns -->
<Slider
Expand All @@ -823,7 +823,7 @@
SnapsTo="Ticks"
TickFrequency="1"
TickPlacement="BottomRight"
Value="{x:Bind UserSettingsService.LayoutSettingsService.ItemSizeColumnsView, 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='0-0,1-1,2-2,3-3,4-4'}" />
</Grid>

<!-- (Divider) -->
Expand Down
10 changes: 5 additions & 5 deletions src/Files.App/Views/Layouts/ColumnLayoutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public sealed partial class ColumnLayoutPage : BaseGroupableLayoutPage
/// </summary>
public int RowHeight
{
get => LayoutSizeKindHelper.GetColumnsViewRowHeight(UserSettingsService.LayoutSettingsService.ItemSizeColumnsView);
get => LayoutSizeKindHelper.GetColumnsViewRowHeight(UserSettingsService.LayoutSettingsService.ColumnsViewSize);
set
{
if (value != LayoutSizeKindHelper.GetColumnsViewRowHeight(UserSettingsService.LayoutSettingsService.ItemSizeColumnsView))
if (value != LayoutSizeKindHelper.GetColumnsViewRowHeight(UserSettingsService.LayoutSettingsService.ColumnsViewSize))
{
NotifyPropertyChanged(nameof(RowHeight));
}
Expand Down Expand Up @@ -176,9 +176,9 @@ private void LayoutSettingsService_PropertyChanged(object? sender, PropertyChang
{
// TODO keep scroll position when changing styles (see details view)

if (e.PropertyName == nameof(ILayoutSettingsService.ItemSizeColumnsView))
if (e.PropertyName == nameof(ILayoutSettingsService.ColumnsViewSize))
{
RowHeight = LayoutSizeKindHelper.GetColumnsViewRowHeight(UserSettingsService.LayoutSettingsService.ItemSizeColumnsView);
RowHeight = LayoutSizeKindHelper.GetColumnsViewRowHeight(UserSettingsService.LayoutSettingsService.ColumnsViewSize);
SetItemContainerStyle();
}
}
Expand Down Expand Up @@ -240,7 +240,7 @@ protected override bool CanGetItemFromElement(object element)
/// </summary>
private void SetItemContainerStyle()
{
if (UserSettingsService.LayoutSettingsService.ItemSizeColumnsView == ColumnsViewSizeKind.Compact)
if (UserSettingsService.LayoutSettingsService.ColumnsViewSize == ColumnsViewSizeKind.Compact)
{
// Toggle style to force item size to update
FileList.ItemContainerStyle = RegularItemContainerStyle;
Expand Down
10 changes: 5 additions & 5 deletions src/Files.App/Views/Layouts/DetailsLayoutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ public double MaxWidthForRenameTextbox
/// </summary>
public int RowHeight
{
get => LayoutSizeKindHelper.GetDetailsViewRowHeight((DetailsViewSizeKind)UserSettingsService.LayoutSettingsService.ItemSizeDetailsView);
get => LayoutSizeKindHelper.GetDetailsViewRowHeight((DetailsViewSizeKind)UserSettingsService.LayoutSettingsService.DetailsViewSize);
set
{
if (value != LayoutSizeKindHelper.GetDetailsViewRowHeight((DetailsViewSizeKind)UserSettingsService.LayoutSettingsService.ItemSizeDetailsView))
if (value != LayoutSizeKindHelper.GetDetailsViewRowHeight((DetailsViewSizeKind)UserSettingsService.LayoutSettingsService.DetailsViewSize))
NotifyPropertyChanged(nameof(RowHeight));
}
}
Expand Down Expand Up @@ -195,12 +195,12 @@ protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)

private void LayoutSettingsService_PropertyChanged(object? sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(ILayoutSettingsService.ItemSizeDetailsView))
if (e.PropertyName == nameof(ILayoutSettingsService.DetailsViewSize))
{
// Get current scroll position
var previousOffset = ContentScroller?.VerticalOffset;

RowHeight = LayoutSizeKindHelper.GetDetailsViewRowHeight(UserSettingsService.LayoutSettingsService.ItemSizeDetailsView);
RowHeight = LayoutSizeKindHelper.GetDetailsViewRowHeight(UserSettingsService.LayoutSettingsService.DetailsViewSize);

// Update the container style to match the item size
SetItemContainerStyle();
Expand All @@ -215,7 +215,7 @@ private void LayoutSettingsService_PropertyChanged(object? sender, PropertyChang
/// </summary>
private void SetItemContainerStyle()
{
if (UserSettingsService.LayoutSettingsService.ItemSizeDetailsView == DetailsViewSizeKind.Compact)
if (UserSettingsService.LayoutSettingsService.DetailsViewSize == DetailsViewSizeKind.Compact)
{
// Toggle style to force item size to update
FileList.ItemContainerStyle = RegularItemContainerStyle;
Expand Down
26 changes: 13 additions & 13 deletions src/Files.App/Views/Layouts/GridLayoutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public sealed partial class GridLayoutPage : BaseGroupableLayoutPage
/// </summary>
public int RowHeightListView
{
get => LayoutSizeKindHelper.GetListViewRowHeight(UserSettingsService.LayoutSettingsService.ItemSizeListView);
get => LayoutSizeKindHelper.GetListViewRowHeight(UserSettingsService.LayoutSettingsService.ListViewSize);
set
{
if (value != LayoutSizeKindHelper.GetListViewRowHeight(UserSettingsService.LayoutSettingsService.ItemSizeListView))
if (value != LayoutSizeKindHelper.GetListViewRowHeight(UserSettingsService.LayoutSettingsService.ListViewSize))
NotifyPropertyChanged(nameof(RowHeightListView));
}
}
Expand All @@ -50,10 +50,10 @@ public int RowHeightListView
/// </summary>
public int ItemWidthTilesView
{
get => LayoutSizeKindHelper.GetTilesViewItemWidth(UserSettingsService.LayoutSettingsService.ItemSizeTilesView);
get => LayoutSizeKindHelper.GetTilesViewItemWidth(UserSettingsService.LayoutSettingsService.TilesViewSize);
set
{
if (value != LayoutSizeKindHelper.GetTilesViewItemWidth(UserSettingsService.LayoutSettingsService.ItemSizeTilesView))
if (value != LayoutSizeKindHelper.GetTilesViewItemWidth(UserSettingsService.LayoutSettingsService.TilesViewSize))
NotifyPropertyChanged(nameof(ItemWidthTilesView));
}
}
Expand All @@ -63,10 +63,10 @@ public int ItemWidthTilesView
/// </summary>
public int ItemWidthGridView
{
get => LayoutSizeKindHelper.GetGridViewItemWidth(UserSettingsService.LayoutSettingsService.ItemSizeGridView);
get => LayoutSizeKindHelper.GetGridViewItemWidth(UserSettingsService.LayoutSettingsService.GridViewSize);
set
{
if (value != LayoutSizeKindHelper.GetGridViewItemWidth(UserSettingsService.LayoutSettingsService.ItemSizeGridView))
if (value != LayoutSizeKindHelper.GetGridViewItemWidth(UserSettingsService.LayoutSettingsService.GridViewSize))
NotifyPropertyChanged(nameof(ItemWidthGridView));
}
}
Expand Down Expand Up @@ -164,21 +164,21 @@ private void LayoutSettingsService_PropertyChanged(object? sender, PropertyChang
{
// TODO keep scroll position when changing styles (see details view)

if (e.PropertyName == nameof(ILayoutSettingsService.ItemSizeListView))
if (e.PropertyName == nameof(ILayoutSettingsService.ListViewSize))
{
RowHeightListView = LayoutSizeKindHelper.GetListViewRowHeight(UserSettingsService.LayoutSettingsService.ItemSizeListView);
RowHeightListView = LayoutSizeKindHelper.GetListViewRowHeight(UserSettingsService.LayoutSettingsService.ListViewSize);
SetItemContainerStyle();
FolderSettings_IconHeightChanged();
}
if (e.PropertyName == nameof(ILayoutSettingsService.ItemSizeTilesView))
if (e.PropertyName == nameof(ILayoutSettingsService.TilesViewSize))
{
ItemWidthTilesView = LayoutSizeKindHelper.GetTilesViewItemWidth(UserSettingsService.LayoutSettingsService.ItemSizeTilesView);
ItemWidthTilesView = LayoutSizeKindHelper.GetTilesViewItemWidth(UserSettingsService.LayoutSettingsService.TilesViewSize);
SetItemContainerStyle();
FolderSettings_IconHeightChanged();
}
if (e.PropertyName == nameof(ILayoutSettingsService.ItemSizeGridView))
if (e.PropertyName == nameof(ILayoutSettingsService.GridViewSize))
{
ItemWidthGridView = LayoutSizeKindHelper.GetGridViewItemWidth(UserSettingsService.LayoutSettingsService.ItemSizeGridView);
ItemWidthGridView = LayoutSizeKindHelper.GetGridViewItemWidth(UserSettingsService.LayoutSettingsService.GridViewSize);
SetItemContainerStyle();
FolderSettings_IconHeightChanged();
}
Expand Down Expand Up @@ -238,7 +238,7 @@ private void SetItemTemplate()

private void SetItemContainerStyle()
{
if (FolderSettings?.LayoutMode == FolderLayoutModes.ListView && UserSettingsService.LayoutSettingsService.ItemSizeListView == ListViewSizeKind.Compact)
if (FolderSettings?.LayoutMode == FolderLayoutModes.ListView && UserSettingsService.LayoutSettingsService.ListViewSize == ListViewSizeKind.Compact)
{
// Toggle style to force item size to update
FileList.ItemContainerStyle = DefaultItemContainerStyle;
Expand Down
Loading

0 comments on commit 7ab6150

Please sign in to comment.