From 007a3ea3cda76e869eff9900118849b7b79a1d80 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 17 Dec 2021 06:23:19 -0500 Subject: [PATCH 1/6] Trigger on plugin --- Flow.Launcher/ViewModel/MainViewModel.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index abf3a1d14..605330d13 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -395,6 +395,8 @@ namespace Flow.Launcher.ViewModel public double MainWindowWidth => _settings.WindowSize; + public string PluginIconPath { get; set; } = null; + public ICommand EscCommand { get; set; } public ICommand SelectNextItemCommand { get; set; } public ICommand SelectPrevItemCommand { get; set; } @@ -556,6 +558,11 @@ namespace Flow.Launcher.ViewModel var plugins = PluginManager.ValidPluginsForQuery(query); + if (plugins.Count == 1) + { + PluginIconPath = plugins.Single().Metadata.IcoPath; + } + if (query.ActionKeyword == Plugin.Query.GlobalPluginWildcardSign) { // Wait 45 millisecond for query change in global query From 2c73a5b9c05a7b6b3ab4fe8675abfa13c415eb33 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 17 Dec 2021 06:29:08 -0500 Subject: [PATCH 2/6] return null if not a plugin activated --- Flow.Launcher/ViewModel/MainViewModel.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 605330d13..fee8b7280 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -558,10 +558,9 @@ namespace Flow.Launcher.ViewModel var plugins = PluginManager.ValidPluginsForQuery(query); - if (plugins.Count == 1) - { - PluginIconPath = plugins.Single().Metadata.IcoPath; - } + + PluginIconPath = plugins.Count == 1 ? plugins.Single().Metadata.IcoPath : PluginIconPath = null; + if (query.ActionKeyword == Plugin.Query.GlobalPluginWildcardSign) { From 82419508c8423a5009f19a8a5ed8b0f6e6ea1009 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 17 Dec 2021 06:33:26 -0500 Subject: [PATCH 3/6] Clear icon on empty query --- Flow.Launcher/ViewModel/MainViewModel.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index fee8b7280..228912829 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -530,6 +530,7 @@ namespace Flow.Launcher.ViewModel { Results.Clear(); Results.Visbility = Visibility.Collapsed; + PluginIconPath = null; return; } From 861e5cb5c967484b5f266f06ec3ec42cb3644d28 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 17 Dec 2021 07:48:29 -0500 Subject: [PATCH 4/6] Hide SearchIcon if plugin activated --- Flow.Launcher/MainWindow.xaml | 3 ++- Flow.Launcher/ViewModel/MainViewModel.cs | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 129ceeea5..b27a1b67a 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -197,7 +197,8 @@ Margin="0" Data="{DynamicResource SearchIconImg}" Stretch="Fill" - Style="{DynamicResource SearchIconStyle}" /> + Style="{DynamicResource SearchIconStyle}" + Visibility="{Binding SearchIconVisibility}" /> diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 228912829..bb8fdc0ea 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -393,6 +393,8 @@ namespace Flow.Launcher.ViewModel // because it is more accurate and reliable representation than using Visibility as a condition check public bool MainWindowVisibilityStatus { get; set; } = true; + public Visibility SearchIconVisibility { get; set; } + public double MainWindowWidth => _settings.WindowSize; public string PluginIconPath { get; set; } = null; @@ -531,6 +533,7 @@ namespace Flow.Launcher.ViewModel Results.Clear(); Results.Visbility = Visibility.Collapsed; PluginIconPath = null; + SearchIconVisibility = Visibility.Visible; return; } @@ -559,9 +562,17 @@ namespace Flow.Launcher.ViewModel var plugins = PluginManager.ValidPluginsForQuery(query); - - PluginIconPath = plugins.Count == 1 ? plugins.Single().Metadata.IcoPath : PluginIconPath = null; - + if (plugins.Count == 1) + { + PluginIconPath = plugins.Single().Metadata.IcoPath; + SearchIconVisibility = Visibility.Hidden; + } + else + { + PluginIconPath = null; + SearchIconVisibility = Visibility.Visible; + } + if (query.ActionKeyword == Plugin.Query.GlobalPluginWildcardSign) { From 442726062728ce4c4500657a26114f43634caa27 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 17 Dec 2021 21:52:51 +0900 Subject: [PATCH 5/6] Add PluginActivationIcon --- Flow.Launcher/MainWindow.xaml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index b27a1b67a..d6f3af82c 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -41,9 +41,7 @@ - + + Date: Fri, 17 Dec 2021 22:05:46 +0900 Subject: [PATCH 6/6] Fix Image Render --- Flow.Launcher/MainWindow.xaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index d6f3af82c..3a76cca57 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -198,6 +198,7 @@ HorizontalAlignment="Center" VerticalAlignment="Center" Panel.ZIndex="2" + RenderOptions.BitmapScalingMode="HighQuality" Source="{Binding PluginIconPath}" Stretch="Uniform" Style="{DynamicResource PluginActivationIcon}" />