Skip to content

Feature: Moved menu items to left side of the settings dialog #11044

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/Files.App/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,6 @@
<SolidColorBrush x:Key="WindowCaptionBackground" Color="Transparent" />
<SolidColorBrush x:Key="WindowCaptionBackgroundDisabled" Color="Transparent" />

<!-- Removes NavigationView background -->
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="Transparent" />

<!-- Removes NavigationView corner radius -->
<CornerRadius x:Key="NavigationViewContentGridCornerRadius">0</CornerRadius>

<!-- Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/5441 -->
<x:Double x:Key="MediaTransportControlsMinWidth">50</x:Double>

Expand Down
65 changes: 38 additions & 27 deletions src/Files.App/Dialogs/SettingsDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,65 @@
mc:Ignorable="d">
<ContentDialog.Resources>
<ResourceDictionary>
<x:Double x:Key="ContentDialogMaxWidth">800</x:Double>
<x:Double x:Key="ContentDialogMaxWidth">1100</x:Double>
<Thickness x:Key="ContentDialogPadding">0</Thickness>
<Thickness x:Key="TopNavigationViewTopNavGridMargin">4</Thickness>
<SolidColorBrush x:Key="ContentDialogTopOverlay" Color="Transparent" />
<SolidColorBrush x:Key="NavigationViewContentGridBorderBrush" Color="Transparent" />
</ResourceDictionary>
</ContentDialog.Resources>

<Grid
x:Name="ContainerGrid"
MaxHeight="690"
MaxHeight="790"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{ThemeResource SolidBackgroundFillColorBase}">
<Grid.RowDefinitions>
<RowDefinition Height="44" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>

<Grid
Grid.Row="0"
Padding="8,0"
HorizontalAlignment="Stretch">
<TextBlock
Padding="8,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontWeight="SemiBold"
Text="{helpers:ResourceString Name=Settings}" />

<Button
x:Name="ButtonClose"
Width="36"
Height="36"
HorizontalAlignment="Right"
VerticalAlignment="Center"
AutomationProperties.Name="{helpers:ResourceString Name=Close}"
Background="Transparent"
BorderBrush="Transparent"
Click="ButtonClose_Click"
ToolTipService.ToolTip="{helpers:ResourceString Name=Close}">
<FontIcon FontSize="12" Glyph="&#xE8BB;" />
</Button>
</Grid>

<NavigationView
x:Name="SettingsPane"
Grid.Row="1"
IsBackButtonVisible="Collapsed"
IsBackEnabled="False"
IsPaneToggleButtonVisible="False"
IsSettingsVisible="False"
IsTitleBarAutoPaddingEnabled="False"
PaneDisplayMode="Top"
OpenPaneLength="260"
PaneDisplayMode="Left"
SelectionChanged="SettingsPane_SelectionChanged">

<NavigationView.MenuItems>
<NavigationViewItem
AccessKey="A"
AutomationProperties.AutomationId="SettingsItemAppearance"
Content="{helpers:ResourceString Name=Appearance}"
CornerRadius="4,0,0,4"
IsSelected="True"
Tag="0">
<NavigationViewItem.Icon>
Expand All @@ -51,7 +80,6 @@
AccessKey="P"
AutomationProperties.AutomationId="SettingsItemPreferences"
Content="{helpers:ResourceString Name=SettingsNavPreferences/Content}"
CornerRadius="0"
Tag="1">
<NavigationViewItem.Icon>
<FontIcon FontFamily="{StaticResource CustomGlyph}" Glyph="&#xF116;" />
Expand All @@ -61,7 +89,6 @@
AccessKey="F"
AutomationProperties.AutomationId="SettingsItemFolders"
Content="{helpers:ResourceString Name=Folders}"
CornerRadius="0"
Tag="2">
<NavigationViewItem.Icon>
<FontIcon Glyph="&#xE8B7;" />
Expand All @@ -81,7 +108,6 @@
AccessKey="B"
AutomationProperties.AutomationId="SettingsItemAbout"
Content="{helpers:ResourceString Name=About}"
CornerRadius="0,4,4,0"
Tag="4">
<NavigationViewItem.Icon>
<FontIcon FontSize="16" Glyph="&#xE946;" />
Expand All @@ -94,23 +120,8 @@
VerticalAlignment="Stretch"
VerticalScrollBarVisibility="Visible"
VerticalScrollMode="Enabled">
<Frame x:Name="SettingsContentFrame" Padding="12,0,12,12" />
<Frame x:Name="SettingsContentFrame" Padding="12" />
</ScrollViewer>
</NavigationView>

