mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Explorer plugin native context menu: implement settings
This commit is contained in:
parent
1747a64d6b
commit
d07cb1c166
4 changed files with 62 additions and 2 deletions
|
|
@ -282,7 +282,19 @@ namespace Flow.Launcher.Plugin.Explorer
|
||||||
|
|
||||||
if (record.Type is ResultType.File or ResultType.Folder)
|
if (record.Type is ResultType.File or ResultType.Folder)
|
||||||
{
|
{
|
||||||
var menuItems = ShellContextMenuDisplayHelper.GetContextMenuWithIcons(record.FullPath);
|
var filters = Settings
|
||||||
|
.WindowsContextMenuIgnoredItems
|
||||||
|
.Replace("\r", "")
|
||||||
|
.Split("\n")
|
||||||
|
.Where(v => !string.IsNullOrWhiteSpace(v))
|
||||||
|
.ToArray();
|
||||||
|
var menuItems = ShellContextMenuDisplayHelper
|
||||||
|
.GetContextMenuWithIcons(record.FullPath)
|
||||||
|
.Where(contextMenuItem =>
|
||||||
|
filters.Length == 0 || !filters.Any(filter =>
|
||||||
|
contextMenuItem.Label.Contains(filter, StringComparison.OrdinalIgnoreCase)
|
||||||
|
)
|
||||||
|
);
|
||||||
foreach (var menuItem in menuItems)
|
foreach (var menuItem in menuItems)
|
||||||
{
|
{
|
||||||
contextMenus.Add(new Result
|
contextMenus.Add(new Result
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ namespace Flow.Launcher.Plugin.Explorer
|
||||||
|
|
||||||
public bool ShowWindowsContextMenu { get; set; } = true;
|
public bool ShowWindowsContextMenu { get; set; } = true;
|
||||||
|
|
||||||
|
public string WindowsContextMenuIgnoredItems { get; set; } = string.Empty;
|
||||||
|
|
||||||
public bool DefaultOpenFolderInFileManager { get; set; } = false;
|
public bool DefaultOpenFolderInFileManager { get; set; } = false;
|
||||||
|
|
||||||
public string SearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
|
public string SearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
|
||||||
|
|
@ -62,7 +64,7 @@ namespace Flow.Launcher.Plugin.Explorer
|
||||||
public bool ShowModifiedDateInPreviewPanel { get; set; } = true;
|
public bool ShowModifiedDateInPreviewPanel { get; set; } = true;
|
||||||
|
|
||||||
public string PreviewPanelDateFormat { get; set; } = "yyyy-MM-dd";
|
public string PreviewPanelDateFormat { get; set; } = "yyyy-MM-dd";
|
||||||
|
|
||||||
public string PreviewPanelTimeFormat { get; set; } = "HH:mm";
|
public string PreviewPanelTimeFormat { get; set; } = "HH:mm";
|
||||||
|
|
||||||
private EverythingSearchManager _everythingManagerInstance;
|
private EverythingSearchManager _everythingManagerInstance;
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,30 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Native Context Menu
|
||||||
|
|
||||||
|
public bool ShowWindowsContextMenu
|
||||||
|
{
|
||||||
|
get => Settings.ShowWindowsContextMenu;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
Settings.ShowWindowsContextMenu = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string WindowsContextMenuIgnoredItems
|
||||||
|
{
|
||||||
|
get => Settings.WindowsContextMenuIgnoredItems;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
Settings.WindowsContextMenuIgnoredItems = value;
|
||||||
|
OnPropertyChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region Preview Panel
|
#region Preview Panel
|
||||||
|
|
||||||
public bool ShowFileSizeInPreviewPanel
|
public bool ShowFileSizeInPreviewPanel
|
||||||
|
|
|
||||||
|
|
@ -348,6 +348,28 @@
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
<TabItem
|
||||||
|
Width="Auto"
|
||||||
|
Header="Native Context Menu"
|
||||||
|
Style="{DynamicResource ExplorerTabItem}">
|
||||||
|
<StackPanel Margin="30 20 10 10">
|
||||||
|
<CheckBox
|
||||||
|
Margin="0 10 0 0"
|
||||||
|
Content="Display native context menu (experimental)"
|
||||||
|
IsChecked="{Binding ShowWindowsContextMenu}" />
|
||||||
|
|
||||||
|
<TextBlock
|
||||||
|
Margin="0 10"
|
||||||
|
Foreground="{DynamicResource Color05B}"
|
||||||
|
Text="Below you can specify items you want to exclude from context menu, they can be partial (e.g. 'pen wit') or complete ('Open with')" />
|
||||||
|
|
||||||
|
<TextBox
|
||||||
|
Height="300"
|
||||||
|
AcceptsReturn="True"
|
||||||
|
Text="{Binding WindowsContextMenuIgnoredItems}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
<TabItem
|
<TabItem
|
||||||
Width="Auto"
|
Width="Auto"
|
||||||
Header="{DynamicResource plugin_explorer_previewpanel_setting_header}"
|
Header="{DynamicResource plugin_explorer_previewpanel_setting_header}"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue