Skip to content

Commit 089c9c3

Browse files
committed
Feature: Enabled Omnibar
1 parent 20e6c6c commit 089c9c3

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

src/Files.App/Actions/Global/EditPathAction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public Task ExecuteAsync(object? parameter = null)
3232
{
3333
if (context.ShellPage is not null)
3434
{
35-
if (GeneralSettingsService.EnableOmnibar)
35+
if (GeneralSettingsService.EnableOmnibarDesign)
3636
context.ShellPage!.ToolbarViewModel.SwitchToPathMode();
3737
else
3838
context.ShellPage.ToolbarViewModel.IsEditModeEnabled = true;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,6 @@ public interface IGeneralSettingsService : IBaseSettingsService, INotifyProperty
308308
/// <summary>
309309
/// Gets or sets a value indicating whether or not to enable the Omnibar.
310310
/// </summary>
311-
bool EnableOmnibar { get; set; }
311+
bool EnableOmnibarDesign { get; set; }
312312
}
313313
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,9 @@ public bool ShowFilterHeader
375375
set => Set(value);
376376
}
377377

378-
public bool EnableOmnibar
378+
public bool EnableOmnibarDesign
379379
{
380-
get => Get(false);
380+
get => Get(true);
381381
set => Set(value);
382382
}
383383

src/Files.App/UserControls/NavigationToolbar.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
<Grid
226226
x:Name="LegacyBreadcrumb"
227227
Grid.Column="1"
228-
x:Load="{x:Bind ViewModel.EnableOmnibar, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
228+
x:Load="{x:Bind ViewModel.EnableOmnibarDesign, Mode=OneWay, Converter={StaticResource BoolNegationConverter}}"
229229
ColumnSpacing="4">
230230
<Grid.ColumnDefinitions>
231231
<ColumnDefinition Width="*" />
@@ -340,7 +340,7 @@
340340
<controls:Omnibar
341341
x:Name="Omnibar"
342342
Grid.Column="1"
343-
x:Load="{x:Bind ViewModel.EnableOmnibar, Mode=OneWay}"
343+
x:Load="{x:Bind ViewModel.EnableOmnibarDesign, Mode=OneWay}"
344344
CurrentSelectedModeName="{x:Bind ViewModel.OmnibarCurrentSelectedModeName, Mode=TwoWay}"
345345
IsFocusedChanged="Omnibar_IsFocusedChanged"
346346
ModeChanged="Omnibar_ModeChanged"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,15 +357,15 @@ public bool ShowFlattenOptions
357357
}
358358

359359
// TODO remove when feature is marked as stable
360-
public bool EnableOmnibar
360+
public bool EnableOmnibarDesign
361361
{
362-
get => UserSettingsService.GeneralSettingsService.EnableOmnibar;
362+
get => UserSettingsService.GeneralSettingsService.EnableOmnibarDesign;
363363
set
364364
{
365-
if (value == UserSettingsService.GeneralSettingsService.EnableOmnibar)
365+
if (value == UserSettingsService.GeneralSettingsService.EnableOmnibarDesign)
366366
return;
367367

368-
UserSettingsService.GeneralSettingsService.EnableOmnibar = value;
368+
UserSettingsService.GeneralSettingsService.EnableOmnibarDesign = value;
369369
OnPropertyChanged();
370370
}
371371
}

src/Files.App/ViewModels/UserControls/NavigationToolbarViewModel.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public sealed partial class NavigationToolbarViewModel : ObservableObject, IAddr
8585
[Obsolete("Superseded by Omnibar.")]
8686
public bool SearchHasFocus { get; private set; }
8787

88-
public bool EnableOmnibar => GeneralSettingsService.EnableOmnibar;
88+
public bool EnableOmnibarDesign => GeneralSettingsService.EnableOmnibarDesign;
8989
public bool ShowStatusCenterButton =>
9090
AppearanceSettingsService.StatusCenterVisibility == StatusCenterVisibility.Always ||
9191
(AppearanceSettingsService.StatusCenterVisibility == StatusCenterVisibility.DuringOngoingFileOperations && OngoingTasksViewModel.HasAnyItem);
@@ -363,8 +363,8 @@ public NavigationToolbarViewModel()
363363
{
364364
switch (e.PropertyName)
365365
{
366-
case nameof(GeneralSettingsService.EnableOmnibar):
367-
OnPropertyChanged(nameof(EnableOmnibar));
366+
case nameof(GeneralSettingsService.EnableOmnibarDesign):
367+
OnPropertyChanged(nameof(EnableOmnibarDesign));
368368
break;
369369
}
370370
};
@@ -755,7 +755,7 @@ public void PathBoxItem_PreviewKeyDown(object sender, KeyRoutedEventArgs e)
755755

756756
public void SwitchToCommandPaletteMode()
757757
{
758-
if (EnableOmnibar)
758+
if (EnableOmnibarDesign)
759759
{
760760
OmnibarCurrentSelectedModeName = OmnibarPaletteModeName;
761761
}
@@ -773,7 +773,7 @@ public void SwitchToCommandPaletteMode()
773773

774774
public void SwitchToSearchMode()
775775
{
776-
if (EnableOmnibar)
776+
if (EnableOmnibarDesign)
777777
{
778778
OmnibarCurrentSelectedModeName = OmnibarSearchModeName;
779779
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@
170170
</wctcontrols:SettingsCard>
171171

172172
<!-- Omnibar -->
173-
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=EnableOmnibar}" IsEnabled="{x:Bind ViewModel.IsAppEnvironmentDev, Mode=OneWay}">
173+
<wctcontrols:SettingsCard Header="{helpers:ResourceString Name=EnableOmnibar}">
174174
<wctcontrols:SettingsCard.HeaderIcon>
175175
<FontIcon Glyph="&#xECAD;" />
176176
</wctcontrols:SettingsCard.HeaderIcon>
177-
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=EnableOmnibar}" IsOn="{x:Bind ViewModel.EnableOmnibar, Mode=TwoWay}" />
177+
<ToggleSwitch AutomationProperties.Name="{helpers:ResourceString Name=EnableOmnibar}" IsOn="{x:Bind ViewModel.EnableOmnibarDesign, Mode=TwoWay}" />
178178
</wctcontrols:SettingsCard>
179179
</StackPanel>
180180
</Grid>

0 commit comments

Comments
 (0)