Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
5 changes: 5 additions & 0 deletions src/Files.App/Data/Contracts/IAppearanceSettingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,5 +96,10 @@ public interface IAppearanceSettingsService : IBaseSettingsService, INotifyPrope
/// Gets or sets a value for the app background image Horizontal Alignment.
/// </summary>
HorizontalAlignment AppThemeBackgroundImageHorizontalAlignment { get; set; }

/// <summary>
/// Gets or sets a value whether the toolbar should be displayed.
/// </summary>
bool ShowToolbar { get; set; }
}
}
7 changes: 7 additions & 0 deletions src/Files.App/Services/Settings/AppearanceSettingsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ public HorizontalAlignment AppThemeBackgroundImageHorizontalAlignment
set => Set(value);
}

/// <inheritdoc/>
public bool ShowToolbar
{
get => Get(true);
set => Set(value);
}

protected override void RaiseOnSettingChangedEvent(object sender, SettingChangedEventArgs e)
{
base.RaiseOnSettingChangedEvent(sender, e);
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 @@ -3859,4 +3859,7 @@
<data name="StatusWithColon" xml:space="preserve">
<value>Status:</value>
</data>
<data name="ShowToolbar" xml:space="preserve">
<value>Show toolbar</value>
</data>
</root>
2 changes: 2 additions & 0 deletions src/Files.App/Styles/PathIcons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@

<x:String x:Key="App.Theme.PathIcon.ActionDelete">M9.29895 5.75C8.7216 4.75 7.27823 4.75 6.70088 5.75L6.24929 6.53218C6.10532 6.78152 6.20117 7.10063 6.45869 7.22939C6.69528 7.34768 6.98306 7.26125 7.11531 7.03218L7.5669 6.25C7.75935 5.91667 8.24048 5.91667 8.43293 6.25L8.88452 7.03218C9.01677 7.26125 9.30455 7.34768 9.54113 7.22939C9.79866 7.10063 9.8945 6.78152 9.75054 6.53218L9.29895 5.75ZM10.165 9.25L10.0574 9.06375C9.91348 8.8144 10.0093 8.4953 10.2668 8.36653C10.5034 8.24824 10.7912 8.33468 10.9235 8.56375L11.031 8.75C11.6084 9.75 10.8867 11 9.73196 11H8.99991C8.72377 11 8.49991 10.7761 8.49991 10.5C8.49991 10.2239 8.72377 10 8.99991 10H9.73196C10.1169 10 10.3574 9.58333 10.165 9.25ZM6.99991 10C7.27606 10 7.49991 10.2239 7.49991 10.5C7.49991 10.7761 7.27606 11 6.99991 11H6.26786C5.11316 11 4.39147 9.75 4.96882 8.75L5.07636 8.56375C5.20861 8.33468 5.4964 8.24824 5.73298 8.36653C5.9905 8.4953 6.08635 8.8144 5.94238 9.06375L5.83485 9.25C5.6424 9.58333 5.88296 10 6.26786 10H6.99991ZM13.9142 0.585786C14.2893 0.960859 14.5 1.46957 14.5 2V2.56L13.17 14.23C13.1133 14.7196 12.8778 15.1711 12.5087 15.4978C12.1396 15.8244 11.6629 16.0033 11.17 16H4.85C4.35711 16.0033 3.88037 15.8244 3.51127 15.4978C3.14216 15.1711 2.90667 14.7196 2.85 14.23L1.5 2.56V2C1.5 1.46957 1.71071 0.960859 2.08579 0.585786C2.46086 0.210714 2.96957 0 3.5 0H12.5C13.0304 0 13.5391 0.210714 13.9142 0.585786ZM12.5 1H3.5C3.23478 1 2.98043 1.10536 2.79289 1.29289C2.60536 1.48043 2.5 1.73478 2.5 2H13.5C13.5 1.73478 13.3946 1.48043 13.2071 1.29289C13.0196 1.10536 12.7652 1 12.5 1ZM11.8309 14.747C12.0156 14.5827 12.1328 14.3557 12.16 14.11L13.44 3H2.56L3.84 14.11C3.86719 14.3557 3.98443 14.5827 4.16911 14.747C4.35378 14.9114 4.59279 15.0015 4.84 15H11.16C11.4072 15.0015 11.6462 14.9114 11.8309 14.747Z</x:String>

<x:String x:Key="App.Theme.PathIcon.WebAsset">M 4.9219 18.75 C 4.4336 18.75 3.9665 18.6507 3.5205 18.4521 C 3.0745 18.2536 2.6839 17.9867 2.3486 17.6514 C 2.0133 17.3161 1.7464 16.9255 1.5479 16.4795 C 1.3493 16.0335 1.25 15.5664 1.25 15.0781 L 1.25 4.9219 C 1.25 4.4336 1.3493 3.9665 1.5479 3.5205 C 1.7464 3.0745 2.0133 2.6839 2.3486 2.3486 C 2.6839 2.0133 3.0745 1.7464 3.5205 1.5479 C 3.9665 1.3493 4.4336 1.25 4.9219 1.25 L 15.0781 1.25 C 15.5664 1.25 16.0335 1.3493 16.4795 1.5479 C 16.9255 1.7464 17.3161 2.0133 17.6514 2.3486 C 17.9867 2.6839 18.2536 3.0745 18.4521 3.5205 C 18.6507 3.9665 18.75 4.4336 18.75 4.9219 L 18.75 15.0781 C 18.75 15.5664 18.6507 16.0335 18.4521 16.4795 C 18.2536 16.9255 17.9867 17.3161 17.6514 17.6514 C 17.3161 17.9867 16.9255 18.2536 16.4795 18.4521 C 16.0335 18.6507 15.5664 18.75 15.0781 18.75 Z M 15.0488 17.5 C 15.3743 17.5 15.6852 17.4333 15.9814 17.2998 C 16.2777 17.1663 16.5381 16.9873 16.7627 16.7627 C 16.9873 16.5381 17.1663 16.2777 17.2998 15.9814 C 17.4333 15.6852 17.5 15.3743 17.5 15.0488 L 17.5 4.9512 C 17.5 4.6257 17.4333 4.3148 17.2998 4.0186 C 17.1663 3.7223 16.9873 3.4619 16.7627 3.2373 C 16.5381 3.0127 16.2777 2.8337 15.9814 2.7002 C 15.6852 2.5667 15.3743 2.5 15.0488 2.5 L 4.9512 2.5 C 4.6257 2.5 4.3148 2.5667 4.0186 2.7002 C 3.7223 2.8337 3.4619 3.0127 3.2373 3.2373 C 3.0127 3.4619 2.8337 3.7223 2.7002 4.0186 C 2.5667 4.3148 2.5 4.6257 2.5 4.9512 L 2.5 15.0488 C 2.5 15.3743 2.5667 15.6852 2.7002 15.9814 C 2.8337 16.2777 3.0127 16.5381 3.2373 16.7627 C 3.4619 16.9873 3.7223 17.1663 4.0186 17.2998 C 4.3148 17.4333 4.6257 17.5 4.9512 17.5 Z M 5.625 6.25 C 5.4557 6.25 5.3092 6.1882 5.1855 6.0645 C 5.0618 5.9408 5 5.7943 5 5.625 C 5 5.4557 5.0618 5.3092 5.1855 5.1855 C 5.3092 5.0618 5.4557 5 5.625 5 L 14.375 5 C 14.5443 5 14.6908 5.0618 14.8145 5.1855 C 14.9382 5.3092 15 5.4557 15 5.625 C 15 5.7943 14.9382 5.9408 14.8145 6.0645 C 14.6908 6.1882 14.5443 6.25 14.375 6.25 Z Z Z</x:String>

<Style x:Key="ColorIconStatusCenter" TargetType="local:OpacityIcon">
<Setter Property="Template">
<Setter.Value>
Expand Down
6 changes: 6 additions & 0 deletions src/Files.App/ViewModels/MainPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public VerticalAlignment AppThemeBackgroundImageVerticalAlignment
public HorizontalAlignment AppThemeBackgroundImageHorizontalAlignment
=> AppearanceSettingsService.AppThemeBackgroundImageHorizontalAlignment;

public bool ShowToolbar
=> AppearanceSettingsService.ShowToolbar;


// Commands

Expand Down Expand Up @@ -108,6 +111,9 @@ public MainPageViewModel()
case nameof(AppearanceSettingsService.AppThemeBackgroundImageHorizontalAlignment):
OnPropertyChanged(nameof(AppThemeBackgroundImageHorizontalAlignment));
break;
case nameof(AppearanceSettingsService.ShowToolbar):
OnPropertyChanged(nameof(ShowToolbar));
break;
}
};
}
Expand Down
14 changes: 14 additions & 0 deletions src/Files.App/ViewModels/Settings/AppearanceViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -276,5 +276,19 @@ public string SelectedImageHorizontalAlignmentType
}
}
}

