Skip to content

Commit 0bccda1

Browse files
authored
Feature: Added an option to hide the status bar (#17217)
1 parent 25c59f1 commit 0bccda1

File tree

7 files changed

+48
-2
lines changed

7 files changed

+48
-2
lines changed

src/Files.App/Data/Contracts/IAppearanceSettingsService.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ public interface IAppearanceSettingsService : IBaseSettingsService, INotifyPrope
102102
/// </summary>
103103
bool ShowToolbar { get; set; }
104104

105+
/// <summary>
106+
/// Gets or sets a value whether the status bar should be displayed.
107+
/// </summary>
108+
bool ShowStatusBar { get; set; }
109+
105110
/// <summary>
106111
/// Gets or sets a value whether the tab actions button should be displayed.
107112
/// </summary>

src/Files.App/Services/Settings/AppearanceSettingsService.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,13 @@ public bool ShowToolbar
138138
set => Set(value);
139139
}
140140

141+
/// <inheritdoc/>
142+
public bool ShowStatusBar
143+
{
144+
get => Get(true);
145+
set => Set(value);
146+
}
147+
141148
/// <inheritdoc/>
142149
public bool ShowTabActions
143150
{

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4332,4 +4332,7 @@
43324332
<data name="FailedToOpenLogFile" xml:space="preserve">
43334333
<value>Unable to open the log file</value>
43344334
</data>
4335-
</root>
4335+
<data name="ShowStatusBar" xml:space="preserve">
4336+
<value>Show status bar</value>
4337+
</data>
4338+
</root>

src/Files.App/Styles/PathIcons.xaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545

4646
<x:String x:Key="App.Theme.PathIcon.Hide">F1 M 0.625 0 C 0.794271 0 0.940755 0.06185 1.064453 0.185547 L 19.814453 18.935547 C 19.93815 19.059244 20 19.205729 20 19.375 C 20 19.544271 19.93815 19.690756 19.814453 19.814453 C 19.690754 19.93815 19.54427 20 19.375 20 C 19.205729 20 19.059244 19.93815 18.935547 19.814453 L 13.544922 14.433594 C 13.336588 14.720053 13.100586 14.975586 12.836914 15.200195 C 12.573242 15.424805 12.290039 15.615234 11.987305 15.771484 C 11.68457 15.927734 11.363932 16.046549 11.025391 16.12793 C 10.686849 16.209311 10.341797 16.25 9.990234 16.25 C 9.384766 16.25 8.816731 16.134441 8.286133 15.90332 C 7.755534 15.672201 7.293294 15.359701 6.899414 14.96582 C 6.505534 14.57194 6.193034 14.109701 5.961914 13.579102 C 5.730794 13.048503 5.615234 12.480469 5.615234 11.875 C 5.615234 11.165365 5.776367 10.499675 6.098633 9.87793 C 6.420898 9.256186 6.868489 8.736979 7.441406 8.320312 L 5.46875 6.347656 C 4.635417 6.888021 3.914388 7.548828 3.305664 8.330078 C 2.69694 9.111328 2.216797 9.967448 1.865234 10.898438 C 1.79362 11.08724 1.730143 11.276042 1.674805 11.464844 C 1.619466 11.653646 1.565755 11.842448 1.513672 12.03125 C 1.468099 12.174479 1.394857 12.291667 1.293945 12.382812 C 1.193034 12.473959 1.064453 12.519531 0.908203 12.519531 C 0.738932 12.519531 0.592448 12.457683 0.46875 12.333984 C 0.345052 12.210287 0.283203 12.063803 0.283203 11.894531 C 0.283203 11.861979 0.289714 11.813151 0.302734 11.748047 C 0.615234 10.472006 1.131185 9.290365 1.850586 8.203125 C 2.569987 7.115886 3.476562 6.197917 4.570312 5.449219 L 0.185547 1.064453 C 0.061849 0.940756 0 0.794271 0 0.625 C 0 0.45573 0.061849 0.309246 0.185547 0.185547 C 0.309245 0.06185 0.455729 0 0.625 0 Z M 7.119141 4.189453 C 8.043619 3.896484 9.00065 3.75 9.990234 3.75 C 11.18815 3.75 12.312825 3.953451 13.364258 4.360352 C 14.415689 4.767254 15.361327 5.328777 16.201172 6.044922 C 17.041016 6.761068 17.75716 7.604167 18.349609 8.574219 C 18.942057 9.544271 19.384766 10.595703 19.677734 11.728516 C 19.690754 11.79362 19.697266 11.845703 19.697266 11.884766 C 19.697266 12.054037 19.633789 12.198894 19.506836 12.319336 C 19.379883 12.439779 19.23177 12.5 19.0625 12.5 C 18.90625 12.5 18.780924 12.456055 18.686523 12.368164 C 18.592121 12.280273 18.518879 12.164714 18.466797 12.021484 C 18.434244 11.923828 18.404947 11.826172 18.378906 11.728516 L 18.330078 11.542969 C 18.304035 11.445312 18.274738 11.347656 18.242188 11.25 C 18.072916 10.748698 17.871094 10.266928 17.636719 9.804688 C 17.259113 9.088542 16.801758 8.434245 16.264648 7.841797 C 15.727539 7.24935 15.130208 6.743164 14.472656 6.323242 C 13.815104 5.90332 13.108724 5.5778 12.353516 5.34668 C 11.598307 5.115561 10.810547 5.000001 9.990234 5 C 9.677734 5.000001 9.366861 5.017904 9.057617 5.053711 C 8.748372 5.089519 8.440755 5.143229 8.134766 5.214844 Z M 10.449219 7.519531 C 10.963541 7.571615 11.445312 7.708334 11.894531 7.929688 C 12.343749 8.151042 12.740885 8.434245 13.085938 8.779297 C 13.430989 9.12435 13.714192 9.521484 13.935547 9.970703 C 14.1569 10.419922 14.293619 10.901693 14.345703 11.416016 Z M 8.339844 9.228516 C 7.877604 9.514975 7.516275 9.890951 7.255859 10.356445 C 6.995442 10.82194 6.865234 11.328125 6.865234 11.875 C 6.865234 12.304688 6.946614 12.709961 7.109375 13.09082 C 7.272135 13.47168 7.495117 13.803711 7.77832 14.086914 C 8.061523 14.370117 8.393555 14.5931 8.774414 14.755859 C 9.155273 14.91862 9.560547 15 9.990234 15 C 10.537109 15 11.043294 14.869792 11.508789 14.609375 C 11.974283 14.348959 12.353516 13.987631 12.646484 13.525391 Z</x:String>
4747

48+
<x:String x:Key="App.Theme.PathIcon.StatusBar">F1 M 4.306641 1.25 C 3.896484 1.25 3.505859 1.333008 3.134766 1.499023 C 2.763672 1.665039 2.439779 1.886393 2.163086 2.163086 C 1.886393 2.439779 1.665039 2.763672 1.499023 3.134766 C 1.333008 3.505859 1.25 3.896484 1.25 4.306641 L 1.25 15.693359 C 1.25 16.103516 1.333008 16.494141 1.499023 16.865234 C 1.665039 17.236328 1.886393 17.560221 2.163086 17.836914 C 2.439779 18.113605 2.763672 18.334961 3.134766 18.500977 C 3.505859 18.666992 3.896484 18.75 4.306641 18.75 L 15.693359 18.75 C 16.103516 18.75 16.494141 18.666992 16.865234 18.500977 C 17.236328 18.334961 17.560221 18.113605 17.836914 17.836914 C 18.113605 17.560221 18.334961 17.236328 18.500977 16.865234 C 18.666992 16.494141 18.75 16.103516 18.75 15.693359 L 18.75 4.306641 C 18.75 3.896484 18.666992 3.505859 18.500977 3.134766 C 18.334961 2.763672 18.113605 2.439779 17.836914 2.163086 C 17.560221 1.886393 17.236328 1.665039 16.865234 1.499023 C 16.494141 1.333008 16.103516 1.25 15.693359 1.25 Z M 2.5 15 L 17.5 15 L 17.5 15.625 C 17.5 15.878906 17.451172 16.119791 17.353516 16.347656 C 17.255859 16.57552 17.120768 16.775715 16.948242 16.948242 C 16.775715 17.120768 16.57552 17.255859 16.347656 17.353516 C 16.119791 17.451172 15.878906 17.5 15.625 17.5 L 4.375 17.5 C 4.121094 17.5 3.880208 17.451172 3.652344 17.353516 C 3.424479 17.255859 3.224284 17.120768 3.051758 16.948242 C 2.879232 16.775715 2.744141 16.57552 2.646484 16.347656 C 2.548828 16.119791 2.5 15.878906 2.5 15.625 Z M 15.625 2.5 C 15.878906 2.5 16.119791 2.548828 16.347656 2.646484 C 16.57552 2.744141 16.775715 2.879232 16.948242 3.051758 C 17.120768 3.224283 17.255859 3.424479 17.353516 3.652344 C 17.451172 3.880209 17.5 4.121094 17.5 4.375 L 17.5 13.75 L 2.5 13.75 L 2.5 4.375 C 2.5 4.121094 2.548828 3.880209 2.646484 3.652344 C 2.744141 3.424479 2.879232 3.224283 3.051758 3.051758 C 3.224284 2.879232 3.424479 2.744141 3.652344 2.646484 C 3.880208 2.548828 4.121094 2.5 4.375 2.5 Z</x:String>
49+
4850
</ResourceDictionary>
4951
</ResourceDictionary.MergedDictionaries>
50-
</ResourceDictionary>
52+
</ResourceDictionary>

src/Files.App/ViewModels/MainPageViewModel.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ context.PageType is not ContentPageTypes.ReleaseNotes &&
125125
context.PageType is not ContentPageTypes.Settings;
126126

127127
public bool ShowStatusBar =>
128+
AppearanceSettingsService.ShowStatusBar &&
128129
context.PageType is not ContentPageTypes.Home &&
129130
context.PageType is not ContentPageTypes.ReleaseNotes &&
130131
context.PageType is not ContentPageTypes.Settings;
@@ -193,6 +194,9 @@ public MainPageViewModel()
193194
case nameof(AppearanceSettingsService.ShowToolbar):
194195
OnPropertyChanged(nameof(ShowToolbar));
195196
break;
197+
case nameof(AppearanceSettingsService.ShowStatusBar):
198+
OnPropertyChanged(nameof(ShowStatusBar));
199+
break;
196200
}
197201
};
198202

