Skip to content

Commit 453aacd

Browse files
authored
Merge branch 'files-community:main' into d2dyno/shelf_drop
2 parents f325868 + 33ca84f commit 453aacd

File tree

112 files changed

+1627
-1729
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+1627
-1729
lines changed

src/Files.App (Package)/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<Identity
1717
Name="FilesDev"
1818
Publisher="CN=Files"
19-
Version="3.8.12.0" />
19+
Version="3.8.13.0" />
2020

2121
<Properties>
2222
<DisplayName>Files - Dev</DisplayName>

src/Files.App/Actions/Display/GroupAction.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ public GroupByAction()
177177
public Task ExecuteAsync(object? parameter = null)
178178
{
179179
DisplayContext.GroupOption = GroupOption;
180+
LayoutHelpers.UpdateOpenTabsPreferences();
180181

181182
return Task.CompletedTask;
182183
}
@@ -377,6 +378,7 @@ public Task ExecuteAsync(object? parameter = null)
377378
{
378379
DisplayContext.GroupOption = GroupOption;
379380
DisplayContext.GroupByDateUnit = GroupByDateUnit;
381+
LayoutHelpers.UpdateOpenTabsPreferences();
380382

381383
return Task.CompletedTask;
382384
}
@@ -425,6 +427,7 @@ public GroupAscendingAction()
425427
public Task ExecuteAsync(object? parameter = null)
426428
{
427429
context.GroupDirection = SortDirection.Ascending;
430+
LayoutHelpers.UpdateOpenTabsPreferences();
428431

429432
return Task.CompletedTask;
430433
}
@@ -469,6 +472,7 @@ public GroupDescendingAction()
469472
public Task ExecuteAsync(object? parameter = null)
470473
{
471474
context.GroupDirection = SortDirection.Descending;
475+
LayoutHelpers.UpdateOpenTabsPreferences();
472476

473477
return Task.CompletedTask;
474478
}
@@ -505,6 +509,7 @@ public ToggleGroupDirectionAction()
505509
public Task ExecuteAsync(object? parameter = null)
506510
{
507511
context.GroupDirection = context.SortDirection is SortDirection.Descending ? SortDirection.Ascending : SortDirection.Descending;
512+
LayoutHelpers.UpdateOpenTabsPreferences();
508513

509514
return Task.CompletedTask;
510515
}
@@ -536,6 +541,7 @@ public GroupByYearAction()
536541
public Task ExecuteAsync(object? parameter = null)
537542
{
538543
context.GroupByDateUnit = GroupByDateUnit.Year;
544+
LayoutHelpers.UpdateOpenTabsPreferences();
539545

540546
return Task.CompletedTask;
541547
}
@@ -580,6 +586,7 @@ public GroupByMonthAction()
580586
public Task ExecuteAsync(object? parameter = null)
581587
{
582588
context.GroupByDateUnit = GroupByDateUnit.Month;
589+
LayoutHelpers.UpdateOpenTabsPreferences();
583590

584591
return Task.CompletedTask;
585592
}
@@ -621,6 +628,7 @@ public Task ExecuteAsync(object? parameter = null)
621628
GroupByDateUnit.Month => GroupByDateUnit.Day,
622629
_ => GroupByDateUnit.Year
623630
};
631+
LayoutHelpers.UpdateOpenTabsPreferences();
624632

625633
return Task.CompletedTask;
626634
}

src/Files.App/Actions/Display/LayoutAction.cs

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ protected override LayoutTypes LayoutType
99
=> LayoutTypes.Details;
1010

1111
public override string Label
12-
=> "Details".GetLocalizedResource();
12+
=> Strings.Details.GetLocalizedResource();
1313

1414
public override string Description
15-
=> "LayoutDetailsDescription".GetLocalizedResource();
15+
=> Strings.LayoutDetailsDescription.GetLocalizedResource();
1616

1717
public override RichGlyph Glyph
1818
=> new(themedIconStyle: "App.ThemedIcons.IconLayout.Details");
@@ -27,10 +27,10 @@ protected override LayoutTypes LayoutType
2727
=> LayoutTypes.List;
2828

2929
public override string Label
30-
=> "List".GetLocalizedResource();
30+
=> Strings.List.GetLocalizedResource();
3131

3232
public override string Description
33-
=> "LayoutListDescription".GetLocalizedResource();
33+
=> Strings.LayoutListDescription.GetLocalizedResource();
3434

3535
public override RichGlyph Glyph
3636
=> new(themedIconStyle: "App.ThemedIcons.IconLayout.List");
@@ -39,16 +39,16 @@ public override HotKey HotKey
3939
=> new(Keys.Number2, KeyModifiers.CtrlShift);
4040
}
4141

