-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature: Added a Command Palette (#12977)
- Loading branch information
1 parent
7de0fa4
commit 2e36593
Showing
10 changed files
with
248 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Copyright (c) 2023 Files Community | ||
// Licensed under the MIT License. See the LICENSE. | ||
|
||
namespace Files.App.Actions | ||
{ | ||
internal class OpenCommandPaletteAction : IAction | ||
{ | ||
private readonly IContentPageContext _context; | ||
|
||
public string Label | ||
=> "CommandPalette".GetLocalizedResource(); | ||
|
||
public string Description | ||
=> "OpenCommandPaletteDescription".GetLocalizedResource(); | ||
|
||
public HotKey HotKey | ||
=> new(Keys.P, KeyModifiers.CtrlShift); | ||
|
||
public OpenCommandPaletteAction() | ||
{ | ||
_context = Ioc.Default.GetRequiredService<IContentPageContext>(); | ||
} | ||
|
||
public Task ExecuteAsync() | ||
{ | ||
_context.ShellPage?.ToolbarViewModel.OpenCommandPalette(); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) 2023 Files Community | ||
// Licensed under the MIT License. See the LICENSE. | ||
|
||
using Microsoft.UI.Xaml.Media; | ||
|
||
namespace Files.App.Data.Items | ||
{ | ||
public class NavigationBarSuggestionItem : ObservableObject | ||
{ | ||
private string? _Text; | ||
public string? Text | ||
{ | ||
get => _Text; | ||
set => SetProperty(ref _Text, value); | ||
} | ||
|
||
private string? _PrimaryDisplay; | ||
public string? PrimaryDisplay | ||
{ | ||
get => _PrimaryDisplay; | ||
set => SetProperty(ref _PrimaryDisplay, value); | ||
} | ||
|
||
private string? _SecondaryDisplay; | ||
public string? SecondaryDisplay | ||
{ | ||
get => _SecondaryDisplay; | ||
set => SetProperty(ref _SecondaryDisplay, value); | ||
} | ||
|
||
private string? _SupplementaryDisplay; | ||
public string? SupplementaryDisplay | ||
{ | ||
get => _SupplementaryDisplay; | ||
set => SetProperty(ref _SupplementaryDisplay, value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.