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 @@
+
+
+
+
-
@@ -163,653 +78,760 @@
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ VerticalAlignment="Center"
+ Text="{Binding FileEditorPath}"
+ TextWrapping="NoWrap" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ DockPanel.Dock="Right">
+
+
+
+
+
+
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ DockPanel.Dock="Right"
+ IsEnabled="{Binding ShowPreviewPanelDateTimeChoices}"
+ Visibility="{Binding PreviewPanelDateTimeChoicesVisibility}">
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ 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..2c50f1c6f 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,32 @@ 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 readonly SettingsViewModel _viewModel;
+ private readonly List _expanders;
public ExplorerSettings(SettingsViewModel viewModel)
{
+ _viewModel = viewModel;
DataContext = viewModel;
InitializeComponent();
- this.viewModel = viewModel;
-
DataContext = viewModel;
ActionKeywordModel.Init(viewModel.Settings);
- lbxAccessLinks.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)
@@ -51,7 +56,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
{
Path = s
};
- viewModel.AppendLink(containerName, newFolderLink);
+ _viewModel.AppendLink(containerName, newFolderLink);
}
}
}
@@ -76,8 +81,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)
@@ -93,5 +98,32 @@ 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;
+ }
+ }
+ }
+ }
+
+ 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));
+ }
}
}
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;
- }
+ }
}
}
diff --git a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
index 2613c770b..d0add9f31 100644
--- a/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
+++ b/Plugins/Flow.Launcher.Plugin.Shell/Main.cs
@@ -201,94 +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:
- {
- 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}\\; {(_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();
}