Skip to content

Add user style selection page with CLI/GUI modes and Delete Word Backwards #3462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ 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 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";
Expand Down Expand Up @@ -364,6 +366,10 @@ public List<RegisteredHotkeyData> 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))
Expand Down
20 changes: 20 additions & 0 deletions Flow.Launcher/Converters/NullToVisibilityConverter.cs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For bullet hiding.

Original file line number Diff line number Diff line change
@@ -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();
}
}
10 changes: 10 additions & 0 deletions Flow.Launcher/HotkeyControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ public enum HotkeyType
SelectNextPageHotkey,
AutoCompleteHotkey,
AutoCompleteHotkey2,
DeleteWordHotkey,
DeleteWordHotkey2,
SelectPrevItemHotkey,
SelectPrevItemHotkey2,
SelectNextItemHotkey,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down
18 changes: 16 additions & 2 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<system:String x:Key="GameMode">Game Mode</system:String>
<system:String x:Key="GameModeToolTip">Suspend the use of Hotkeys.</system:String>
<system:String x:Key="PositionReset">Position Reset</system:String>
<system:String x:Key="PositionResetToolTip">Reset search window position</system:String>
<system:String x:Key="PositionResetToolTip">Reset search window location</system:String>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small Fix. requested by CitizenDee

<system:String x:Key="queryTextBoxPlaceholder">Type here to search</system:String>

<!-- Setting General -->
Expand All @@ -58,7 +58,7 @@
<system:String x:Key="setAutoStartFailed">Error setting launch on startup</system:String>
<system:String x:Key="hideFlowLauncherWhenLoseFocus">Hide Flow Launcher when focus is lost</system:String>
<system:String x:Key="dontPromptUpdateMsg">Do not show new version notifications</system:String>
<system:String x:Key="SearchWindowPosition">Search Window Position</system:String>
<system:String x:Key="SearchWindowPosition">Search Window Location</system:String>
<system:String x:Key="SearchWindowScreenRememberLastLaunchLocation">Remember Last Position</system:String>
<system:String x:Key="SearchWindowScreenCursor">Monitor with Mouse Cursor</system:String>
<system:String x:Key="SearchWindowScreenFocus">Monitor with Focused Window</system:String>
Expand Down Expand Up @@ -259,6 +259,8 @@
<system:String x:Key="showOpenResultHotkeyToolTip">Show result selection hotkey with results.</system:String>
<system:String x:Key="autoCompleteHotkey">Auto Complete</system:String>
<system:String x:Key="autoCompleteHotkeyToolTip">Runs autocomplete for the selected items.</system:String>
<system:String x:Key="DeleteWordHotkey">Delete Word Backwards</system:String>
<system:String x:Key="DeleteWordHotkeyToolTip">Deletes text by word. For paths, deletes by path segment.</system:String>
<system:String x:Key="SelectNextItemHotkey">Select Next Item</system:String>
<system:String x:Key="SelectPrevItemHotkey">Select Previous Item</system:String>
<system:String x:Key="SelectNextPageHotkey">Next Page</system:String>
Expand Down Expand Up @@ -488,6 +490,18 @@
<system:String x:Key="Welcome_Page5_Title">Let's Start Flow Launcher</system:String>
<system:String x:Key="Welcome_Page5_Text01">Finished. Enjoy Flow Launcher. Don't forget the hotkey to start :)</system:String>

<system:String x:Key="Welcome_Page_UserType_Title">Pick your style</system:String>
<system:String x:Key="Welcome_Page_UserType_Desc">Based on your selected style, Flow will customize the initial settings for you. This setting can be changed later.</system:String>
<system:String x:Key="Welcome_Page_UserType_CLI_Title">CLI Friendly</system:String>
<system:String x:Key="Welcome_Page_UserType_CLI_Desc">Recommended for users familiar with the CLI or Terminal environment.</system:String>
<system:String x:Key="Welcome_Page_UserType_CLI_Sub1">TAB is used as the key to Auto Complete.</system:String>
<system:String x:Key="Welcome_Page_UserType_CLI_Sub2">Pressing Enter will open the path in Flow.</system:String>
<system:String x:Key="Welcome_Page_UserType_GUI_Title">Windows Friendly</system:String>
<system:String x:Key="Welcome_Page_UserType_GUI_Desc">Recommended for users familiar with the Windows operating style.</system:String>
<system:String x:Key="Welcome_Page_UserType_GUI_Sub1">TAB is used as the key to switch between selectable options.</system:String>
<system:String x:Key="Welcome_Page_UserType_GUI_Sub2">Auto Complete will be ALT+RIGHT.</system:String>
<system:String x:Key="Welcome_Page_UserType_GUI_Sub3">Pressing Enter will open the folder.</system:String>

