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 14 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
6 changes: 6 additions & 0 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
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 @@ -306,6 +308,10 @@
<system:String x:Key="showBadgesToolTip">Show badges for query results where supported</system:String>
<system:String x:Key="showBadgesGlobalOnly">Show Result Badges for Global Query Only</system:String>
<system:String x:Key="showBadgesGlobalOnlyToolTip">Show badges for global query results only</system:String>
<system:String x:Key="enterKeyInfoTitle">Opening a folder using the Enter key</system:String>
<system:String x:Key="enterKeyInfoToolTip">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.</system:String>
<system:String x:Key="pathControlInfoTitle">Auto-complete &amp; Delete Path</system:String>
<system:String x:Key="pathControlInfoToolTip">Try using Auto Complete and the Delete Word Backwards shortcut when switching directories.</system:String>

<!-- Setting Proxy -->
<system:String x:Key="proxy">HTTP Proxy</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
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