Skip to content

Commit 5164c18

Browse files
authored
Merge branch 'dev' into QuickSizeAdjust
2 parents 7839f0a + caa2c75 commit 5164c18

File tree

11 files changed

+373
-60
lines changed

11 files changed

+373
-60
lines changed

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "nuget" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
12+
ignore:
13+
- dependency-name: "squirrel-windows"
14+
reviewers:
15+
- "jjw24"
16+
- "taooceros"
17+
- "JohnTheGr8"

Flow.Launcher.Core/Flow.Launcher.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
<ItemGroup>
5656
<PackageReference Include="Droplex" Version="1.4.1" />
57-
<PackageReference Include="FSharp.Core" Version="5.0.2" />
57+
<PackageReference Include="FSharp.Core" Version="6.0.6" />
5858
<PackageReference Include="Microsoft.IO.RecyclableMemoryStream" Version="2.1.3" />
5959
<PackageReference Include="squirrel.windows" Version="1.5.2" NoWarn="NU1701" />
6060
</ItemGroup>

Flow.Launcher.Core/Updater.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ public string NewVersinoTips(string version)
141141
{
142142
var translater = InternationalizationManager.Instance;
143143
var tips = string.Format(translater.GetTranslation("newVersionTips"), version);
144+
144145
return tips;
145146
}
146147

Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<PrivateAssets>all</PrivateAssets>
5454
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
5555
</PackageReference>
56-
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="16.10.56" />
56+
<PackageReference Include="Microsoft.VisualStudio.Threading" Version="17.3.44" />
5757
<PackageReference Include="NLog" Version="4.7.10" />
5858
<PackageReference Include="NLog.Schema" Version="4.7.10" />
5959
<PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" />

Flow.Launcher.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
2-
# Visual Studio Version 16
3-
VisualStudioVersion = 16.0.29806.167
2+
# Visual Studio Version 17
3+
VisualStudioVersion = 17.3.32901.215
44
MinimumVisualStudioVersion = 10.0.40219.1
55
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Flow.Launcher.Test", "Flow.Launcher.Test\Flow.Launcher.Test.csproj", "{FF742965-9A80-41A5-B042-D6C7D3A21708}"
66
ProjectSection(ProjectDependencies) = postProject

Flow.Launcher/Languages/en.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
<system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String>
6262

6363
<!-- Setting Plugin -->
64+
<system:String x:Key="searchplugin">Search Plugin</system:String>
65+
<system:String x:Key="searchpluginToolTip">Ctrl+F to search plugins</system:String>
66+
<system:String x:Key="searchplugin_Noresult_Title">No results found</system:String>
67+
<system:String x:Key="searchplugin_Noresult_Subtitle">Please try a different search.</system:String>
6468
<system:String x:Key="plugin">Plugin</system:String>
6569
<system:String x:Key="browserMorePlugins">Find more plugins</system:String>
6670
<system:String x:Key="enable">On</system:String>

Flow.Launcher/SettingWindow.xaml

Lines changed: 244 additions & 49 deletions
Large diffs are not rendered by default.

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 78 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
using System.Linq;
1818
using System.Windows;
1919
using System.Windows.Controls;
20+
using System.Windows.Data;
2021
using System.Windows.Forms;
2122
using System.Windows.Input;
2223
using System.Windows.Interop;
@@ -25,6 +26,7 @@
2526
using Button = System.Windows.Controls.Button;
2627
using Control = System.Windows.Controls.Control;
2728
using ListViewItem = System.Windows.Controls.ListViewItem;
29+
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
2830
using MessageBox = System.Windows.MessageBox;
2931
using TextBox = System.Windows.Controls.TextBox;
3032
using ThemeManager = ModernWpf.ThemeManager;
@@ -57,6 +59,13 @@ private void OnLoaded(object sender, RoutedEventArgs e)
5759
HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource;
5860
HwndTarget hwndTarget = hwndSource.CompositionTarget;
5961
hwndTarget.RenderMode = RenderMode.SoftwareOnly;
62+
63+
pluginListView = (CollectionView)CollectionViewSource.GetDefaultView(Plugins.ItemsSource);
64+
pluginListView.Filter = PluginListFilter;
65+
66+
pluginStoreView = (CollectionView)CollectionViewSource.GetDefaultView(StoreListBox.ItemsSource);
67+
pluginStoreView.Filter = PluginStoreFilter;
68+
6069
InitializePosition();
6170
}
6271

@@ -163,7 +172,7 @@ private void OnnEditCustomHotkeyClick(object sender, RoutedEventArgs e)
163172
}
164173
}
165174

166-
private void OnAddCustomeHotkeyClick(object sender, RoutedEventArgs e)
175+
private void OnAddCustomHotkeyClick(object sender, RoutedEventArgs e)
167176
{
168177
new CustomQueryHotkeySetting(this, settings).ShowDialog();
169178
}
@@ -361,13 +370,77 @@ private void Window_StateChanged(object sender, EventArgs e)
361370
RefreshMaximizeRestoreButton();
362371
}
363372