<!-- General Guide & Hotkey -->

<system:String x:Key="HotkeyUpDownDesc">Back / Context Menu</system:String>
Expand Down
8 changes: 8 additions & 0 deletions Flow.Launcher/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@
Key="{Binding AutoCompleteHotkey2, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}"
Command="{Binding AutocompleteQueryCommand}"
Modifiers="{Binding AutoCompleteHotkey2, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" />
<KeyBinding
Key="{Binding DeleteWordHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}"
Command="{Binding DeleteWordCommand}"
Modifiers="{Binding DeleteWordHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" />
<KeyBinding
Key="{Binding DeleteWordHotkey2, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}"
Command="{Binding DeleteWordCommand}"
Modifiers="{Binding DeleteWordHotkey2, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" />
<KeyBinding
Key="{Binding SelectNextItemHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}"
Command="{Binding SelectNextItemCommand}"
Expand Down Expand Up @@ -420,7 +428,7 @@
<ContentControl>
<flowlauncher:ResultListBox
x:Name="ContextMenu"
DataContext="{Binding ContextMenu}"

Check warning on line 431 in Flow.Launcher/MainWindow.xaml

View workflow job for this annotation

GitHub Actions / build

'MainWindow.ContextMenu' hides inherited member 'FrameworkElement.ContextMenu'. Use the new keyword if hiding was intended.
LeftClickResultCommand="{Binding LeftClickResultCommand}"
RightClickResultCommand="{Binding RightClickResultCommand}" />
</ContentControl>
Expand Down
12 changes: 6 additions & 6 deletions Flow.Launcher/Resources/Controls/HotkeyDisplay.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
<Border.Style>
<Style TargetType="{x:Type Border}">
<Setter Property="Background" Value="{DynamicResource Color12B}" />
<Setter Property="Padding" Value="5,0,5,0" />
<Setter Property="Padding" Value="5 0 5 0" />
<Setter Property="BorderThickness" Value="1" />
<Style.Triggers>
<DataTrigger Binding="{Binding Type, RelativeSource={RelativeSource AncestorType=local:HotkeyDisplay}}" Value="Small">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Padding" Value="0,0,0,0" />
<Setter Property="Padding" Value="0 0 0 0" />
<Setter Property="BorderThickness" Value="0" />
</DataTrigger>
</Style.Triggers>
Expand All @@ -51,14 +51,14 @@
<Border.Style>
<Style TargetType="{x:Type Border}">
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundBaseLowBrush}" />
<Setter Property="Padding" Value="10,5,10,5" />
<Setter Property="Margin" Value="2,5,2,5" />
<Setter Property="Padding" Value="10 5 10 5" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor fix: Corrected vertical alignment

<Setter Property="Margin" Value="2 5 2 5" />
<Setter Property="BorderThickness" Value="1" />
<Style.Triggers>
<DataTrigger Binding="{Binding Type, RelativeSource={RelativeSource AncestorType=local:HotkeyDisplay}}" Value="Small">
<Setter Property="Background" Value="{DynamicResource AccentButtonBackground}" />
<Setter Property="Padding" Value="10,5,10,5" />
<Setter Property="Margin" Value="2,0,2,0" />
<Setter Property="Padding" Value="10 4 10 6" />
<Setter Property="Margin" Value="2 0 2 0" />
</DataTrigger>
</Style.Triggers>
</Style>
Expand Down
7 changes: 7 additions & 0 deletions Flow.Launcher/Resources/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<SolidColorBrush x:Key="ThemeHoverButton" Color="#3c3c3c" />
<SolidColorBrush x:Key="PopuBGColor" Color="#202020" />
<SolidColorBrush x:Key="PopupBGColor" Color="#202020" />
<SolidColorBrush x:Key="WelcomePopupBGColor" Color="#202020" />
<SolidColorBrush x:Key="PopupTextColor" Color="#cfcfcf" />
<SolidColorBrush x:Key="PopupButtonAreaBGColor" Color="#2b2b2b" />
<SolidColorBrush x:Key="PopupButtonAreaBorderColor" Color="#3f3f3f" />
Expand Down Expand Up @@ -109,6 +110,12 @@
<Color x:Key="NumberBoxColor26">#ffffff</Color>
<Color x:Key="HoverStoreGrid">#272727</Color>

