Skip to content

Commit 654fe56

Browse files
authored
Added the option to hide columns in the details layout (#2622)
1 parent 4a337ba commit 654fe56

File tree

2 files changed

+39
-22
lines changed

2 files changed

+39
-22
lines changed

Files/View Models/SettingsViewModel.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,24 @@ public bool ShowDrivesWidget
296296
set => Set(value);
297297
}
298298

299+
public bool ShowDateColumn
300+
{
301+
get => Get(true);
302+
set => Set(value);
303+
}
304+
305+
public bool ShowTypeColumn
306+
{
307+
get => Get(true);
308+
set => Set(value);
309+
}
310+
311+
public bool ShowSizeColumn
312+
{
313+
get => Get(true);
314+
set => Set(value);
315+
}
316+
299317
// Any distinguishable path here is fine
300318
// Currently is the command to open the folder from cmd ("cmd /c start Shell:RecycleBinFolder")
301319
public string RecycleBinPath { get; set; } = @"Shell:RecycleBinFolder";

Files/Views/LayoutModes/GenericFileBrowser.xaml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727

2828
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
2929
<converters:BoolToVisibilityConverter
30-
x:Key="BoolToVisibilityConverter"
31-
FalseValue="Collapsed"
32-
TrueValue="Visible" />
30+
x:Key="BoolToVisibilityConverter"
31+
FalseValue="Collapsed"
32+
TrueValue="Visible" />
3333

3434
<MenuFlyout
3535
x:Key="BaseLayoutContextFlyout"
@@ -703,22 +703,18 @@
703703
<Setter Property="ContextFlyout">
704704
<Setter.Value>
705705
<MenuFlyout x:Name="HeaderRightClickMenu">
706-
<MenuFlyoutItem
707-
x:Name="EditColumn"
708-
IsEnabled="False"
709-
Text="Edit Columns">
710-
<MenuFlyoutItem.Icon>
711-
<FontIcon Glyph="&#xE70F;" />
712-
</MenuFlyoutItem.Icon>
713-
</MenuFlyoutItem>
714-
<MenuFlyoutItem
715-
x:Name="FitColumns"
716-
IsEnabled="False"
717-
Text="Size All Columns to Fit">
718-
<MenuFlyoutItem.Icon>
719-
<FontIcon Glyph="&#xE9A6;" />
720-
</MenuFlyoutItem.Icon>
721-
</MenuFlyoutItem>
706+
<ToggleMenuFlyoutItem
707+
x:Uid="BaseLayoutContextFlyoutSortByDate"
708+
IsChecked="{x:Bind AppSettings.ShowDateColumn, Mode=TwoWay}"
709+
Text="Date" />
710+
<ToggleMenuFlyoutItem
711+
x:Uid="BaseLayoutContextFlyoutSortByType"
712+
IsChecked="{x:Bind AppSettings.ShowTypeColumn, Mode=TwoWay}"
713+
Text="Type" />
714+
<ToggleMenuFlyoutItem
715+
x:Uid="BaseLayoutContextFlyoutSortBySize"
716+
IsChecked="{x:Bind AppSettings.ShowSizeColumn, Mode=TwoWay}"
717+
Text="Size" />
722718
</MenuFlyout>
723719
</Setter.Value>
724720
</Setter>
@@ -870,7 +866,8 @@
870866
FontSize="12"
871867
Header="Date modified"
872868
IsReadOnly="True"
873-
Tag="Date">
869+
Tag="Date"
870+
Visibility="{x:Bind AppSettings.ShowDateColumn, Mode=OneWay}">
874871
<controls:DataGridTextColumn.CellStyle>
875872
<Style TargetType="controls:DataGridCell">
876873
<Setter Property="Opacity" Value="0.6" />
@@ -889,7 +886,8 @@
889886
FontSize="12"
890887
Header="Type"
891888
IsReadOnly="True"
892-
Tag="Type">
889+
Tag="Type"
890+
Visibility="{x:Bind AppSettings.ShowTypeColumn, Mode=OneWay}">
893891
<controls:DataGridTextColumn.CellStyle>
894892
<Style TargetType="controls:DataGridCell">
895893
<Setter Property="Opacity" Value="0.6" />
@@ -909,7 +907,8 @@
909907
FontSize="12"
910908
Header="Size"
911909
IsReadOnly="True"
912-
Tag="Size">
910+
Tag="Size"
911+
Visibility="{x:Bind AppSettings.ShowSizeColumn, Mode=OneWay}">
913912
<controls:DataGridTextColumn.CellStyle>
914913
<Style TargetType="controls:DataGridCell">
915914
<Setter Property="Opacity" Value="0.6" />

0 commit comments

Comments
 (0)