From 7d5001de1882dec8b678e9830fa64e95567b6118 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Thu, 5 Jun 2025 18:16:13 +0800
Subject: [PATCH 01/16] Catch exception when installing Everything
---
.../Languages/en.xaml | 3 ++
.../Everything/EverythingSearchManager.cs | 33 ++++++++++++++-----
2 files changed, 27 insertions(+), 9 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
index eefd6f4eb..9f60aaa43 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
@@ -162,6 +162,9 @@
Do you want to enable content search for Everything?
It can be very slow without index (which is only supported in Everything v1.5+)
+ Unable to find Everything.exe
+ Failed to install Everything, please install it manually
+
Native Context Menu
Display native context menu (experimental)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs
index 6c9155539..ce71c94ba 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingSearchManager.cs
@@ -11,6 +11,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything
{
public class EverythingSearchManager : IIndexProvider, IContentIndexProvider, IPathIndexProvider
{
+ private static readonly string ClassName = nameof(EverythingSearchManager);
+
private Settings Settings { get; }
public EverythingSearchManager(Settings settings)
@@ -42,19 +44,32 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything
private async ValueTask ClickToInstallEverythingAsync(ActionContext _)
{
- var installedPath = await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath, Main.Context.API);
-
- if (installedPath == null)
+ try
{
- Main.Context.API.ShowMsgError("Unable to find Everything.exe");
+ var installedPath = await EverythingDownloadHelper.PromptDownloadIfNotInstallAsync(Settings.EverythingInstalledPath, Main.Context.API);
+
+ if (installedPath == null)
+ {
+ Main.Context.API.ShowMsgError(Main.Context.API.GetTranslation("flowlauncher_plugin_everything_not_found"));
+ Main.Context.API.LogError(ClassName, "Unable to find Everything.exe");
+
+ return false;
+ }
+
+ Settings.EverythingInstalledPath = installedPath;
+ Process.Start(installedPath, "-startup");
+
+ return true;
+ }
+ // Sometimes Everything installation will fail because of permission issues or file not found issues
+ // Just let the user know that Everything is not installed properly and ask them to install it manually
+ catch (Exception e)
+ {
+ Main.Context.API.ShowMsgError(Main.Context.API.GetTranslation("flowlauncher_plugin_everything_install_issue"));
+ Main.Context.API.LogException(ClassName, "Failed to install Everything", e);
return false;
}
-
- Settings.EverythingInstalledPath = installedPath;
- Process.Start(installedPath, "-startup");
-
- return true;
}
public async IAsyncEnumerable SearchAsync(string search, [EnumeratorCancellation] CancellationToken token)
From b2e754dfd56c9dc40765e54c075b132f3ea930e9 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Thu, 5 Jun 2025 18:48:26 +0800
Subject: [PATCH 02/16] Fix command issue for pswh.exe
---
Plugins/Flow.Launcher.Plugin.Shell/Main.cs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
index 2613c770b..2771a9118 100644
--- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
@@ -242,6 +242,9 @@ namespace Flow.Launcher.Plugin.Shell
case Shell.Pwsh:
{
+ // Using just a ; doesn't work with wt, as it's used to create a new tab for the terminal window
+ // \\ must be escaped for it to work properly, or breaking it into multiple arguments
+ var addedCharacter = _settings.UseWindowsTerminal ? "\\" : "";
if (_settings.UseWindowsTerminal)
{
info.FileName = "wt.exe";
@@ -256,7 +259,7 @@ namespace Flow.Launcher.Plugin.Shell
info.ArgumentList.Add("-NoExit");
}
info.ArgumentList.Add("-Command");
- info.ArgumentList.Add($"{command}\\; {(_settings.CloseShellAfterPress ? $"Write-Host '{Context.API.GetTranslation("flowlauncher_plugin_cmd_press_any_key_to_close")}'\\; [System.Console]::ReadKey()\\; exit" : "")}");
+ info.ArgumentList.Add($"{command}{addedCharacter}; {(_settings.CloseShellAfterPress ? $"Write-Host '{Context.API.GetTranslation("flowlauncher_plugin_cmd_press_any_key_to_close")}'\\; [System.Console]::ReadKey()\\; exit" : "")}");
break;
}
From d7c7ec8f5ef0fd0ad7472b7df9d204da6784895f Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Thu, 5 Jun 2025 18:55:58 +0800
Subject: [PATCH 03/16] Apply for all wt.exe
---
Plugins/Flow.Launcher.Plugin.Shell/Main.cs | 144 +++++++++++----------
1 file changed, 74 insertions(+), 70 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
index 2771a9118..d0add9f31 100644
--- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
@@ -201,97 +201,101 @@ namespace Flow.Launcher.Plugin.Shell
switch (_settings.Shell)
{
case Shell.Cmd:
- {
- if (_settings.UseWindowsTerminal)
{
- info.FileName = "wt.exe";
- info.ArgumentList.Add("cmd");
- }
- else
- {
- info.FileName = "cmd.exe";
- }
+ if (_settings.UseWindowsTerminal)
+ {
+ info.FileName = "wt.exe";
+ info.ArgumentList.Add("cmd");
+ }
+ else
+ {
+ info.FileName = "cmd.exe";
+ }
- info.ArgumentList.Add($"{(_settings.LeaveShellOpen ? "/k" : "/c")} {command} {(_settings.CloseShellAfterPress ? $"&& echo {Context.API.GetTranslation("flowlauncher_plugin_cmd_press_any_key_to_close")} && pause > nul /c" : "")}");
- break;
- }
+ info.ArgumentList.Add($"{(_settings.LeaveShellOpen ? "/k" : "/c")} {command} {(_settings.CloseShellAfterPress ? $"&& echo {Context.API.GetTranslation("flowlauncher_plugin_cmd_press_any_key_to_close")} && pause > nul /c" : "")}");
+ break;
+ }
case Shell.Powershell:
- {
- if (_settings.UseWindowsTerminal)
{
- info.FileName = "wt.exe";
- info.ArgumentList.Add("powershell");
+ // Using just a ; doesn't work with wt, as it's used to create a new tab for the terminal window
+ // \\ must be escaped for it to work properly, or breaking it into multiple arguments
+ var addedCharacter = _settings.UseWindowsTerminal ? "\\" : "";
+ if (_settings.UseWindowsTerminal)
+ {
+ info.FileName = "wt.exe";
+ info.ArgumentList.Add("powershell");
+ }
+ else
+ {
+ info.FileName = "powershell.exe";
+ }
+ if (_settings.LeaveShellOpen)
+ {
+ info.ArgumentList.Add("-NoExit");
+ info.ArgumentList.Add(command);
+ }
+ else
+ {
+ info.ArgumentList.Add("-Command");
+ info.ArgumentList.Add($"{command}{addedCharacter}; {(_settings.CloseShellAfterPress ? $"Write-Host '{Context.API.GetTranslation("flowlauncher_plugin_cmd_press_any_key_to_close")}'{addedCharacter}; [System.Console]::ReadKey(){addedCharacter}; exit" : "")}");
+ }
+ break;
}
- else
- {
- info.FileName = "powershell.exe";
- }
- if (_settings.LeaveShellOpen)
- {
- info.ArgumentList.Add("-NoExit");
- info.ArgumentList.Add(command);
- }
- else
- {
- info.ArgumentList.Add("-Command");
- info.ArgumentList.Add($"{command}\\; {(_settings.CloseShellAfterPress ? $"Write-Host '{Context.API.GetTranslation("flowlauncher_plugin_cmd_press_any_key_to_close")}'\\; [System.Console]::ReadKey()\\; exit" : "")}");
- }
- break;
- }
case Shell.Pwsh:
- {
- // Using just a ; doesn't work with wt, as it's used to create a new tab for the terminal window
- // \\ must be escaped for it to work properly, or breaking it into multiple arguments
- var addedCharacter = _settings.UseWindowsTerminal ? "\\" : "";
- if (_settings.UseWindowsTerminal)
{
- info.FileName = "wt.exe";
- info.ArgumentList.Add("pwsh");
+ // Using just a ; doesn't work with wt, as it's used to create a new tab for the terminal window
+ // \\ must be escaped for it to work properly, or breaking it into multiple arguments
+ var addedCharacter = _settings.UseWindowsTerminal ? "\\" : "";
+ if (_settings.UseWindowsTerminal)
+ {
+ info.FileName = "wt.exe";
+ info.ArgumentList.Add("pwsh");
+ }
+ else
+ {
+ info.FileName = "pwsh.exe";
+ }
+ if (_settings.LeaveShellOpen)
+ {
+ info.ArgumentList.Add("-NoExit");
+ }
+ info.ArgumentList.Add("-Command");
+ info.ArgumentList.Add($"{command}{addedCharacter}; {(_settings.CloseShellAfterPress ? $"Write-Host '{Context.API.GetTranslation("flowlauncher_plugin_cmd_press_any_key_to_close")}'{addedCharacter}; [System.Console]::ReadKey(){addedCharacter}; exit" : "")}");
+ break;
}
- else
- {
- info.FileName = "pwsh.exe";
- }
- if (_settings.LeaveShellOpen)
- {
- info.ArgumentList.Add("-NoExit");
- }
- info.ArgumentList.Add("-Command");
- info.ArgumentList.Add($"{command}{addedCharacter}; {(_settings.CloseShellAfterPress ? $"Write-Host '{Context.API.GetTranslation("flowlauncher_plugin_cmd_press_any_key_to_close")}'\\; [System.Console]::ReadKey()\\; exit" : "")}");
- break;
- }
case Shell.RunCommand:
- {
- var parts = command.Split(new[]
{
- ' '
- }, 2);
- if (parts.Length == 2)
- {
- var filename = parts[0];
- if (ExistInPath(filename))
+ var parts = command.Split(new[]
{
- var arguments = parts[1];
- info.FileName = filename;
- info.ArgumentList.Add(arguments);
+ ' '
+ }, 2);
+ if (parts.Length == 2)
+ {
+ var filename = parts[0];
+ if (ExistInPath(filename))
+ {
+ var arguments = parts[1];
+ info.FileName = filename;
+ info.ArgumentList.Add(arguments);
+ }
+ else
+ {
+ info.FileName = command;
+ }
}
else
{
info.FileName = command;
}
- }
- else
- {
- info.FileName = command;
+
+ info.UseShellExecute = true;
+
+ break;
}
- info.UseShellExecute = true;
-
- break;
- }
default:
throw new NotImplementedException();
}
From 08c8b8c09febcf1051dfc9e49f8f051b41bff646 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Thu, 5 Jun 2025 19:15:26 +0800
Subject: [PATCH 04/16] Do not show UI when shortcuts cannot be resolved
---
.../Programs/ShellLinkHelper.cs | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs
index a77b2ace8..34b3a6df2 100644
--- a/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs
+++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/ShellLinkHelper.cs
@@ -8,9 +8,8 @@ using Windows.Win32.Storage.FileSystem;
namespace Flow.Launcher.Plugin.Program.Programs
{
- class ShellLinkHelper
+ public class ShellLinkHelper
{
-
// Reference : http://www.pinvoke.net/default.aspx/Interfaces.IShellLinkW
[ComImport(), Guid("00021401-0000-0000-C000-000000000046")]
public class ShellLink
@@ -28,7 +27,9 @@ namespace Flow.Launcher.Plugin.Program.Programs
const int STGM_READ = 0;
((IPersistFile)link).Load(path, STGM_READ);
var hwnd = new HWND(IntPtr.Zero);
- ((IShellLinkW)link).Resolve(hwnd, 0);
+ // Use SLR_NO_UI to avoid showing any UI during resolution, like Problem with Shortcut dialogs
+ // https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishelllinka-resolve
+ ((IShellLinkW)link).Resolve(hwnd, (uint)SLR_FLAGS.SLR_NO_UI);
const int MAX_PATH = 260;
Span buffer = stackalloc char[MAX_PATH];
@@ -79,6 +80,6 @@ namespace Flow.Launcher.Plugin.Program.Programs
Marshal.ReleaseComObject(link);
return target;
- }
+ }
}
}
From 1697544cb65b4d766c58f41fb2a27ef4b59c37e8 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Thu, 5 Jun 2025 22:41:21 +0800
Subject: [PATCH 05/16] Add example code comments
---
.../FirefoxBookmarkLoader.cs | 28 +++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs
index 492a76c7b..f3b4c109f 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs
@@ -270,6 +270,7 @@ public class FirefoxBookmarkLoader : FirefoxBookmarkLoaderBase
///
/// Path to places.sqlite
///
+ ///
private static string PlacesPath
{
get
@@ -295,6 +296,33 @@ public class FirefoxBookmarkLoader : FirefoxBookmarkLoaderBase
var indexOfDefaultProfileAttributePath = lines.IndexOf("Path=" + defaultProfileFolderName);
+ /*
+ Current profiles.ini structure example as of Firefox version 69.0.1
+
+ [Install736426B0AF4A39CB]
+ Default=Profiles/7789f565.default-release <== this is the default profile this plugin will get the bookmarks from. When opened Firefox will load the default profile
+ Locked=1
+
+ [Profile2]
+ Name=newblahprofile
+ IsRelative=0
+ Path=C:\t6h2yuq8.newblahprofile <== Note this is a custom location path for the profile user can set, we need to cater for this in code.
+
+ [Profile1]
+ Name=default
+ IsRelative=1
+ Path=Profiles/cydum7q4.default
+ Default=1
+
+ [Profile0]
+ Name=default-release
+ IsRelative=1
+ Path=Profiles/7789f565.default-release
+
+ [General]
+ StartWithLastProfile=1
+ Version=2
+ */
// Seen in the example above, the IsRelative attribute is always above the Path attribute
var relativeAttribute = lines[indexOfDefaultProfileAttributePath - 1];
From 79d35bba5f398562fcde4ffea6ac9f70fa5a9004 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Thu, 5 Jun 2025 22:54:34 +0800
Subject: [PATCH 06/16] Check index before returning PlacesPath
---
.../FirefoxBookmarkLoader.cs | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs
index f3b4c109f..acace2506 100644
--- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs
+++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/FirefoxBookmarkLoader.cs
@@ -324,11 +324,22 @@ public class FirefoxBookmarkLoader : FirefoxBookmarkLoaderBase
Version=2
*/
// Seen in the example above, the IsRelative attribute is always above the Path attribute
+
+ var relativePath = Path.Combine(defaultProfileFolderName, "places.sqlite");
+ var absoluePath = Path.Combine(profileFolderPath, relativePath);
+
+ // If the index is out of range, it means that the default profile is in a custom location or the file is malformed
+ // If the profile is in a custom location, we need to check
+ if (indexOfDefaultProfileAttributePath - 1 < 0 ||
+ indexOfDefaultProfileAttributePath - 1 >= lines.Count)
+ {
+ return Directory.Exists(absoluePath) ? absoluePath : relativePath;
+ }
+
var relativeAttribute = lines[indexOfDefaultProfileAttributePath - 1];
return relativeAttribute == "0" // See above, the profile is located in a custom location, path is not relative, so IsRelative=0
- ? defaultProfileFolderName + @"\places.sqlite"
- : Path.Combine(profileFolderPath, defaultProfileFolderName) + @"\places.sqlite";
+ ? relativePath : absoluePath;
}
}
}
From 8c5e0c948f6e1cc799b912207e8bbeb92967c776 Mon Sep 17 00:00:00 2001
From: DB P
Date: Fri, 6 Jun 2025 17:05:12 +0900
Subject: [PATCH 07/16] Change Tabcontrol to Expander
---
.../Views/ExplorerSettings.xaml | 1370 ++++++++---------
.../Views/ExplorerSettings.xaml.cs | 49 +-
2 files changed, 698 insertions(+), 721 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
index 4302e721a..eff1b4751 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
@@ -10,97 +10,13 @@
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:viewModels="clr-namespace:Flow.Launcher.Plugin.Explorer.ViewModels"
xmlns:views="clr-namespace:Flow.Launcher.Plugin.Explorer.Views"
+ Margin="-72 0 -19 -14"
d:DataContext="{d:DesignInstance viewModels:SettingsViewModel}"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
-
-
@@ -163,653 +79,685 @@
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
+ Content="{DynamicResource plugin_explorer_default_open_in_file_manager}"
+ IsChecked="{Binding Settings.DefaultOpenFolderInFileManager}" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+ Text="{DynamicResource plugin_explorer_Index_Search_Engine}" />
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Orientation="Horizontal">
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
index 9203ece9a..0191e8a53 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
@@ -1,4 +1,5 @@
-using System.ComponentModel;
+using System.Collections.Generic;
+using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Windows;
@@ -11,28 +12,39 @@ using DragEventArgs = System.Windows.DragEventArgs;
namespace Flow.Launcher.Plugin.Explorer.Views
{
- ///
- /// Interaction logic for ExplorerSettings.xaml
- ///
public partial class ExplorerSettings
{
private readonly SettingsViewModel viewModel;
+ private List _expanders;
public ExplorerSettings(SettingsViewModel viewModel)
{
DataContext = viewModel;
-
InitializeComponent();
-
this.viewModel = viewModel;
-
- DataContext = viewModel;
+ // DataContext = viewModel; // Removed duplicate
ActionKeywordModel.Init(viewModel.Settings);
- lbxAccessLinks.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
+ // Ensure lbxAccessLinks and lbxExcludedPaths are initialized before accessing Items
+ // This might require Loaded event if they are not immediately available
+ // For now, assuming they are available after InitializeComponent()
+ if (lbxAccessLinks != null)
+ lbxAccessLinks.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
+
+ if (lbxExcludedPaths != null)
+ lbxExcludedPaths.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
- lbxExcludedPaths.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
+ _expanders = new List
+ {
+ GeneralSettingsExpander,
+ ContextMenuExpander,
+ PreviewPanelExpander,
+ EverythingExpander,
+ ActionKeywordsExpander,
+ QuickAccessExpander,
+ ExcludedPathsExpander
+ };
}
private void AccessLinkDragDrop(string containerName, DragEventArgs e)
@@ -93,5 +105,22 @@ namespace Flow.Launcher.Plugin.Explorer.Views
{
e.Handled = e.Text.ToCharArray().Any(c => !char.IsDigit(c));
}
+
+ private void Expander_Expanded(object sender, RoutedEventArgs e)
+ {
+ if (sender is Expander expandedExpander)
+ {
+ // Ensure _expanders is not null and contains items
+ if (_expanders == null || !_expanders.Any()) return;
+
+ foreach (var expander in _expanders)
+ {
+ if (expander != null && expander != expandedExpander && expander.IsExpanded)
+ {
+ expander.IsExpanded = false;
+ }
+ }
+ }
+ }
}
}
From 6cd830c5b5088f30364607a1b6489ea468e9570e Mon Sep 17 00:00:00 2001
From: DB P
Date: Fri, 6 Jun 2025 17:07:57 +0900
Subject: [PATCH 08/16] Fix Font Color
---
.../Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
index eff1b4751..ca395fc5e 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
@@ -88,6 +88,7 @@
From c2eca7dc39407212d1fbd1de03a11f475ffc0a59 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 6 Jun 2025 16:15:26 +0800
Subject: [PATCH 09/16] Improve code quality
---
.../Views/ExplorerSettings.xaml.cs | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
index 0191e8a53..bb52612e4 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
@@ -14,15 +14,17 @@ namespace Flow.Launcher.Plugin.Explorer.Views
{
public partial class ExplorerSettings
{
- private readonly SettingsViewModel viewModel;
- private List _expanders;
+ private readonly SettingsViewModel _viewModel;
+ private readonly List _expanders;
public ExplorerSettings(SettingsViewModel viewModel)
{
+ _viewModel = viewModel;
DataContext = viewModel;
+
InitializeComponent();
- this.viewModel = viewModel;
- // DataContext = viewModel; // Removed duplicate
+
+ DataContext = viewModel;
ActionKeywordModel.Init(viewModel.Settings);
@@ -63,7 +65,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
{
Path = s
};
- viewModel.AppendLink(containerName, newFolderLink);
+ _viewModel.AppendLink(containerName, newFolderLink);
}
}
}
@@ -88,8 +90,8 @@ namespace Flow.Launcher.Plugin.Explorer.Views
{
if (tbFastSortWarning is not null)
{
- tbFastSortWarning.Visibility = viewModel.FastSortWarningVisibility;
- tbFastSortWarning.Text = viewModel.SortOptionWarningMessage;
+ tbFastSortWarning.Visibility = _viewModel.FastSortWarningVisibility;
+ tbFastSortWarning.Text = _viewModel.SortOptionWarningMessage;
}
}
private void LbxAccessLinks_OnDrop(object sender, DragEventArgs e)
From 05cd01d1d61c2cb9b8ddcbb35a3590f584a02d4e Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 6 Jun 2025 16:20:43 +0800
Subject: [PATCH 10/16] Use loaded event to ensure accessability
---
.../Views/ExplorerSettings.xaml | 7 ++-
.../Views/ExplorerSettings.xaml.cs | 47 ++++++++++---------
2 files changed, 32 insertions(+), 22 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
index ca395fc5e..451d7afb2 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
@@ -110,6 +110,7 @@
Expanded="Expander_Expanded"
Header="{DynamicResource plugin_explorer_generalsetting_header}"
IsExpanded="False"
+ Loaded="GeneralSettingsExpander_Loaded"
Style="{StaticResource CustomExpanderStyle}">
@@ -664,6 +665,7 @@
Drop="LbxAccessLinks_OnDrop"
ItemTemplate="{StaticResource ListViewTemplateAccessLinks}"
ItemsSource="{Binding Settings.QuickAccessLinks}"
+ Loaded="lbxAccessLinks_Loaded"
SelectedItem="{Binding SelectedQuickAccessLink}" />
@@ -698,9 +700,11 @@
@@ -728,6 +732,7 @@
Drop="LbxExcludedPaths_OnDrop"
ItemTemplate="{StaticResource ListViewTemplateAccessLinks}"
ItemsSource="{Binding Settings.IndexSearchExcludedSubdirectoryPaths}"
+ Loaded="lbxExcludedPaths_Loaded"
SelectedItem="{Binding SelectedIndexSearchExcludedPath}" />
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
index bb52612e4..e82c10ae2 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
@@ -15,7 +15,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
public partial class ExplorerSettings
{
private readonly SettingsViewModel _viewModel;
- private readonly List _expanders;
+ private readonly List _expanders = new();
public ExplorerSettings(SettingsViewModel viewModel)
{
@@ -27,26 +27,6 @@ namespace Flow.Launcher.Plugin.Explorer.Views
DataContext = viewModel;
ActionKeywordModel.Init(viewModel.Settings);
-
- // Ensure lbxAccessLinks and lbxExcludedPaths are initialized before accessing Items
- // This might require Loaded event if they are not immediately available
- // For now, assuming they are available after InitializeComponent()
- if (lbxAccessLinks != null)
- lbxAccessLinks.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
-
- if (lbxExcludedPaths != null)
- lbxExcludedPaths.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
-
- _expanders = new List
- {
- GeneralSettingsExpander,
- ContextMenuExpander,
- PreviewPanelExpander,
- EverythingExpander,
- ActionKeywordsExpander,
- QuickAccessExpander,
- ExcludedPathsExpander
- };
}
private void AccessLinkDragDrop(string containerName, DragEventArgs e)
@@ -124,5 +104,30 @@ namespace Flow.Launcher.Plugin.Explorer.Views
}
}
}
+
+ private void lbxAccessLinks_Loaded(object sender, RoutedEventArgs e)
+ {
+ lbxAccessLinks.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
+ }
+
+ private void lbxExcludedPaths_Loaded(object sender, RoutedEventArgs e)
+ {
+ lbxExcludedPaths.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
+ }
+
+ private void GeneralSettingsExpander_Loaded(object sender, RoutedEventArgs e)
+ {
+ var expanders = new List
+ {
+ GeneralSettingsExpander,
+ ContextMenuExpander,
+ PreviewPanelExpander,
+ EverythingExpander,
+ ActionKeywordsExpander,
+ QuickAccessExpander,
+ ExcludedPathsExpander
+ };
+ _expanders.AddRange(expanders);
+ }
}
}
From b29bc75dcb8e4e50de3b48a7aff9716f5ca7f6b6 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 6 Jun 2025 16:53:31 +0800
Subject: [PATCH 11/16] Improve setting panel design
---
.../Views/ExplorerSettings.xaml | 23 ++++++++++---------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
index 451d7afb2..83ef42688 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
@@ -10,7 +10,6 @@
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:viewModels="clr-namespace:Flow.Launcher.Plugin.Explorer.ViewModels"
xmlns:views="clr-namespace:Flow.Launcher.Plugin.Explorer.Views"
- Margin="-72 0 -19 -14"
d:DataContext="{d:DesignInstance viewModels:SettingsViewModel}"
d:DesignHeight="450"
d:DesignWidth="800"
@@ -86,7 +85,7 @@
@@ -101,8 +100,9 @@
-
-
+
+
+
-
+
+
@@ -333,7 +334,7 @@
Header="{DynamicResource plugin_explorer_native_context_menu_header}"
IsExpanded="False"
Style="{StaticResource CustomExpanderStyle}">
-
+
@@ -403,7 +404,7 @@
Header="{DynamicResource plugin_explorer_previewpanel_setting_header}"
IsExpanded="False"
Style="{StaticResource CustomExpanderStyle}">
-
+
@@ -500,7 +501,7 @@
Header="{DynamicResource plugin_explorer_everything_setting_header}"
IsExpanded="False"
Style="{StaticResource CustomExpanderStyle}">
-
+
@@ -592,7 +593,7 @@
Header="{DynamicResource plugin_explorer_manageactionkeywords_header}"
IsExpanded="False"
Style="{StaticResource CustomExpanderStyle}">
-
+
@@ -638,7 +639,7 @@
Header="{DynamicResource plugin_explorer_quickaccesslinks_header}"
IsExpanded="False"
Style="{StaticResource CustomExpanderStyle}">
-
+
@@ -706,7 +707,7 @@
Header="{DynamicResource plugin_explorer_indexsearchexcludedpaths_header}"
IsExpanded="False"
Style="{StaticResource CustomExpanderStyle}">
-
+
From 569cb8bd44b743c104ec82dc6598ec8bbad42051 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 6 Jun 2025 16:57:48 +0800
Subject: [PATCH 12/16] Remove grid & scroll viewer & Remove bottom margin
---
.../Views/ExplorerSettings.xaml | 1290 ++++++++---------
1 file changed, 643 insertions(+), 647 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
index 83ef42688..070820a0d 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
@@ -101,670 +101,666 @@
-
-
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+ Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
+ Content="{DynamicResource plugin_explorer_previewpanel_display_file_size_checkbox}"
+ IsChecked="{Binding ShowFileSizeInPreviewPanel}" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Content="{DynamicResource plugin_explorer_previewpanel_display_file_creation_checkbox}"
+ IsChecked="{Binding ShowCreatedDateInPreviewPanel}" />
+ Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
+ Content="{DynamicResource plugin_explorer_previewpanel_display_file_modification_checkbox}"
+ IsChecked="{Binding ShowModifiedDateInPreviewPanel}" />
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+ Text="{Binding PreviewPanelDateFormatDemo}" />
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ Text="{Binding PreviewPanelTimeFormatDemo}" />
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 6614771c3dfafd8a32d4573303f8ff479eea9477 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 6 Jun 2025 17:03:20 +0800
Subject: [PATCH 13/16] Move initialization to constructor
---
.../Views/ExplorerSettings.xaml | 1 -
.../Views/ExplorerSettings.xaml.cs | 28 ++++++++-----------
2 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
index 070820a0d..b81c3cac3 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
@@ -108,7 +108,6 @@
Expanded="Expander_Expanded"
Header="{DynamicResource plugin_explorer_generalsetting_header}"
IsExpanded="False"
- Loaded="GeneralSettingsExpander_Loaded"
Style="{StaticResource CustomExpanderStyle}">
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
index e82c10ae2..2c50f1c6f 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs
@@ -15,7 +15,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
public partial class ExplorerSettings
{
private readonly SettingsViewModel _viewModel;
- private readonly List _expanders = new();
+ private readonly List _expanders;
public ExplorerSettings(SettingsViewModel viewModel)
{
@@ -27,6 +27,17 @@ namespace Flow.Launcher.Plugin.Explorer.Views
DataContext = viewModel;
ActionKeywordModel.Init(viewModel.Settings);
+
+ _expanders = new List
+ {
+ GeneralSettingsExpander,
+ ContextMenuExpander,
+ PreviewPanelExpander,
+ EverythingExpander,
+ ActionKeywordsExpander,
+ QuickAccessExpander,
+ ExcludedPathsExpander
+ };
}
private void AccessLinkDragDrop(string containerName, DragEventArgs e)
@@ -114,20 +125,5 @@ namespace Flow.Launcher.Plugin.Explorer.Views
{
lbxExcludedPaths.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
}
-
- private void GeneralSettingsExpander_Loaded(object sender, RoutedEventArgs e)
- {
- var expanders = new List
- {
- GeneralSettingsExpander,
- ContextMenuExpander,
- PreviewPanelExpander,
- EverythingExpander,
- ActionKeywordsExpander,
- QuickAccessExpander,
- ExcludedPathsExpander
- };
- _expanders.AddRange(expanders);
- }
}
}
From 0c474a979ff48988b7624035c5b97047201e0312 Mon Sep 17 00:00:00 2001
From: DB P
Date: Fri, 6 Jun 2025 20:36:30 +0900
Subject: [PATCH 14/16] Add Hover Style / Adjust Arrow / Adjust Padding
---
.../Resources/CustomControlTemplate.xaml | 73 +++++++++++++
.../Views/ExplorerSettings.xaml | 101 +++++++++++++++---
2 files changed, 160 insertions(+), 14 deletions(-)
diff --git a/Flow.Launcher/Resources/CustomControlTemplate.xaml b/Flow.Launcher/Resources/CustomControlTemplate.xaml
index 08b239c41..cdaadd45a 100644
--- a/Flow.Launcher/Resources/CustomControlTemplate.xaml
+++ b/Flow.Launcher/Resources/CustomControlTemplate.xaml
@@ -2407,6 +2407,79 @@
+
+
+
+
From dc3fada88f642800dee716e223a61c1df4cd3eaf Mon Sep 17 00:00:00 2001
From: DB P
Date: Fri, 6 Jun 2025 20:38:07 +0900
Subject: [PATCH 15/16] Fix Border
---
.../Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
index 0d4710e24..05135e0d2 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
@@ -86,7 +86,7 @@
-
+
From 600137c91196c39b96c4881880aef744c3011e5a Mon Sep 17 00:00:00 2001
From: DB P
Date: Fri, 6 Jun 2025 20:38:37 +0900
Subject: [PATCH 16/16] Fix Border
---
.../Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
index 05135e0d2..47d53d463 100644
--- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
+++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
@@ -86,7 +86,7 @@
-
+