Skip to content

Commit 985d66e

Browse files
authored
Feature: Moved menu items to the left side of the settings dialog (#11044)
1 parent fa54540 commit 985d66e

File tree

11 files changed

+62
-43
lines changed

11 files changed

+62
-43
lines changed

src/Files.App/App.xaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@
1919
<SolidColorBrush x:Key="WindowCaptionBackground" Color="Transparent" />
2020
<SolidColorBrush x:Key="WindowCaptionBackgroundDisabled" Color="Transparent" />
2121

22-
<!-- Removes NavigationView background -->
23-
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="Transparent" />
24-
25-
<!-- Removes NavigationView corner radius -->
26-
<CornerRadius x:Key="NavigationViewContentGridCornerRadius">0</CornerRadius>
27-
2822
<!-- Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/5441 -->
2923
<x:Double x:Key="MediaTransportControlsMinWidth">50</x:Double>
3024

src/Files.App/Dialogs/SettingsDialog.xaml

Lines changed: 38 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,36 +11,65 @@
1111
mc:Ignorable="d">
1212
<ContentDialog.Resources>
1313
<ResourceDictionary>
14-
<x:Double x:Key="ContentDialogMaxWidth">800</x:Double>
14+
<x:Double x:Key="ContentDialogMaxWidth">1100</x:Double>
1515
<Thickness x:Key="ContentDialogPadding">0</Thickness>
16-
<Thickness x:Key="TopNavigationViewTopNavGridMargin">4</Thickness>
17-
<SolidColorBrush x:Key="ContentDialogTopOverlay" Color="Transparent" />
18-
<SolidColorBrush x:Key="NavigationViewContentGridBorderBrush" Color="Transparent" />
1916
</ResourceDictionary>
2017
</ContentDialog.Resources>
2118

2219
<Grid
2320
x:Name="ContainerGrid"
24-
MaxHeight="690"
21+
MaxHeight="790"
2522
HorizontalAlignment="Stretch"
2623
VerticalAlignment="Stretch"
2724
Background="{ThemeResource SolidBackgroundFillColorBase}">
25+
<Grid.RowDefinitions>
26+
<RowDefinition Height="44" />
27+
<RowDefinition Height="*" />
28+
</Grid.RowDefinitions>
29+
30+
<Grid
31+
Grid.Row="0"
32+
Padding="8,0"
33+
HorizontalAlignment="Stretch">
34+
<TextBlock
35+
Padding="8,0,0,0"
36+
HorizontalAlignment="Left"
37+
VerticalAlignment="Center"
38+
FontWeight="SemiBold"
39+
Text="{helpers:ResourceString Name=Settings}" />
40+
41+
<Button
42+
x:Name="ButtonClose"
43+
Width="36"
44+
Height="36"
45+
HorizontalAlignment="Right"
46+
VerticalAlignment="Center"
47+
AutomationProperties.Name="{helpers:ResourceString Name=Close}"
48+
Background="Transparent"
49+
BorderBrush="Transparent"
50+
Click="ButtonClose_Click"
51+
ToolTipService.ToolTip="{helpers:ResourceString Name=Close}">
52+
<FontIcon FontSize="12" Glyph="&#xE8BB;" />
53+
</Button>
54+
</Grid>
55+
2856
<NavigationView
2957
x:Name="SettingsPane"
58+
Grid.Row="1"
3059
IsBackButtonVisible="Collapsed"
3160
IsBackEnabled="False"
3261
IsPaneToggleButtonVisible="False"
3362
IsSettingsVisible="False"
3463
IsTitleBarAutoPaddingEnabled="False"
35-
PaneDisplayMode="Top"
64+
OpenPaneLength="260"
65+
PaneDisplayMode="Left"
3666
SelectionChanged="SettingsPane_SelectionChanged">
3767

3868
<NavigationView.MenuItems>
3969
<NavigationViewItem
4070
AccessKey="A"
4171
AutomationProperties.AutomationId="SettingsItemAppearance"
4272
Content="{helpers:ResourceString Name=Appearance}"
43-
CornerRadius="4,0,0,4"
4473
IsSelected="True"
4574
Tag="0">
4675
<NavigationViewItem.Icon>
@@ -51,7 +80,6 @@
5180
AccessKey="P"
5281
AutomationProperties.AutomationId="SettingsItemPreferences"
5382
Content="{helpers:ResourceString Name=SettingsNavPreferences/Content}"
54-
CornerRadius="0"
5583
Tag="1">
5684
<NavigationViewItem.Icon>
5785
<FontIcon FontFamily="{StaticResource CustomGlyph}" Glyph="&#xF116;" />
@@ -61,7 +89,6 @@
6189
AccessKey="F"
6290
AutomationProperties.AutomationId="SettingsItemFolders"
6391
Content="{helpers:ResourceString Name=Folders}"
64-
CornerRadius="0"
6592
Tag="2">
6693
<NavigationViewItem.Icon>
6794
<FontIcon Glyph="&#xE8B7;" />
@@ -81,7 +108,6 @@
81108
AccessKey="B"
82109
AutomationProperties.AutomationId="SettingsItemAbout"
83110
Content="{helpers:ResourceString Name=About}"
84-
CornerRadius="0,4,4,0"
85111
Tag="4">
86112
<NavigationViewItem.Icon>
87113
<FontIcon FontSize="16" Glyph="&#xE946;" />
@@ -94,23 +120,8 @@
94120
VerticalAlignment="Stretch"
95121
VerticalScrollBarVisibility="Visible"
96122
VerticalScrollMode="Enabled">
97-
<Frame x:Name="SettingsContentFrame" Padding="12,0,12,12" />
123+
<Frame x:Name="SettingsContentFrame" Padding="12" />
98124
</ScrollViewer>
99125
</NavigationView>
100-
101-
<Button
102-
x:Name="ButtonClose"
103-
Width="36"
104-
Height="36"
105-
Margin="8,12,12,8"
106-
HorizontalAlignment="Right"
107-
VerticalAlignment="Top"
108-
AutomationProperties.Name="{helpers:ResourceString Name=Close}"
109-
Background="Transparent"
110-
BorderBrush="Transparent"
111-
Click="ButtonClose_Click"
112-
ToolTipService.ToolTip="{helpers:ResourceString Name=Close}">
113-
<FontIcon FontSize="12" Glyph="&#xE8BB;" />
114-
</Button>
115126
</Grid>
116-
</ContentDialog>
127+
</ContentDialog>

src/Files.App/Dialogs/SettingsDialog.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ private void Current_SizeChanged(object sender, WindowSizeChangedEventArgs e)
3737
private void UpdateDialogLayout()
3838
{
3939
ContainerGrid.Height = App.Window.Bounds.Height <= 760 ? App.Window.Bounds.Height - 70 : 690;
40-
ContainerGrid.Width = App.Window.Bounds.Width <= 800 ? App.Window.Bounds.Width : 800;
40+
ContainerGrid.Width = App.Window.Bounds.Width <= 1100 ? App.Window.Bounds.Width : 1100;
41+
SettingsPane.PaneDisplayMode = App.Window.Bounds.Width < 700 ? NavigationViewPaneDisplayMode.LeftCompact : NavigationViewPaneDisplayMode.Left;
4142
}
4243

4344
private void SettingsPane_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)