<Button
x:Name="ButtonClose"
Width="36"
Height="36"
Margin="8,12,12,8"
HorizontalAlignment="Right"
VerticalAlignment="Top"
AutomationProperties.Name="{helpers:ResourceString Name=Close}"
Background="Transparent"
BorderBrush="Transparent"
Click="ButtonClose_Click"
ToolTipService.ToolTip="{helpers:ResourceString Name=Close}">
<FontIcon FontSize="12" Glyph="&#xE8BB;" />
</Button>
</Grid>
</ContentDialog>
</ContentDialog>
3 changes: 2 additions & 1 deletion src/Files.App/Dialogs/SettingsDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ private void Current_SizeChanged(object sender, WindowSizeChangedEventArgs e)
private void UpdateDialogLayout()
{
ContainerGrid.Height = App.Window.Bounds.Height <= 760 ? App.Window.Bounds.Height - 70 : 690;
ContainerGrid.Width = App.Window.Bounds.Width <= 800 ? App.Window.Bounds.Width : 800;
ContainerGrid.Width = App.Window.Bounds.Width <= 1100 ? App.Window.Bounds.Width : 1100;
SettingsPane.PaneDisplayMode = App.Window.Bounds.Width < 700 ? NavigationViewPaneDisplayMode.LeftCompact : NavigationViewPaneDisplayMode.Left;
}

private void SettingsPane_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
Expand Down
3 changes: 3 additions & 0 deletions src/Files.App/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -2877,4 +2877,7 @@
<data name="ReleaseNotes" xml:space="preserve">
<value>Release Notes</value>
</data>
<data name="Settings" xml:space="preserve">
<value>Settings</value>
</data>
</root>
9 changes: 9 additions & 0 deletions src/Files.App/UserControls/SidebarControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@
</FlyoutBase.AttachedFlyout>
<NavigationView.Resources>
<ResourceDictionary>
<!-- Removes NavigationView background -->
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="Transparent" />

<!-- Removes NavigationView corner radius -->
<CornerRadius x:Key="NavigationViewContentGridCornerRadius">0</CornerRadius>

<!-- Removes NavigationView border from top, right and bottom -->
<Thickness x:Key="NavigationViewContentGridBorderThickness">1,0,0,0</Thickness>

<mconv:BoolNegationConverter x:Key="BoolNegationConverter" />
<mconv:StringFormatConverter x:Key="StringFormatConverter" />
<vc:ColorModelToColorConverter x:Key="ColorModelToColorConverter" />
Expand Down
3 changes: 0 additions & 3 deletions src/Files.App/Views/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
<x:Boolean x:Key="False">False</x:Boolean>

<converters:BoolNegationConverter x:Key="BoolNegationConverter" />

<SolidColorBrush x:Key="NavigationViewContentGridBorderBrush" Color="{ThemeResource ControlStrokeColorDefault}" />
<Thickness x:Key="NavigationViewContentGridBorderThickness">1,0,0,0</Thickness>
</ResourceDictionary>
</Page.Resources>

Expand Down
6 changes: 6 additions & 0 deletions src/Files.App/Views/Pages/Properties.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
<Thickness x:Key="NavigationViewTopPaneHeight">40</Thickness>
<Thickness x:Key="TopNavigationViewTopNavGridMargin">0</Thickness>
<SolidColorBrush x:Key="NavigationViewContentGridBorderBrush" Color="Transparent" />

<!-- Removes NavigationView background -->
<SolidColorBrush x:Key="NavigationViewContentBackground" Color="Transparent" />

<!-- Removes NavigationView corner radius -->
<CornerRadius x:Key="NavigationViewContentGridCornerRadius">0</CornerRadius>
</ResourceDictionary>
</Grid.Resources>
<Grid.RowDefinitions>
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Views/SettingsPages/About.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<!-- Version -->
<TextBlock
Padding="0,12,0,4"
Padding="0,0,0,4"
FontSize="14"
FontWeight="Medium"
Text="{helpers:ResourceString Name=Version}" />
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Views/SettingsPages/Advanced.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<!-- Manage Settings -->
<TextBlock
Padding="0,12,0,4"
Padding="0,0,0,4"
FontSize="14"
FontWeight="Medium"
Text="{helpers:ResourceString Name=ManageSettings}" />
Expand Down
4 changes: 1 addition & 3 deletions src/Files.App/Views/SettingsPages/Appearance.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
xmlns:converters1="using:Files.App.ValueConverters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:helpers="using:Files.App.Helpers"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:icore="using:Microsoft.Xaml.Interactions.Core"
xmlns:local="using:Files.App.UserControls.Settings"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:settingsviewmodels="using:Files.App.ViewModels.SettingsViewModels"
Expand Down Expand Up @@ -101,7 +99,7 @@

<!-- Personalization -->
<TextBlock
Padding="0,12,0,4"
Padding="0,0,0,4"
FontSize="14"
FontWeight="Medium"
Text="{helpers:ResourceString Name=Personalization}" />
Expand Down
2 changes: 1 addition & 1 deletion src/Files.App/Views/SettingsPages/Folders.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<!-- Layout And Sorting -->
<TextBlock
Padding="0,12,0,4"
Padding="0,0,0,4"
FontSize="14"
FontWeight="Medium"
Text="{helpers:ResourceString Name=LayoutAndSorting}" />
Expand Down