42-
internal sealed class LayoutTilesAction : ToggleLayoutAction
42+
internal sealed class LayoutCardsAction : ToggleLayoutAction
4343
{
4444
protected override LayoutTypes LayoutType
45-
=> LayoutTypes.Tiles;
45+
=> LayoutTypes.Cards;
4646

4747
public override string Label
48-
=> "Tiles".GetLocalizedResource();
48+
=> Strings.Cards.GetLocalizedResource();
4949

5050
public override string Description
51-
=> "LayoutTilesDescription".GetLocalizedResource();
51+
=> Strings.LayoutCardsDescription.GetLocalizedResource();
5252

5353
public override RichGlyph Glyph
5454
=> new(themedIconStyle: "App.ThemedIcons.IconLayout.Tiles");
@@ -63,10 +63,10 @@ protected override LayoutTypes LayoutType
6363
=> LayoutTypes.Grid;
6464

6565
public override string Label
66-
=> "Grid".GetLocalizedResource();
66+
=> Strings.Grid.GetLocalizedResource();
6767

6868
public override string Description
69-
=> "LayoutGridDescription".GetLocalizedResource();
69+
=> Strings.LayoutGridDescription.GetLocalizedResource();
7070

7171
public override RichGlyph Glyph
7272
=> new(themedIconStyle: "App.ThemedIcons.IconSize.Small");
@@ -81,10 +81,10 @@ protected override LayoutTypes LayoutType
8181
=> LayoutTypes.Columns;
8282

8383
public override string Label
84-
=> "Columns".GetLocalizedResource();
84+
=> Strings.Columns.GetLocalizedResource();
8585

8686
public override string Description
87-
=> "LayoutColumnsDescription".GetLocalizedResource();
87+
=> Strings.LayoutColumnsDescription.GetLocalizedResource();
8888

8989
public override RichGlyph Glyph
9090
=> new(themedIconStyle: "App.ThemedIcons.IconLayout.Columns");
@@ -99,10 +99,10 @@ protected override LayoutTypes LayoutType
9999
=> LayoutTypes.Adaptive;
100100

101101
public override string Label
102-
=> "Adaptive".GetLocalizedResource();
102+
=> Strings.Adaptive.GetLocalizedResource();
103103

104104
public override string Description
105-
=> "LayoutAdaptiveDescription".GetLocalizedResource();
105+
=> Strings.LayoutAdaptiveDescription.GetLocalizedResource();
106106

107107
public override bool IsExecutable
108108
=> Context.IsLayoutAdaptiveEnabled;
@@ -174,10 +174,10 @@ internal sealed class LayoutDecreaseSizeAction : ObservableObject, IAction
174174
private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService<IContentPageContext>();
175175

176176
public string Label
177-
=> "DecreaseSize".GetLocalizedResource();
177+
=> Strings.DecreaseSize.GetLocalizedResource();
178178

179179
public string Description
180-
=> "LayoutDecreaseSizeDescription".GetLocalizedResource();
180+
=> Strings.LayoutDecreaseSizeDescription.GetLocalizedResource();
181181

182182
public HotKey HotKey
183183
=> new(Keys.Subtract, KeyModifiers.Ctrl);
@@ -190,6 +190,7 @@ ContentPageContext.PageType is not ContentPageTypes.Home &&
190190
ContentPageContext.ShellPage?.InstanceViewModel.FolderSettings.LayoutMode is FolderLayoutModes layoutMode &&
191191
((layoutMode is FolderLayoutModes.DetailsView && UserSettingsService.LayoutSettingsService.DetailsViewSize > DetailsViewSizeKind.Compact) ||
192192
(layoutMode is FolderLayoutModes.ListView && UserSettingsService.LayoutSettingsService.ListViewSize > ListViewSizeKind.Compact) ||
193+
(layoutMode is FolderLayoutModes.CardsView && UserSettingsService.LayoutSettingsService.CardsViewSize > CardsViewSizeKind.Small) ||
193194
(layoutMode is FolderLayoutModes.GridView && UserSettingsService.LayoutSettingsService.GridViewSize > GridViewSizeKind.Small) ||
194195
(layoutMode is FolderLayoutModes.ColumnView && UserSettingsService.LayoutSettingsService.ColumnsViewSize > ColumnsViewSizeKind.Compact));
195196

@@ -217,6 +218,7 @@ private void UserSettingsService_PropertyChanged(object? sender, PropertyChanged
217218
case nameof(ILayoutSettingsService.ListViewSize):
218219
case nameof(ILayoutSettingsService.GridViewSize):
219220
case nameof(ILayoutSettingsService.ColumnsViewSize):
221+
case nameof(ILayoutSettingsService.CardsViewSize):
220222
OnPropertyChanged(nameof(IsExecutable));
221223
break;
222224
}
@@ -234,7 +236,9 @@ public Task ExecuteAsync(object? parameter = null)
234236
if (UserSettingsService.LayoutSettingsService.ListViewSize > ListViewSizeKind.Compact)
235237
UserSettingsService.LayoutSettingsService.ListViewSize -= 1;
236238
break;
237-
case FolderLayoutModes.TilesView:
239+
case FolderLayoutModes.CardsView:
240+
if (UserSettingsService.LayoutSettingsService.CardsViewSize > CardsViewSizeKind.Small)
241+
UserSettingsService.LayoutSettingsService.CardsViewSize -= 1;
238242
break;
239243
case FolderLayoutModes.GridView:
240244
if (UserSettingsService.LayoutSettingsService.GridViewSize > GridViewSizeKind.Small)
@@ -258,10 +262,10 @@ internal sealed class LayoutIncreaseSizeAction : ObservableObject, IAction
258262
private readonly IContentPageContext ContentPageContext = Ioc.Default.GetRequiredService<IContentPageContext>();
259263

260264
public string Label
261-
=> "IncreaseSize".GetLocalizedResource();
265+
=> Strings.IncreaseSize.GetLocalizedResource();
262266

263267
public string Description
264-
=> "LayoutIncreaseSizeDescription".GetLocalizedResource();
268+
=> Strings.LayoutIncreaseSizeDescription.GetLocalizedResource();
265269

266270
public HotKey HotKey
267271
=> new(Keys.Add, KeyModifiers.Ctrl);
@@ -274,6 +278,7 @@ ContentPageContext.PageType is not ContentPageTypes.Home &&
274278
ContentPageContext.ShellPage?.InstanceViewModel.FolderSettings.LayoutMode is FolderLayoutModes layoutMode &&
275279
((layoutMode is FolderLayoutModes.DetailsView && UserSettingsService.LayoutSettingsService.DetailsViewSize < DetailsViewSizeKind.ExtraLarge) ||
276280
(layoutMode is FolderLayoutModes.ListView && UserSettingsService.LayoutSettingsService.ListViewSize < ListViewSizeKind.ExtraLarge) ||
281+
(layoutMode is FolderLayoutModes.CardsView && UserSettingsService.LayoutSettingsService.CardsViewSize < CardsViewSizeKind.ExtraLarge) ||
277282
(layoutMode is FolderLayoutModes.GridView && UserSettingsService.LayoutSettingsService.GridViewSize < GridViewSizeKind.ExtraLarge) ||
278283
(layoutMode is FolderLayoutModes.ColumnView && UserSettingsService.LayoutSettingsService.ColumnsViewSize < ColumnsViewSizeKind.ExtraLarge));
279284

@@ -318,7 +323,9 @@ public Task ExecuteAsync(object? parameter = null)
318323
if (UserSettingsService.LayoutSettingsService.ListViewSize < ListViewSizeKind.ExtraLarge)
319324
UserSettingsService.LayoutSettingsService.ListViewSize += 1;
320325
break;
321-
case FolderLayoutModes.TilesView:
326+
case FolderLayoutModes.CardsView:
327+
if (UserSettingsService.LayoutSettingsService.CardsViewSize < CardsViewSizeKind.ExtraLarge)
328+
UserSettingsService.LayoutSettingsService.CardsViewSize += 1;
322329
break;
323330
case FolderLayoutModes.GridView:
324331
if (UserSettingsService.LayoutSettingsService.GridViewSize < GridViewSizeKind.ExtraLarge)

src/Files.App/Actions/Display/SortAction.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ public SortByAction()
165165
public Task ExecuteAsync(object? parameter = null)
166166
{
167167
displayContext.SortOption = SortOption;
168+
LayoutHelpers.UpdateOpenTabsPreferences();
168169

169170
return Task.CompletedTask;
170171
}
@@ -207,6 +208,7 @@ public SortAscendingAction()
207208
public Task ExecuteAsync(object? parameter = null)
208209
{
209210
context.SortDirection = SortDirection.Ascending;
211+
LayoutHelpers.UpdateOpenTabsPreferences();
210212

211213
return Task.CompletedTask;
212214
}
@@ -241,6 +243,7 @@ public SortDescendingAction()
241243
public Task ExecuteAsync(object? parameter = null)
242244
{
243245
context.SortDirection = SortDirection.Descending;
246+
LayoutHelpers.UpdateOpenTabsPreferences();
244247

245248
return Task.CompletedTask;
246249
}
@@ -274,6 +277,8 @@ context.SortDirection is SortDirection.Descending
274277
? SortDirection.Ascending
275278
: SortDirection.Descending;
276279

280+
LayoutHelpers.UpdateOpenTabsPreferences();
281+
277282
return Task.CompletedTask;
278283
}
279284
}