src/Files.App/Strings/en-US/Resources.resw

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,4 +2877,7 @@
28772877
<data name="ReleaseNotes" xml:space="preserve">
28782878
<value>Release Notes</value>
28792879
</data>
2880+
<data name="Settings" xml:space="preserve">
2881+
<value>Settings</value>
2882+
</data>
28802883
</root>

src/Files.App/UserControls/SidebarControl.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@
4040
</FlyoutBase.AttachedFlyout>
4141
<NavigationView.Resources>
4242
<ResourceDictionary>
43+
<!-- Removes NavigationView background -->
44+
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="Transparent" />
45+
46+
<!-- Removes NavigationView corner radius -->
47+
<CornerRadius x:Key="NavigationViewContentGridCornerRadius">0</CornerRadius>
48+
49+
<!-- Removes NavigationView border from top, right and bottom -->
50+
<Thickness x:Key="NavigationViewContentGridBorderThickness">1,0,0,0</Thickness>
51+
4352
<mconv:BoolNegationConverter x:Key="BoolNegationConverter" />
4453
<mconv:StringFormatConverter x:Key="StringFormatConverter" />
4554
<vc:ColorModelToColorConverter x:Key="ColorModelToColorConverter" />

src/Files.App/Views/MainPage.xaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
<x:Boolean x:Key="False">False</x:Boolean>
3535

