From 1a6a41626d7e50019b3321d73952c31cb9aff227 Mon Sep 17 00:00:00 2001 From: DB P Date: Mon, 14 Apr 2025 03:10:46 +0900 Subject: [PATCH 01/18] Change Default value (UseLocatinoAsWorkingDir/AutoComplete Hotkey) --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 2 +- Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 7c2457a72c7..c3316fbec4c 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -41,7 +41,7 @@ public void Save() public bool ShowOpenResultHotkey { get; set; } = true; public double WindowSize { get; set; } = 580; public string PreviewHotkey { get; set; } = $"F1"; - public string AutoCompleteHotkey { get; set; } = $"{KeyConstant.Ctrl} + Tab"; + public string AutoCompleteHotkey { get; set; } = $"{KeyConstant.Alt} + Right"; public string AutoCompleteHotkey2 { get; set; } = $""; public string SelectNextItemHotkey { get; set; } = $"Tab"; public string SelectNextItemHotkey2 { get; set; } = $""; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index 3d30bcf29e5..94e66c15323 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -28,7 +28,7 @@ public class Settings public string ExcludedFileTypes { get; set; } = ""; - public bool UseLocationAsWorkingDir { get; set; } = false; + public bool UseLocationAsWorkingDir { get; set; } = true; public bool ShowInlinedWindowsContextMenu { get; set; } = false; From 1e88c007fca1d90150467646707014978fed94e1 Mon Sep 17 00:00:00 2001 From: DB P Date: Mon, 14 Apr 2025 03:34:58 +0900 Subject: [PATCH 02/18] Change hotkey default value for reset part --- Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml index b1d72ede5bf..5956b7a91cc 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml @@ -212,7 +212,7 @@ Sub="{DynamicResource autoCompleteHotkeyToolTip}"> From 0a5fa182ce078d69025d44d5ad34c82af69f20bd Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 14 Apr 2025 11:54:37 +0900 Subject: [PATCH 03/18] Add Delete Word function and hotkey --- .../UserSettings/Settings.cs | 6 + Flow.Launcher/HotkeyControl.xaml.cs | 10 ++ Flow.Launcher/MainWindow.xaml | 8 ++ .../Views/SettingsPaneHotkey.xaml | 21 ++++ Flow.Launcher/ViewModel/MainViewModel.cs | 109 ++++++++++++++++++ 5 files changed, 154 insertions(+) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index c3316fbec4c..c9a7d43d379 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -43,6 +43,8 @@ public void Save() public string PreviewHotkey { get; set; } = $"F1"; public string AutoCompleteHotkey { get; set; } = $"{KeyConstant.Alt} + Right"; public string AutoCompleteHotkey2 { get; set; } = $""; + public string DeleteWordHotkey { get; set; } = $"{KeyConstant.Alt} + Left"; + public string DeleteWordHotkey2 { get; set; } = $""; public string SelectNextItemHotkey { get; set; } = $"Tab"; public string SelectNextItemHotkey2 { get; set; } = $""; public string SelectPrevItemHotkey { get; set; } = $"Shift + Tab"; @@ -366,6 +368,10 @@ public List RegisteredHotkeys list.Add(new(AutoCompleteHotkey, "autoCompleteHotkey", () => AutoCompleteHotkey = "")); if(!string.IsNullOrEmpty(AutoCompleteHotkey2)) list.Add(new(AutoCompleteHotkey2, "autoCompleteHotkey", () => AutoCompleteHotkey2 = "")); + if(!string.IsNullOrEmpty(DeleteWordHotkey)) + list.Add(new(DeleteWordHotkey, "deleteWordHotkey", () => DeleteWordHotkey = "")); + if(!string.IsNullOrEmpty(DeleteWordHotkey2)) + list.Add(new(DeleteWordHotkey2, "deleteWordHotkey", () => DeleteWordHotkey2 = "")); if(!string.IsNullOrEmpty(SelectNextItemHotkey)) list.Add(new(SelectNextItemHotkey, "SelectNextItemHotkey", () => SelectNextItemHotkey = "")); if(!string.IsNullOrEmpty(SelectNextItemHotkey2)) diff --git a/Flow.Launcher/HotkeyControl.xaml.cs b/Flow.Launcher/HotkeyControl.xaml.cs index 8762a934bbb..d7f443503d5 100644 --- a/Flow.Launcher/HotkeyControl.xaml.cs +++ b/Flow.Launcher/HotkeyControl.xaml.cs @@ -106,6 +106,8 @@ public enum HotkeyType SelectNextPageHotkey, AutoCompleteHotkey, AutoCompleteHotkey2, + DeleteWordHotkey, + DeleteWordHotkey2, SelectPrevItemHotkey, SelectPrevItemHotkey2, SelectNextItemHotkey, @@ -136,6 +138,8 @@ public string Hotkey HotkeyType.SelectNextPageHotkey => _settings.SelectNextPageHotkey, HotkeyType.AutoCompleteHotkey => _settings.AutoCompleteHotkey, HotkeyType.AutoCompleteHotkey2 => _settings.AutoCompleteHotkey2, + HotkeyType.DeleteWordHotkey => _settings.DeleteWordHotkey, + HotkeyType.DeleteWordHotkey2 => _settings.DeleteWordHotkey2, HotkeyType.SelectPrevItemHotkey => _settings.SelectPrevItemHotkey, HotkeyType.SelectPrevItemHotkey2 => _settings.SelectPrevItemHotkey2, HotkeyType.SelectNextItemHotkey => _settings.SelectNextItemHotkey, @@ -184,6 +188,12 @@ public string Hotkey case HotkeyType.AutoCompleteHotkey2: _settings.AutoCompleteHotkey2 = value; break; + case HotkeyType.DeleteWordHotkey: + _settings.DeleteWordHotkey = value; + break; + case HotkeyType.DeleteWordHotkey2: + _settings.DeleteWordHotkey2 = value; + break; case HotkeyType.SelectPrevItemHotkey: _settings.SelectPrevItemHotkey = value; break; diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 31bc2ba5046..037799cf481 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -171,6 +171,14 @@ Key="{Binding AutoCompleteHotkey2, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}" Command="{Binding AutocompleteQueryCommand}" Modifiers="{Binding AutoCompleteHotkey2, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" /> + + + + + + + + + + + + /// Command to delete the last word from the query box (for path) + /// + [RelayCommand] + private void DeleteWord() + { + if (string.IsNullOrEmpty(QueryText)) + return; + + string text = QueryText; + // Check if it can be treated as a file path (if it contains a backslash) + if (text.Contains('\\')) + { + // Remove the backslash at the end if it exists + string trimmedPath = text.TrimEnd('\\'); + + // Find the last directory separator (backslash) and cut it off + int lastDirSeparatorIndex = trimmedPath.LastIndexOf('\\'); + + if (lastDirSeparatorIndex > 0) + { + // Cut off the last part of the directory path and keep the backslash + ChangeQueryText(text.Substring(0, lastDirSeparatorIndex + 1)); + } + else if (trimmedPath.EndsWith(":") || trimmedPath.EndsWith(":\\")) + { + // If it is a drive root (e.g. c:\), empty it + ChangeQueryText(string.Empty); + } + else + { + // Handle special cases (if there is a backslash but not a normal path pattern) + DeleteWordNormal(text); + } + } + else + { + // Process as normal text + DeleteWordNormal(text); + } + } + /// + /// Command to delete the last word from the query box (similar to Ctrl+Backspace functionality) + /// + private void DeleteWordNormal(string text) + { + if (string.IsNullOrEmpty(text)) + { + ChangeQueryText(string.Empty); + return; + } + + int length = text.Length; + int currentPos = length - 1; + + // Skip trailing whitespace + while (currentPos >= 0 && char.IsWhiteSpace(text[currentPos])) + currentPos--; + + if (currentPos < 0) + { + ChangeQueryText(string.Empty); + return; + } + + // Check if the current character is a special character + bool IsSpecialChar(char c) => !char.IsLetterOrDigit(c) && c != '_'; + bool isCurrentSpecial = currentPos >= 0 && IsSpecialChar(text[currentPos]); + + // Find the word start position + int wordStart = currentPos; + + if (isCurrentSpecial) + { + // If the current character is a special character, delete only that special character + wordStart--; + } + else + { + // If the current character is a regular character, move to the beginning of the word + while (wordStart >= 0 && !IsSpecialChar(text[wordStart]) && !char.IsWhiteSpace(text[wordStart])) + wordStart--; + } + + // Skip remaining whitespace + if (wordStart >= 0 && char.IsWhiteSpace(text[wordStart])) + { + while (wordStart >= 0 && char.IsWhiteSpace(text[wordStart])) + wordStart--; + } + + // Calculate new text length + int newLength = wordStart + 1; + + // Set new text + if (newLength <= 0) + { + ChangeQueryText(string.Empty); + } + else + { + ChangeQueryText(text[..newLength]); + } + } + private static IReadOnlyList DeepCloneResults(IReadOnlyList results, CancellationToken token = default) { var resultsCopy = new List(); @@ -847,6 +954,8 @@ private static string VerifyOrSetDefaultHotkey(string hotkey, string defaultHotk public string PreviewHotkey => VerifyOrSetDefaultHotkey(Settings.PreviewHotkey, "F1"); public string AutoCompleteHotkey => VerifyOrSetDefaultHotkey(Settings.AutoCompleteHotkey, "Ctrl+Tab"); public string AutoCompleteHotkey2 => VerifyOrSetDefaultHotkey(Settings.AutoCompleteHotkey2, ""); + public string DeleteWordHotkey => VerifyOrSetDefaultHotkey(Settings.DeleteWordHotkey, "Alt+Left"); + public string DeleteWordHotkey2 => VerifyOrSetDefaultHotkey(Settings.DeleteWordHotkey2, ""); public string SelectNextItemHotkey => VerifyOrSetDefaultHotkey(Settings.SelectNextItemHotkey, "Tab"); public string SelectNextItemHotkey2 => VerifyOrSetDefaultHotkey(Settings.SelectNextItemHotkey2, ""); public string SelectPrevItemHotkey => VerifyOrSetDefaultHotkey(Settings.SelectPrevItemHotkey, "Shift+Tab"); From 2d69bc38b8877c2a73dcf3d66a5aaad3e091bd79 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 14 Apr 2025 12:07:11 +0900 Subject: [PATCH 04/18] Add String and adjust glyph --- Flow.Launcher/Languages/en.xaml | 2 ++ Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 9a9b8e1316e..1fff1c6c64f 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -255,6 +255,8 @@ Show result selection hotkey with results. Auto Complete Runs autocomplete for the selected items. + Delete Word Backwards + Deletes text by word. For paths, deletes by path segment. Select Next Item Select Previous Item Next Page diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml index b42d4b272e2..643fb9839a4 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml @@ -230,7 +230,8 @@ + Icon="" + Sub="{DynamicResource DeleteWordHotkeyToolTip}"> Date: Thu, 17 Apr 2025 12:33:08 +0900 Subject: [PATCH 05/18] Add Infobar(open folder and autocomplete) in hotkey pane --- Flow.Launcher/Languages/en.xaml | 4 ++++ .../Views/SettingsPaneHotkey.xaml | 23 +++++++++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 1fff1c6c64f..fb508f0fc36 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -304,6 +304,10 @@ Show badges for query results where supported Show Result Badges for Global Query Only Show badges for global query results only + Opening a folder using the Enter key + If you turn off "Hit Enter to open folder in Default File Manager" in the Explorer plugin, you'll be able to explore the contents of the folder instead of opening it in your file manager. + Auto-complete & Delete Path + Try using Auto Complete and the Delete Word Backwards shortcut when switching directories. HTTP Proxy diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml index 643fb9839a4..9c0341d6d32 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml @@ -66,10 +66,17 @@ OnContent="{DynamicResource enable}" /> - + @@ -204,10 +211,17 @@ - + @@ -248,7 +262,6 @@ ValidateKeyGesture="False" /> - Date: Fri, 18 Apr 2025 06:49:01 +0900 Subject: [PATCH 06/18] Fix EntityName --- Flow.Launcher/Languages/en.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index fb508f0fc36..5fcbe67a707 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -306,7 +306,7 @@ Show badges for global query results only Opening a folder using the Enter key If you turn off "Hit Enter to open folder in Default File Manager" in the Explorer plugin, you'll be able to explore the contents of the folder instead of opening it in your file manager. - Auto-complete & Delete Path + Auto-complete & Delete Path Try using Auto Complete and the Delete Word Backwards shortcut when switching directories. From 4f18ef0331638fb1f21d5c902d473cd0133a772b Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 18 Apr 2025 08:04:10 +0900 Subject: [PATCH 07/18] - Add Page in welcome window - Update the sorting logic to allow page names to be sorted regardless of the numbers they contain. --- .../Resources/Pages/WelcomePage3.xaml.cs | 2 +- .../Resources/Pages/WelcomePage4.xaml.cs | 2 +- .../Resources/Pages/WelcomePage5.xaml.cs | 2 +- .../Resources/Pages/WelcomePageUserType.xaml | 116 ++++++++++++++++++ .../Pages/WelcomePageUserType.xaml.cs | 30 +++++ Flow.Launcher/ViewModel/WelcomeViewModel.cs | 68 +++++++--- Flow.Launcher/WelcomeWindow.xaml.cs | 55 +++++---- 7 files changed, 230 insertions(+), 45 deletions(-) create mode 100644 Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml create mode 100644 Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml.cs diff --git a/Flow.Launcher/Resources/Pages/WelcomePage3.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePage3.xaml.cs index f59b65c1c4c..57ec7d0bdc8 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePage3.xaml.cs +++ b/Flow.Launcher/Resources/Pages/WelcomePage3.xaml.cs @@ -12,7 +12,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e) Settings = Ioc.Default.GetRequiredService(); // Sometimes the navigation is not triggered by button click, // so we need to reset the page number - Ioc.Default.GetRequiredService().PageNum = 3; + Ioc.Default.GetRequiredService().PageNum = 4; InitializeComponent(); } diff --git a/Flow.Launcher/Resources/Pages/WelcomePage4.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePage4.xaml.cs index 4c83f3a83e0..5cedea6e3e3 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePage4.xaml.cs +++ b/Flow.Launcher/Resources/Pages/WelcomePage4.xaml.cs @@ -12,7 +12,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e) Settings = Ioc.Default.GetRequiredService(); // Sometimes the navigation is not triggered by button click, // so we need to reset the page number - Ioc.Default.GetRequiredService().PageNum = 4; + Ioc.Default.GetRequiredService().PageNum = 5; InitializeComponent(); } diff --git a/Flow.Launcher/Resources/Pages/WelcomePage5.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePage5.xaml.cs index 95d7ff1a0d2..baca1cd96d8 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePage5.xaml.cs +++ b/Flow.Launcher/Resources/Pages/WelcomePage5.xaml.cs @@ -19,7 +19,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e) Settings = Ioc.Default.GetRequiredService(); // Sometimes the navigation is not triggered by button click, // so we need to reset the page number - Ioc.Default.GetRequiredService().PageNum = 5; + Ioc.Default.GetRequiredService().PageNum = 6; InitializeComponent(); } diff --git a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml new file mode 100644 index 00000000000..aaba7c9d3c2 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml.cs new file mode 100644 index 00000000000..0ac08aaf468 --- /dev/null +++ b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml.cs @@ -0,0 +1,30 @@ +using Flow.Launcher.Helper; +using Flow.Launcher.Infrastructure.Hotkey; +using Flow.Launcher.Infrastructure.UserSettings; +using System.Windows.Navigation; +using CommunityToolkit.Mvvm.Input; +using Flow.Launcher.ViewModel; +using System.Windows.Media; +using CommunityToolkit.Mvvm.DependencyInjection; + +namespace Flow.Launcher.Resources.Pages; + +public partial class WelcomePageUserType +{ + public Settings Settings { get; set; } + + public WelcomePageUserType() + { + InitializeComponent(); + } + + protected override void OnNavigatedTo(NavigationEventArgs e) + { + Settings = Ioc.Default.GetRequiredService(); + // Sometimes the navigation is not triggered by button click, + // so we need to reset the page number + Ioc.Default.GetRequiredService().PageNum = 3; + InitializeComponent(); + } +} + diff --git a/Flow.Launcher/ViewModel/WelcomeViewModel.cs b/Flow.Launcher/ViewModel/WelcomeViewModel.cs index 5eecabfde85..45c6da53a63 100644 --- a/Flow.Launcher/ViewModel/WelcomeViewModel.cs +++ b/Flow.Launcher/ViewModel/WelcomeViewModel.cs @@ -1,12 +1,49 @@ -using Flow.Launcher.Plugin; +using System; +using Flow.Launcher.Plugin; namespace Flow.Launcher.ViewModel { + public enum WelcomePage + { + Intro = 1, // WelcomePage1 + Features = 2, // WelcomePage2 + UserType = 3, // WelcomePageUserType + Hotkeys = 4, // WelcomePage3 + Commands = 5, // WelcomePage4 + Finish = 6 // WelcomePage5 + } + public partial class WelcomeViewModel : BaseModel { - public const int MaxPageNum = 5; + public const int MaxPageNum = 6; + + public static readonly WelcomePage[] PageSequence = new[] + { + WelcomePage.Intro, + WelcomePage.Features, + WelcomePage.UserType, + WelcomePage.Hotkeys, + WelcomePage.Commands, + WelcomePage.Finish + }; - public string PageDisplay => $"{PageNum}/5"; + public string PageDisplay => $"{GetPageIndex(CurrentPage) + 1}/{PageSequence.Length}"; + + private WelcomePage _currentPage = WelcomePage.Intro; + public WelcomePage CurrentPage + { + get => _currentPage; + set + { + if (_currentPage != value) + { + _currentPage = value; + _pageNum = (int)value; + OnPropertyChanged(); + UpdateView(); + } + } + } private int _pageNum = 1; public int PageNum @@ -17,6 +54,7 @@ public int PageNum if (_pageNum != value) { _pageNum = value; + _currentPage = (WelcomePage)value; OnPropertyChanged(); UpdateView(); } @@ -45,24 +83,18 @@ public bool NextEnabled } } + private int GetPageIndex(WelcomePage page) + { + return Array.IndexOf(PageSequence, page); + } + private void UpdateView() { OnPropertyChanged(nameof(PageDisplay)); - if (PageNum == 1) - { - BackEnabled = false; - NextEnabled = true; - } - else if (PageNum == MaxPageNum) - { - BackEnabled = true; - NextEnabled = false; - } - else - { - BackEnabled = true; - NextEnabled = true; - } + + int index = GetPageIndex(CurrentPage); + BackEnabled = index > 0; + NextEnabled = index < PageSequence.Length - 1; } } } diff --git a/Flow.Launcher/WelcomeWindow.xaml.cs b/Flow.Launcher/WelcomeWindow.xaml.cs index 637f9448d9a..632c5cc3f3a 100644 --- a/Flow.Launcher/WelcomeWindow.xaml.cs +++ b/Flow.Launcher/WelcomeWindow.xaml.cs @@ -32,27 +32,26 @@ public WelcomeWindow() private void ForwardButton_Click(object sender, RoutedEventArgs e) { - if (_viewModel.PageNum < WelcomeViewModel.MaxPageNum) + int currentIndex = Array.IndexOf(WelcomeViewModel.PageSequence, _viewModel.CurrentPage); + if (currentIndex < WelcomeViewModel.PageSequence.Length - 1) { - _viewModel.PageNum++; - ContentFrame.Navigate(PageTypeSelector(_viewModel.PageNum), null, _forwardTransitionInfo); - } - else - { - _viewModel.NextEnabled = false; + WelcomePage nextPage = WelcomeViewModel.PageSequence[currentIndex + 1]; + + Type nextPageType = PageTypeSelector(nextPage); + ContentFrame.Navigate(nextPageType, null, _forwardTransitionInfo); + + _viewModel.CurrentPage = nextPage; } } - private void BackwardButton_Click(object sender, RoutedEventArgs e) { - if (_viewModel.PageNum > 1) - { - _viewModel.PageNum--; - ContentFrame.Navigate(PageTypeSelector(_viewModel.PageNum), null, _backTransitionInfo); - } - else + int currentIndex = Array.IndexOf(WelcomeViewModel.PageSequence, _viewModel.CurrentPage); + if (currentIndex > 0) { - _viewModel.BackEnabled = false; + WelcomePage prevPage = WelcomeViewModel.PageSequence[currentIndex - 1]; + Type prevPageType = PageTypeSelector(prevPage); + ContentFrame.Navigate(prevPageType, null, _backTransitionInfo); + _viewModel.CurrentPage = prevPage; } } @@ -61,17 +60,25 @@ private void BtnCancel_OnClick(object sender, RoutedEventArgs e) Close(); } - private static Type PageTypeSelector(int pageNumber) + private static Type PageTypeSelector(WelcomePage page) { - return pageNumber switch + Type result = page switch { - 1 => typeof(WelcomePage1), - 2 => typeof(WelcomePage2), - 3 => typeof(WelcomePage3), - 4 => typeof(WelcomePage4), - 5 => typeof(WelcomePage5), - _ => throw new ArgumentOutOfRangeException(nameof(pageNumber), pageNumber, "Unexpected Page Number") + WelcomePage.Intro => typeof(WelcomePage1), + WelcomePage.Features => typeof(WelcomePage2), + WelcomePage.UserType => typeof(WelcomePageUserType), + WelcomePage.Hotkeys => typeof(WelcomePage3), + WelcomePage.Commands => typeof(WelcomePage4), + WelcomePage.Finish => typeof(WelcomePage5), + _ => throw new ArgumentOutOfRangeException(nameof(page), page, "Unexpected page type") }; + return result; + } + + // This method is used to convert the page number to the corresponding page type. + private static Type PageTypeSelector(int pageNumber) + { + return PageTypeSelector((WelcomePage)pageNumber); } private void window_MouseDown(object sender, MouseButtonEventArgs e) /* for close hotkey popup */ @@ -91,7 +98,7 @@ private void OnActivated(object sender, EventArgs e) private void ContentFrame_Loaded(object sender, RoutedEventArgs e) { - ContentFrame.Navigate(PageTypeSelector(1)); /* Set First Page */ + ContentFrame.Navigate(PageTypeSelector(_viewModel.CurrentPage)); } private void Window_Closed(object sender, EventArgs e) From b83d9e491080edc8eb08f1f9b0ba121e6f088519 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 18 Apr 2025 09:48:41 +0900 Subject: [PATCH 08/18] Adjust Page Layout --- .../Resources/Pages/WelcomePageUserType.xaml | 121 +++++++++--------- 1 file changed, 58 insertions(+), 63 deletions(-) diff --git a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml index aaba7c9d3c2..013046fbaa7 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml +++ b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml @@ -7,8 +7,6 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ui="http://schemas.modernwpf.com/2019" Title="WelcomePageUserType" - Width="800" - Height="450" mc:Ignorable="d"> diff --git a/Flow.Launcher/Resources/Dark.xaml b/Flow.Launcher/Resources/Dark.xaml index 1ec01f8d143..ad0c4536e6d 100644 --- a/Flow.Launcher/Resources/Dark.xaml +++ b/Flow.Launcher/Resources/Dark.xaml @@ -65,6 +65,7 @@ + diff --git a/Flow.Launcher/Resources/Light.xaml b/Flow.Launcher/Resources/Light.xaml index 4d765d161fe..43d8f32384e 100644 --- a/Flow.Launcher/Resources/Light.xaml +++ b/Flow.Launcher/Resources/Light.xaml @@ -22,7 +22,7 @@ - + From 2880ceb852f97e830cc9577aa585c50fad3fb1fa Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 18 Apr 2025 19:06:53 +0900 Subject: [PATCH 10/18] Add radiobutton --- .../Resources/Pages/WelcomePageUserType.xaml | 227 ++++++++++-------- .../Pages/WelcomePageUserType.xaml.cs | 9 + 2 files changed, 141 insertions(+), 95 deletions(-) diff --git a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml index 013046fbaa7..ab09ed24637 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml +++ b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml @@ -7,105 +7,142 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ui="http://schemas.modernwpf.com/2019" Title="WelcomePageUserType" + Height="540" mc:Ignorable="d"> - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + diff --git a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml.cs index 0ac08aaf468..a019b2a3ee1 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml.cs +++ b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml.cs @@ -9,6 +9,14 @@ namespace Flow.Launcher.Resources.Pages; +public class RadioCardData +{ + public string Icon { get; set; } + public string Description1 { get; set; } + public string Bullet1 { get; set; } + public string Bullet2 { get; set; } + +} public partial class WelcomePageUserType { public Settings Settings { get; set; } @@ -26,5 +34,6 @@ protected override void OnNavigatedTo(NavigationEventArgs e) Ioc.Default.GetRequiredService().PageNum = 3; InitializeComponent(); } + } From 230e90064e473916cc37e5a6299c053abb6290f9 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 18 Apr 2025 19:50:06 +0900 Subject: [PATCH 11/18] Adjust Style and Add Converter for bullet --- .../Converters/NullToVisibilityConverter.cs | 20 ++++ Flow.Launcher/Resources/Dark.xaml | 5 + Flow.Launcher/Resources/Light.xaml | 7 +- .../Resources/Pages/WelcomePageUserType.xaml | 98 ++++++++++++++----- .../Pages/WelcomePageUserType.xaml.cs | 2 +- 5 files changed, 102 insertions(+), 30 deletions(-) create mode 100644 Flow.Launcher/Converters/NullToVisibilityConverter.cs diff --git a/Flow.Launcher/Converters/NullToVisibilityConverter.cs b/Flow.Launcher/Converters/NullToVisibilityConverter.cs new file mode 100644 index 00000000000..11e3c4cd705 --- /dev/null +++ b/Flow.Launcher/Converters/NullToVisibilityConverter.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; +using System.Windows; + +namespace Flow.Launcher.Converters +{ + public class NullToVisibilityConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + => string.IsNullOrWhiteSpace(value?.ToString()) ? Visibility.Collapsed : Visibility.Visible; + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + => throw new NotImplementedException(); + } +} diff --git a/Flow.Launcher/Resources/Dark.xaml b/Flow.Launcher/Resources/Dark.xaml index ad0c4536e6d..3bc00c89792 100644 --- a/Flow.Launcher/Resources/Dark.xaml +++ b/Flow.Launcher/Resources/Dark.xaml @@ -110,6 +110,11 @@ #ffffff #272727 + + + + + diff --git a/Flow.Launcher/Resources/Light.xaml b/Flow.Launcher/Resources/Light.xaml index 43d8f32384e..883361d94e0 100644 --- a/Flow.Launcher/Resources/Light.xaml +++ b/Flow.Launcher/Resources/Light.xaml @@ -102,8 +102,11 @@ #f6f6f6 - - + + + + + diff --git a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml index ab09ed24637..855bfd223eb 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml +++ b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml @@ -2,6 +2,7 @@ x:Class="Flow.Launcher.Resources.Pages.WelcomePageUserType" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:converters="clr-namespace:Flow.Launcher.Converters" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" @@ -9,7 +10,20 @@ Title="WelcomePageUserType" Height="540" mc:Ignorable="d"> + + + + + + + + - + + diff --git a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml.cs b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml.cs index a019b2a3ee1..50009b732b2 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml.cs +++ b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml.cs @@ -15,7 +15,7 @@ public class RadioCardData public string Description1 { get; set; } public string Bullet1 { get; set; } public string Bullet2 { get; set; } - + public string Bullet3 { get; set; } } public partial class WelcomePageUserType { From 2e6728f766468fa27771d99f75f0560cf16d21ce Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 19 Apr 2025 08:00:21 +0900 Subject: [PATCH 12/18] Adjust UI color --- Flow.Launcher/Resources/Dark.xaml | 5 +++-- Flow.Launcher/Resources/Light.xaml | 1 + .../Resources/Pages/WelcomePageUserType.xaml | 19 +++++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Flow.Launcher/Resources/Dark.xaml b/Flow.Launcher/Resources/Dark.xaml index 3bc00c89792..b1f23c4b426 100644 --- a/Flow.Launcher/Resources/Dark.xaml +++ b/Flow.Launcher/Resources/Dark.xaml @@ -112,9 +112,10 @@ - + - + + diff --git a/Flow.Launcher/Resources/Light.xaml b/Flow.Launcher/Resources/Light.xaml index 883361d94e0..59541c51d4b 100644 --- a/Flow.Launcher/Resources/Light.xaml +++ b/Flow.Launcher/Resources/Light.xaml @@ -107,6 +107,7 @@ + diff --git a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml index 855bfd223eb..6de35038cb4 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml +++ b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml @@ -19,7 +19,7 @@ - + @@ -61,7 +61,6 @@ x:Name="Desc" Margin="0 8 0 0" FontSize="14" - Foreground="{DynamicResource Color05B}" Text="{Binding Tag.Description1, RelativeSource={RelativeSource TemplatedParent}}" TextWrapping="Wrap" /> @@ -71,6 +70,7 @@ - - + + + - + + + + + - + From 6fa5075a46b0cac5620c064836e605190e6ee20c Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 19 Apr 2025 08:04:58 +0900 Subject: [PATCH 13/18] Rollback UseLcationAsWorkingDir to false from true --- Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index 94e66c15323..3d30bcf29e5 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -28,7 +28,7 @@ public class Settings public string ExcludedFileTypes { get; set; } = ""; - public bool UseLocationAsWorkingDir { get; set; } = true; + public bool UseLocationAsWorkingDir { get; set; } = false; public bool ShowInlinedWindowsContextMenu { get; set; } = false; From 749d68de7c1efe7aff6640d28a101c6a1f21e686 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 19 Apr 2025 08:08:38 +0900 Subject: [PATCH 14/18] Remove Hotkey Infobar String --- Flow.Launcher/Languages/en.xaml | 4 ---- .../SettingPages/Views/SettingsPaneHotkey.xaml | 18 +----------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index a2331ec8fbd..b40eba76397 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -308,10 +308,6 @@ Show badges for query results where supported Show Result Badges for Global Query Only Show badges for global query results only - Opening a folder using the Enter key - If you turn off "Hit Enter to open folder in Default File Manager" in the Explorer plugin, you'll be able to explore the contents of the folder instead of opening it in your file manager. - Auto-complete & Delete Path - Try using Auto Complete and the Delete Word Backwards shortcut when switching directories. HTTP Proxy diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml index 9c0341d6d32..ddd2ba328e3 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml @@ -66,17 +66,9 @@ OnContent="{DynamicResource enable}" /> - @@ -211,14 +203,6 @@ - Date: Sat, 19 Apr 2025 08:14:28 +0900 Subject: [PATCH 15/18] Fix Start Page --- Flow.Launcher/WelcomeWindow.xaml.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/WelcomeWindow.xaml.cs b/Flow.Launcher/WelcomeWindow.xaml.cs index 632c5cc3f3a..b6054cfdad7 100644 --- a/Flow.Launcher/WelcomeWindow.xaml.cs +++ b/Flow.Launcher/WelcomeWindow.xaml.cs @@ -98,7 +98,7 @@ private void OnActivated(object sender, EventArgs e) private void ContentFrame_Loaded(object sender, RoutedEventArgs e) { - ContentFrame.Navigate(PageTypeSelector(_viewModel.CurrentPage)); + ContentFrame.Navigate(PageTypeSelector(WelcomePage.Intro)); /* Set First Page */ } private void Window_Closed(object sender, EventArgs e) From a6ef43fe2371cf0432ae2f241a5b5c3221ca2952 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 19 Apr 2025 08:30:41 +0900 Subject: [PATCH 16/18] Adjust strings --- Flow.Launcher/Languages/en.xaml | 16 +++++++++++-- .../Resources/Pages/WelcomePageUserType.xaml | 24 +++++++++---------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index b40eba76397..6eeae3c6ae3 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -44,7 +44,7 @@ Game Mode Suspend the use of Hotkeys. Position Reset - Reset search window position + Reset search window location Type here to search @@ -58,7 +58,7 @@ Error setting launch on startup Hide Flow Launcher when focus is lost Do not show new version notifications - Search Window Position + Search Window Location Remember Last Position Monitor with Mouse Cursor Monitor with Focused Window @@ -490,6 +490,18 @@ Let's Start Flow Launcher Finished. Enjoy Flow Launcher. Don't forget the hotkey to start :) + Pick your style + Based on your selected style, Flow will customize the initial settings for you. This setting can be changed later. + CLI Friendly + Recommended for users familiar with the CLI or Terminal environment. + TAB is used as the key to Auto Complete. + Pressing Enter will open the path in Flow. + Windows Friendly + Recommended for users familiar with the Windows operating style. + TAB is used as the key to switch between selectable options. + Auto Complete will be ALT+RIGHT. + Pressing Enter will open the folder. + Back / Context Menu diff --git a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml index 6de35038cb4..cb1bdc490af 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml +++ b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml @@ -37,7 +37,6 @@ CornerRadius="5"> - - + Text="{DynamicResource Welcome_Page_UserType_Title}" /> @@ -165,15 +163,15 @@ @@ -181,15 +179,15 @@ From 4e424ef4e30e73ab12936cf59cac4dfe81a247a9 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 19 Apr 2025 08:35:22 +0900 Subject: [PATCH 17/18] Code Clean Up --- Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml index cb1bdc490af..1ba1b28d1a8 100644 --- a/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml +++ b/Flow.Launcher/Resources/Pages/WelcomePageUserType.xaml @@ -12,7 +12,6 @@ mc:Ignorable="d"> -