Skip to content

Commit ef8303b

Browse files
xwnbyaira2
authored andcommitted
Feature: Option to hide the bottom status bar
1 parent 25c59f1 commit ef8303b

File tree

6 files changed

+46
-1
lines changed

6 files changed

+46
-1
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 at the bottom</value>
4337+
</data>
4338+
</root>

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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,18 @@
243243
IsOn="{x:Bind ViewModel.ShowTabActions, Mode=TwoWay}" />
244244
</wctcontrols:SettingsCard>
245245

246+
<!-- Show Status bar -->
247+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=ShowStatusBar}">
248+
<wctcontrols:SettingsCard.HeaderIcon>
249+
<!-- TODO: needs a new icon -->
250+
<PathIcon Data="{StaticResource App.Theme.PathIcon.TabActions}" />
251+
</wctcontrols:SettingsCard.HeaderIcon>
252+
<ToggleSwitch
253+
AutomationProperties.AutomationControlType="Custom"
254+
AutomationProperties.Name="{helpers:ResourceString Name=ShowStatusBar}"
255+
IsOn="{x:Bind ViewModel.ShowStatusBar, Mode=TwoWay}" />
256+
</wctcontrols:SettingsCard>
257+
246258
<!-- Toolbar -->
247259
<wctcontrols:SettingsExpander Header="{helpers:ResourceString Name=Toolbars}">
248260
<wctcontrols:SettingsExpander.HeaderIcon>

0 commit comments

Comments
 (0)