3636
<converters:BoolNegationConverter x:Key="BoolNegationConverter" />
37-
38-
<SolidColorBrush x:Key="NavigationViewContentGridBorderBrush" Color="{ThemeResource ControlStrokeColorDefault}" />
39-
<Thickness x:Key="NavigationViewContentGridBorderThickness">1,0,0,0</Thickness>
4037
</ResourceDictionary>
4138
</Page.Resources>
4239

src/Files.App/Views/Pages/Properties.xaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
<Thickness x:Key="NavigationViewTopPaneHeight">40</Thickness>
2020
<Thickness x:Key="TopNavigationViewTopNavGridMargin">0</Thickness>
2121
<SolidColorBrush x:Key="NavigationViewContentGridBorderBrush" Color="Transparent" />
22+
23+
<!-- Removes NavigationView background -->
24+
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="Transparent" />
25+
26+
<!-- Removes NavigationView corner radius -->
27+
<CornerRadius x:Key="NavigationViewContentGridCornerRadius">0</CornerRadius>
2228
</ResourceDictionary>
2329
</Grid.Resources>
2430
<Grid.RowDefinitions>

src/Files.App/Views/SettingsPages/About.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<!-- Version -->
2626
<TextBlock
27-
Padding="0,12,0,4"
27+
Padding="0,0,0,4"
2828
FontSize="14"
2929
FontWeight="Medium"
3030
Text="{helpers:ResourceString Name=Version}" />

src/Files.App/Views/SettingsPages/Advanced.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
<!-- Manage Settings -->
3232
<TextBlock
33-
Padding="0,12,0,4"
33+
Padding="0,0,0,4"
3434
FontSize="14"
3535
FontWeight="Medium"
3636
Text="{helpers:ResourceString Name=ManageSettings}" />

src/Files.App/Views/SettingsPages/Appearance.xaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
xmlns:converters1="using:Files.App.ValueConverters"
99
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
1010
xmlns:helpers="using:Files.App.Helpers"
11-
xmlns:i="using:Microsoft.Xaml.Interactivity"
12-
xmlns:icore="using:Microsoft.Xaml.Interactions.Core"
1311
xmlns:local="using:Files.App.UserControls.Settings"
1412
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
1513
xmlns:settingsviewmodels="using:Files.App.ViewModels.SettingsViewModels"
@@ -101,7 +99,7 @@
10199

102100
<!-- Personalization -->
103101
<TextBlock
104-
Padding="0,12,0,4"
102+
Padding="0,0,0,4"
105103
FontSize="14"
106104
FontWeight="Medium"
107105
Text="{helpers:ResourceString Name=Personalization}" />

src/Files.App/Views/SettingsPages/Folders.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
<!-- Layout And Sorting -->
3737
<TextBlock
38-
Padding="0,12,0,4"
38+
Padding="0,0,0,4"
3939
FontSize="14"
4040
FontWeight="Medium"
4141
Text="{helpers:ResourceString Name=LayoutAndSorting}" />

0 commit comments

Comments
 (0)