src/Files.App/Actions/Display/SortFilesAndFoldersTogetherAction.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public SortFilesAndFoldersTogetherAction()
2626
public Task ExecuteAsync(object? parameter = null)
2727
{
2828
context.SortDirectoriesAlongsideFiles = true;
29+
LayoutHelpers.UpdateOpenTabsPreferences();
2930

3031
return Task.CompletedTask;
3132
}

src/Files.App/Actions/Display/SortFilesFirstAction.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public Task ExecuteAsync(object? parameter = null)
2727
{
2828
context.SortFilesFirst = true;
2929
context.SortDirectoriesAlongsideFiles = false;
30+
LayoutHelpers.UpdateOpenTabsPreferences();
3031

3132
return Task.CompletedTask;
3233
}

src/Files.App/Actions/Display/SortFoldersFirstAction.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public Task ExecuteAsync(object? parameter = null)
2727
{
2828
context.SortFilesFirst = false;
2929
context.SortDirectoriesAlongsideFiles = false;
30+
LayoutHelpers.UpdateOpenTabsPreferences();
3031

3132
return Task.CompletedTask;
3233
}

src/Files.App/App.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777

7878
<Color x:Key="App.Theme.FillColorAttention">#0070CB</Color>
7979
<SolidColorBrush x:Key="App.Theme.FillColorAttentionBrush" Color="{StaticResource App.Theme.FillColorAttention}" />
80+
<SolidColorBrush x:Key="App.Theme.CardBackgroundFillColorTertiaryBrush" Color="#FFFFFFFF" />
8081
</ResourceDictionary>
8182
<ResourceDictionary x:Key="Dark">
8283
<SolidColorBrush x:Key="App.Theme.BackgroundBrush" Color="Transparent" />
@@ -94,6 +95,7 @@
9495