<!-- Resources for RadioCard -->
<SolidColorBrush x:Key="RadioButtonCardBorder" Color="#363636" />
<SolidColorBrush x:Key="RadioButtonCardBackground" Color="#373737" />
<SolidColorBrush x:Key="RadioButtonCardBorderHover" Color="#363636" />
<SolidColorBrush x:Key="RadioButtonCardBackgroundHover" Color="#3c3c3c" />
<SolidColorBrush x:Key="RadioButtonCardTextSelected" Color="#2b2b2b" />
<!-- Resources for HotkeyControl -->
<SolidColorBrush x:Key="CustomHotkeyHover" Color="#323232" />
<!-- Resources for Expander -->
Expand Down
10 changes: 7 additions & 3 deletions Flow.Launcher/Resources/Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<SolidColorBrush x:Key="BasicSystemAccentColor" Color="{m:DynamicColor SystemAccentColor}" />

<SolidColorBrush x:Key="Color00B" Color="#CEFAFAFA" />
<SolidColorBrush x:Key="Color00B" Color="#fbfbfb" />
<SolidColorBrush x:Key="Color01B" Color="#f3f3f3" />
<SolidColorBrush x:Key="Color02B" Color="#ffffff" />
<SolidColorBrush x:Key="Color03B" Color="#e5e5e5" />
Expand Down Expand Up @@ -102,8 +102,12 @@
<SolidColorBrush x:Key="NumberBoxPlaceHolder" Color="#A2A2A2" />
<Color x:Key="HoverStoreGrid">#f6f6f6</Color>



<!-- Resources for RadioCard -->
<SolidColorBrush x:Key="RadioButtonCardBorder" Color="#e5e5e5" />
<SolidColorBrush x:Key="RadioButtonCardBackground" Color="#f3f3f3" />
<SolidColorBrush x:Key="RadioButtonCardBorderHover" Color="#DBDBDB" />
<SolidColorBrush x:Key="RadioButtonCardBackgroundHover" Color="#ECECEC" />
<SolidColorBrush x:Key="RadioButtonCardTextSelected" Color="#ffffff" />
<!-- Resources for HotkeyControl -->
<SolidColorBrush x:Key="CustomHotkeyHover" Color="#f6f6f6" />
<!-- Resources for Expander -->
Expand Down
2 changes: 1 addition & 1 deletion Flow.Launcher/Resources/Pages/WelcomePage3.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
Settings = Ioc.Default.GetRequiredService<Settings>();
// Sometimes the navigation is not triggered by button click,
// so we need to reset the page number
Ioc.Default.GetRequiredService<WelcomeViewModel>().PageNum = 3;
Ioc.Default.GetRequiredService<WelcomeViewModel>().PageNum = 4;
InitializeComponent();
}

Expand Down
2 changes: 1 addition & 1 deletion Flow.Launcher/Resources/Pages/WelcomePage4.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
Settings = Ioc.Default.GetRequiredService<Settings>();
// Sometimes the navigation is not triggered by button click,
// so we need to reset the page number
Ioc.Default.GetRequiredService<WelcomeViewModel>().PageNum = 4;
Ioc.Default.GetRequiredService<WelcomeViewModel>().PageNum = 5;
InitializeComponent();
}

Expand Down
2 changes: 1 addition & 1 deletion Flow.Launcher/Resources/Pages/WelcomePage5.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
Settings = Ioc.Default.GetRequiredService<Settings>();
// Sometimes the navigation is not triggered by button click,
// so we need to reset the page number
Ioc.Default.GetRequiredService<WelcomeViewModel>().PageNum = 5;
Ioc.Default.GetRequiredService<WelcomeViewModel>().PageNum = 6;
InitializeComponent();
}

Expand Down
Loading
Loading