public bool ShowToolbar
{
get => UserSettingsService.AppearanceSettingsService.ShowToolbar;
set
{
if (value != UserSettingsService.AppearanceSettingsService.ShowToolbar)
{
UserSettingsService.AppearanceSettingsService.ShowToolbar = value;

OnPropertyChanged();
}
}
}
}
}
3 changes: 2 additions & 1 deletion src/Files.App/Views/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@
Loaded="NavToolbar_Loaded"
ShowPreviewPaneButton="{x:Bind ViewModel.ShouldPreviewPaneBeDisplayed, Mode=OneWay}"
ShowViewControlButton="{x:Bind ViewModel.ShouldViewControlBeDisplayed, Mode=OneWay}"
TabIndex="2" />
TabIndex="2"
Visibility="{x:Bind ViewModel.ShowToolbar, Mode=OneWay}" />

<!-- Page Content -->
<ContentPresenter
Expand Down
11 changes: 11 additions & 0 deletions src/Files.App/Views/Settings/AppearancePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,17 @@
</StackPanel>
</local:SettingsBlockControl.ExpandableContent>
</local:SettingsBlockControl>

<!-- Show toolbar -->
<local:SettingsBlockControl Title="{helpers:ResourceString Name=ShowToolbar}" HorizontalAlignment="Stretch">
<local:SettingsBlockControl.Icon>
<PathIcon Data="{StaticResource App.Theme.PathIcon.WebAsset}" />
</local:SettingsBlockControl.Icon>
<ToggleSwitch
AutomationProperties.Name="{helpers:ResourceString Name=ShowToolbar}"
IsOn="{x:Bind ViewModel.ShowToolbar, Mode=TwoWay}"
Style="{StaticResource RightAlignedToggleSwitchStyle}" />
</local:SettingsBlockControl>
</StackPanel>
</Grid>
</Page>