src/Files.App/ViewModels/Settings/AppearanceViewModel.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,20 @@ public bool ShowToolbar
296296
}
297297
}
298298

299+
public bool ShowStatusBar
300+
{
301+
get => UserSettingsService.AppearanceSettingsService.ShowStatusBar;
302+
set
303+
{
304+
if (value != UserSettingsService.AppearanceSettingsService.ShowStatusBar)
305+
{
306+
UserSettingsService.AppearanceSettingsService.ShowStatusBar = value;
307+
308+
OnPropertyChanged();
309+
}
310+
}
311+
}
312+
299313
public bool ShowTabActions
300314
{
301315
get => UserSettingsService.AppearanceSettingsService.ShowTabActions;

src/Files.App/Views/Settings/AppearancePage.xaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,17 @@
272272
</wctcontrols:SettingsCard>
273273
</wctcontrols:SettingsExpander.Items>
274274
</wctcontrols:SettingsExpander>
275+
276+
<!-- Show Status Bar -->
277+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowStatusBar}">
278+
<wctcontrols:SettingsCard.HeaderIcon>
279+
<PathIcon Data="{StaticResource App.Theme.PathIcon.StatusBar}" />
280+
</wctcontrols:SettingsCard.HeaderIcon>
281+
<ToggleSwitch
282+
AutomationProperties.AutomationControlType="Custom"
283+
AutomationProperties.Name="{helpers:ResourceString Name=ShowStatusBar}"
284+
IsOn="{x:Bind ViewModel.ShowStatusBar, Mode=TwoWay}" />
285+
</wctcontrols:SettingsCard>
275286
</StackPanel>
276287
</Grid>
277288
</Page>

0 commit comments

Comments
 (0)