9596
<Color x:Key="App.Theme.FillColorAttention">#50C0FF</Color>
9697
<SolidColorBrush x:Key="App.Theme.FillColorAttentionBrush" Color="{StaticResource App.Theme.FillColorAttention}" />
98+
<SolidColorBrush x:Key="App.Theme.CardBackgroundFillColorTertiaryBrush" Color="#12FFFFFF" />
9799
</ResourceDictionary>
98100
<ResourceDictionary x:Key="HighContrast">
99101
<SolidColorBrush x:Key="App.Theme.BackgroundBrush" Color="Transparent" />
@@ -111,6 +113,7 @@
111113

112114
<Color x:Key="App.Theme.FillColorAttention">#50C0FF</Color>
113115
<SolidColorBrush x:Key="App.Theme.FillColorAttentionBrush" Color="{StaticResource App.Theme.FillColorAttention}" />
116+
<SolidColorBrush x:Key="App.Theme.CardBackgroundFillColorTertiaryBrush" Color="{StaticResource SystemColorWindowColor}" />
114117
</ResourceDictionary>
115118
</ResourceDictionary.ThemeDictionaries>
116119
</ResourceDictionary>

src/Files.App/Converters/EnumToHumanizedConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public object Convert(object value, Type targetType, object parameter, string la
1919
=> LocalizedEnumDescriptionFactory.Get(Enum.Parse<DetailsViewSizeKind>(stringValue)),
2020
"ListViewSizeKind"
2121
=> LocalizedEnumDescriptionFactory.Get(Enum.Parse<ListViewSizeKind>(stringValue)),
22-
"TilesViewSizeKind"
23-
=> LocalizedEnumDescriptionFactory.Get(Enum.Parse<TilesViewSizeKind>(stringValue)),
22+
"CardsViewSizeKind"
23+
=> LocalizedEnumDescriptionFactory.Get(Enum.Parse<CardsViewSizeKind>(stringValue)),
2424
"GridViewSizeKind"
2525
=> LocalizedEnumDescriptionFactory.Get(Enum.Parse<GridViewSizeKind>(stringValue)),
2626
"ColumnsViewSizeKind"

src/Files.App/Data/Commands/Manager/CommandCodes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public enum CommandCodes
133133
LayoutIncreaseSize,
134134
LayoutDetails,
135135
LayoutList,
136-
LayoutTiles,
136+
LayoutCards,
137137
LayoutGrid,
138138
LayoutColumns,
139139
LayoutAdaptive,

0 commit comments

Comments
 (0)