364-
private void SelectedPluginChanged(object sender, SelectionChangedEventArgs e)
373+
private CollectionView pluginListView;
374+
private CollectionView pluginStoreView;
375+
376+
private bool PluginListFilter(object item)
377+
{
378+
if (string.IsNullOrEmpty(pluginFilterTxb.Text))
379+
return true;
380+
if (item is PluginViewModel model)
381+
{
382+
return StringMatcher.FuzzySearch(pluginFilterTxb.Text, model.PluginPair.Metadata.Name).IsSearchPrecisionScoreMet();
383+
}
384+
return false;
385+
}
386+
387+
private bool PluginStoreFilter(object item)
388+
{
389+
if (string.IsNullOrEmpty(pluginStoreFilterTxb.Text))
390+
return true;
391+
if (item is UserPlugin model)
392+
{
393+
return StringMatcher.FuzzySearch(pluginStoreFilterTxb.Text, model.Name).IsSearchPrecisionScoreMet()
394+
|| StringMatcher.FuzzySearch(pluginStoreFilterTxb.Text, model.Description).IsSearchPrecisionScoreMet();
395+
}
396+
return false;
397+
}
398+
399+
private string lastPluginListSearch = "";
400+
private string lastPluginStoreSearch = "";
401+
402+
private void RefreshPluginListEventHandler(object sender, RoutedEventArgs e)
403+
{
404+
if (pluginFilterTxb.Text != lastPluginListSearch)
405+
{
406+
lastPluginListSearch = pluginFilterTxb.Text;
407+
pluginListView.Refresh();
408+
}
409+
}
410+
411+
private void RefreshPluginStoreEventHandler(object sender, RoutedEventArgs e)
365412
{
366-
Plugins.ScrollIntoView(Plugins.SelectedItem);
413+
if (pluginStoreFilterTxb.Text != lastPluginStoreSearch)
414+
{
415+
lastPluginStoreSearch = pluginStoreFilterTxb.Text;
416+
pluginStoreView.Refresh();
417+
}
367418
}
368-
private void ItemSizeChanged(object sender, SizeChangedEventArgs e)
419+
420+
private void PluginFilterTxb_OnKeyDown(object sender, KeyEventArgs e)
421+
{
422+
if (e.Key == Key.Enter)
423+
RefreshPluginListEventHandler(sender, e);
424+
}
425+
426+
private void PluginStoreFilterTxb_OnKeyDown(object sender, KeyEventArgs e)
369427
{
370-
Plugins.ScrollIntoView(Plugins.SelectedItem);
428+
if (e.Key == Key.Enter)
429+
RefreshPluginStoreEventHandler(sender, e);
430+
}
431+
432+
private void OnPluginSettingKeydown(object sender, KeyEventArgs e)
433+
{
434+
if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control && e.Key == Key.F)
435+
pluginFilterTxb.Focus();
436+
}
437+
438+
private void PluginStore_OnKeyDown(object sender, KeyEventArgs e)
439+
{
440+
if (e.Key == Key.F && (Keyboard.Modifiers & ModifierKeys.Control) != 0)
441+
{
442+
pluginStoreFilterTxb.Focus();
443+
}
371444
}
372445

373446
public void InitializePosition()

Flow.Launcher/ViewModel/PluginViewModel.cs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Windows;
1+
using System.Windows;
22
using System.Windows.Media;
33
using Flow.Launcher.Plugin;
44
using Flow.Launcher.Infrastructure.Image;
@@ -30,9 +30,26 @@ public bool PluginState
3030
get => !PluginPair.Metadata.Disabled;
3131
set => PluginPair.Metadata.Disabled = !value;
3232
}
33+
public bool IsExpanded
34+
{
35+
get => _isExpanded;
36+
set
37+
{
38+
_isExpanded = value;
39+
OnPropertyChanged();
40+
OnPropertyChanged(nameof(SettingControl));
41+
}
42+
}
3343

3444
private Control _settingControl;
35-
public Control SettingControl => _settingControl ??= PluginPair.Plugin is not ISettingProvider settingProvider ? new Control() : settingProvider.CreateSettingPanel();
45+
private bool _isExpanded;
46+
public Control SettingControl
47+
=> IsExpanded
48+
? _settingControl
49+
??= PluginPair.Plugin is not ISettingProvider settingProvider
50+
? new Control()
51+
: settingProvider.CreateSettingPanel()
52+
: null;
3653

3754
public Visibility ActionKeywordsVisibility => PluginPair.Metadata.ActionKeywords.Count == 1 ? Visibility.Visible : Visibility.Collapsed;
3855
public string InitilizaTime => PluginPair.Metadata.InitTime + "ms";
2.09 KB
Loading

0 commit comments

Comments
 (0)