From 15e34e08c6f3c6df4334f2e4331bfba4afe77f04 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 2 Sep 2022 12:33:32 +0900 Subject: [PATCH 01/73] - Layout Adjust --- Flow.Launcher/MainWindow.xaml | 98 +++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 39 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 714fcc53f..8743bde2f 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -233,11 +233,11 @@ - + - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + From 766e13b0e75e0aa7c009379d4afa214309eb3127 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 2 Sep 2022 13:15:52 +0900 Subject: [PATCH 02/73] - Adjust Layout --- Flow.Launcher/MainWindow.xaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 8743bde2f..17dccc893 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -254,7 +254,7 @@ - + @@ -303,18 +303,20 @@ - - + + + - + - + - + + From e8ccd46589e9c9efd6be1620df6a8299c8afb7b7 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 2 Sep 2022 14:35:25 +0900 Subject: [PATCH 03/73] - Add Preview Toggle (F2 Key) - Fix Seperate line for toggle - Block preview when nothing result --- Flow.Launcher/MainWindow.xaml | 8 ++++---- Flow.Launcher/MainWindow.xaml.cs | 26 ++++++++++++++++++++++++-- Flow.Launcher/ResultListBox.xaml | 1 + Flow.Launcher/Themes/Base.xaml | 32 +++++++++++++++++++++++++++++++- 4 files changed, 60 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 17dccc893..545dba94f 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -237,7 +237,7 @@ + Style="{DynamicResource SeparatorStyle}" Visibility="Visible" /> - + @@ -303,8 +303,8 @@ - - + + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 2b7db38cf..8adc788cc 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel; using System.Threading.Tasks; using System.Windows; @@ -531,12 +531,34 @@ namespace Flow.Launcher } } break; + case Key.F2: + PreviewToggle(); + e.Handled = true; + break; + default: break; } } + public void PreviewToggle() + { + + if (Preview.Visibility == Visibility.Collapsed) + { + ResultArea.SetValue(Grid.ColumnSpanProperty, 1); + //HotkeyArea.SetValue(Visibility, Visibility.Collapsed); + Preview.Visibility = Visibility.Visible; + } + else + { + ResultArea.SetValue(Grid.ColumnSpanProperty, 2); + //HotkeyArea.SetValue(Visibility, Visibility.Visible); + Preview.Visibility = Visibility.Collapsed; + } + } + private void MoveQueryTextToEnd() { // QueryTextBox seems to be update with a DispatcherPriority as low as ContextIdle. @@ -556,4 +578,4 @@ namespace Flow.Launcher } } } -} \ No newline at end of file +} diff --git a/Flow.Launcher/ResultListBox.xaml b/Flow.Launcher/ResultListBox.xaml index f7e820050..646a43eda 100644 --- a/Flow.Launcher/ResultListBox.xaml +++ b/Flow.Launcher/ResultListBox.xaml @@ -56,6 +56,7 @@ - @@ -268,6 +282,22 @@ + + diff --git a/Flow.Launcher/Themes/Base.xaml b/Flow.Launcher/Themes/Base.xaml index 1082be320..913477b53 100644 --- a/Flow.Launcher/Themes/Base.xaml +++ b/Flow.Launcher/Themes/Base.xaml @@ -243,6 +243,7 @@ + @@ -250,6 +251,7 @@ + @@ -281,6 +283,15 @@ + + - + diff --git a/Flow.Launcher/Themes/Discord Dark.xaml b/Flow.Launcher/Themes/Discord Dark.xaml index 636fe7b6d..2ddb9ae09 100644 --- a/Flow.Launcher/Themes/Discord Dark.xaml +++ b/Flow.Launcher/Themes/Discord Dark.xaml @@ -100,4 +100,7 @@ + diff --git a/Flow.Launcher/Themes/Dracula.xaml b/Flow.Launcher/Themes/Dracula.xaml index c661d33e3..c46dcff16 100644 --- a/Flow.Launcher/Themes/Dracula.xaml +++ b/Flow.Launcher/Themes/Dracula.xaml @@ -100,4 +100,8 @@ + + diff --git a/Flow.Launcher/Themes/League.xaml b/Flow.Launcher/Themes/League.xaml index 06649978b..84bd8c6ea 100644 --- a/Flow.Launcher/Themes/League.xaml +++ b/Flow.Launcher/Themes/League.xaml @@ -74,5 +74,9 @@ - + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Light.xaml b/Flow.Launcher/Themes/Light.xaml index 10c995941..dae40e9eb 100644 --- a/Flow.Launcher/Themes/Light.xaml +++ b/Flow.Launcher/Themes/Light.xaml @@ -70,4 +70,7 @@ + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Metro Server.xaml b/Flow.Launcher/Themes/Metro Server.xaml index 016e6af9d..98edffcb6 100644 --- a/Flow.Launcher/Themes/Metro Server.xaml +++ b/Flow.Launcher/Themes/Metro Server.xaml @@ -56,4 +56,7 @@ + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Nord Darker.xaml b/Flow.Launcher/Themes/Nord Darker.xaml index 413effa51..3c9cc2678 100644 --- a/Flow.Launcher/Themes/Nord Darker.xaml +++ b/Flow.Launcher/Themes/Nord Darker.xaml @@ -71,4 +71,7 @@ + diff --git a/Flow.Launcher/Themes/Nord.xaml b/Flow.Launcher/Themes/Nord.xaml index 2fcc11ef2..4d8ffee39 100644 --- a/Flow.Launcher/Themes/Nord.xaml +++ b/Flow.Launcher/Themes/Nord.xaml @@ -70,4 +70,7 @@ + diff --git a/Flow.Launcher/Themes/Sublime.xaml b/Flow.Launcher/Themes/Sublime.xaml index 82fff06ff..57648be7a 100644 --- a/Flow.Launcher/Themes/Sublime.xaml +++ b/Flow.Launcher/Themes/Sublime.xaml @@ -99,4 +99,7 @@ + diff --git a/Flow.Launcher/Themes/Win10Light.xaml b/Flow.Launcher/Themes/Win10Light.xaml index 6f487a895..c08df312e 100644 --- a/Flow.Launcher/Themes/Win10Light.xaml +++ b/Flow.Launcher/Themes/Win10Light.xaml @@ -102,4 +102,7 @@ + diff --git a/Flow.Launcher/Themes/Win11Dark.xaml b/Flow.Launcher/Themes/Win11Dark.xaml index 31f6fb956..0f92b5c28 100644 --- a/Flow.Launcher/Themes/Win11Dark.xaml +++ b/Flow.Launcher/Themes/Win11Dark.xaml @@ -156,4 +156,7 @@ + diff --git a/Flow.Launcher/Themes/Win11Light.xaml b/Flow.Launcher/Themes/Win11Light.xaml index 33aa6cdee..4747f0423 100644 --- a/Flow.Launcher/Themes/Win11Light.xaml +++ b/Flow.Launcher/Themes/Win11Light.xaml @@ -100,4 +100,7 @@ + diff --git a/Flow.Launcher/Themes/Win11System.xaml b/Flow.Launcher/Themes/Win11System.xaml index bcc83be9f..b3f425508 100644 --- a/Flow.Launcher/Themes/Win11System.xaml +++ b/Flow.Launcher/Themes/Win11System.xaml @@ -156,4 +156,7 @@ + From a090b10b1e859ddd866410dd113df738e35a352e Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 2 Sep 2022 05:57:06 -0400 Subject: [PATCH 06/73] Add field images to be displayed in previews --- Flow.Launcher.Plugin/Result.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 35c491d35..7451d29c7 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -67,6 +67,11 @@ namespace Flow.Launcher.Plugin } } + /// + /// Full image used for preview window + /// + public string PreviewImage { get; set; } + /// /// Delegate function, see /// From f5a511a4f1655b0e19edc0738ccb14355120cd53 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 2 Sep 2022 07:36:57 -0400 Subject: [PATCH 07/73] Add FullImageFIle type --- Flow.Launcher.Infrastructure/Image/ImageLoader.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 8c1d7d74f..b2ebbc336 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -95,6 +95,7 @@ namespace Flow.Launcher.Infrastructure.Image Folder, Data, ImageFile, + FullImageFile, Error, Cache } From 832c41f3dd88a1d1f92c1c7730cb35971ce4408e Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 2 Sep 2022 07:37:25 -0400 Subject: [PATCH 08/73] Override type if we load the full image --- Flow.Launcher.Infrastructure/Image/ImageLoader.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index b2ebbc336..7df44f8c4 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -174,6 +174,7 @@ namespace Flow.Launcher.Infrastructure.Image if (loadFullImage) { image = LoadFullImage(path); + type = ImageType.FullImageFile; } else { From a53b961406d48ca46ca587182abd068853346639 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 2 Sep 2022 07:38:25 -0400 Subject: [PATCH 09/73] Append full image type to path if we're caching a full imagefile --- Flow.Launcher.Infrastructure/Image/ImageLoader.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 7df44f8c4..d0743ef13 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -228,6 +228,10 @@ namespace Flow.Launcher.Infrastructure.Image if (imageResult.ImageType != ImageType.Error && imageResult.ImageType != ImageType.Cache) { // we need to get image hash string hash = EnableImageHash ? _hashGenerator.GetHashFromImage(img) : null; + if (imageResult.ImageType == ImageType.FullImageFile) + { + path = path + ImageType.FullImageFile; + } if (hash != null) { From a76304ac516dfda2225ad717e48218759b5d4c3d Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 2 Sep 2022 07:38:49 -0400 Subject: [PATCH 10/73] Load full image from cache --- Flow.Launcher.Infrastructure/Image/ImageLoader.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index d0743ef13..77d1e19b3 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -114,7 +114,10 @@ namespace Flow.Launcher.Infrastructure.Image { return new ImageResult(ImageCache[path], ImageType.Cache); } - + if (loadFullImage && ImageCache.ContainsKey(path + ImageType.FullImageFile)) + { + return new ImageResult(ImageCache[path + ImageType.FullImageFile], ImageType.Cache); + } if (path.StartsWith("data:", StringComparison.OrdinalIgnoreCase)) { var imageSource = new BitmapImage(new Uri(path)); From a9d11816f5d75b9356820ebdb7681ed095912f30 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 2 Sep 2022 07:39:32 -0400 Subject: [PATCH 11/73] Try to load full image from cache first --- Flow.Launcher.Infrastructure/Image/ImageLoader.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 77d1e19b3..89f982b90 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -110,14 +110,15 @@ namespace Flow.Launcher.Infrastructure.Image { return new ImageResult(ImageCache[Constant.MissingImgIcon], ImageType.Error); } - if (ImageCache.ContainsKey(path)) - { - return new ImageResult(ImageCache[path], ImageType.Cache); - } if (loadFullImage && ImageCache.ContainsKey(path + ImageType.FullImageFile)) { return new ImageResult(ImageCache[path + ImageType.FullImageFile], ImageType.Cache); } + if (ImageCache.ContainsKey(path)) + { + return new ImageResult(ImageCache[path], ImageType.Cache); + } + if (path.StartsWith("data:", StringComparison.OrdinalIgnoreCase)) { var imageSource = new BitmapImage(new Uri(path)); From 29e5b4fcf74308e294c5d3adc5406df3ca5fb838 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 2 Sep 2022 07:40:00 -0400 Subject: [PATCH 12/73] Add logic for detecting if full image exists in cache --- Flow.Launcher.Infrastructure/Image/ImageLoader.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 89f982b90..198ad5933 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -219,8 +219,12 @@ namespace Flow.Launcher.Infrastructure.Image option); } - public static bool CacheContainImage(string path) + public static bool CacheContainImage(string path, bool fullImage = false) { + if (fullImage) + { + return ImageCache.ContainsKey(path + ImageType.FullImageFile); + } return ImageCache.ContainsKey(path) && ImageCache[path] != null; } From 5f92f5b93b42ebdf2e75d4ba068e9e52a9c8716a Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 2 Sep 2022 07:40:18 -0400 Subject: [PATCH 13/73] Add binding for preview image --- Flow.Launcher/MainWindow.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index d3d42ff3a..2126c4906 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -311,7 +311,7 @@ - + From 9ed008fef63022c7d15e57c757ab310c736f6af9 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 2 Sep 2022 07:40:37 -0400 Subject: [PATCH 14/73] Add preview image binding --- Flow.Launcher/ViewModel/ResultViewModel.cs | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 4d32d792d..ab02abbef 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -112,8 +112,10 @@ namespace Flow.Launcher.ViewModel : Result.SubTitleToolTip; private volatile bool ImageLoaded; + private volatile bool PreviewImageLoaded; private ImageSource image = ImageLoader.DefaultImage; + private ImageSource previewImage = ImageLoader.DefaultImage; public ImageSource Image { @@ -130,6 +132,21 @@ namespace Flow.Launcher.ViewModel private set => image = value; } + public ImageSource PreviewImage + { + get + { + if (!PreviewImageLoaded) + { + PreviewImageLoaded = true; + _ = LoadPreviewImageAsync(); + } + + return previewImage; + } + private set => previewImage = value; + } + public GlyphInfo Glyph { get; set; } private async ValueTask LoadImageAsync() @@ -161,6 +178,36 @@ namespace Flow.Launcher.ViewModel Image = await Task.Run(() => ImageLoader.Load(imagePath)).ConfigureAwait(false); } + + private async ValueTask LoadPreviewImageAsync() + { + var imagePath = Result.PreviewImage ?? Result.IcoPath; + if (string.IsNullOrEmpty(imagePath) && Result.Icon != null) + { + try + { + previewImage = Result.Icon(); + return; + } + catch (Exception e) + { + Log.Exception( + $"|ResultViewModel.Image|IcoPath is empty and exception when calling Icon() for result <{Result.Title}> of plugin <{Result.PluginDirectory}>", + e); + } + } + + if (ImageLoader.CacheContainImage(imagePath, true)) + { + // will get here either when icoPath has value\icon delegate is null\when had exception in delegate + previewImage = ImageLoader.Load(imagePath, true); + return; + } + + // We need to modify the property not field here to trigger the OnPropertyChanged event + PreviewImage = await Task.Run(() => ImageLoader.Load(imagePath, true)).ConfigureAwait(false); + } + public Result Result { get; } public string QuerySuggestionText { get; set; } From 5aaaf37f0cf3531b177ac76582a033f9a2c08c11 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 2 Sep 2022 08:10:52 -0400 Subject: [PATCH 15/73] Fix not loading full image --- .../Image/ImageLoader.cs | 13 ++++++------ Flow.Launcher/ViewModel/ResultViewModel.cs | 20 ------------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 198ad5933..3c5c8b9b6 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -101,7 +101,7 @@ namespace Flow.Launcher.Infrastructure.Image } private static ImageResult LoadInternal(string path, bool loadFullImage = false) - { +{ ImageResult imageResult; try @@ -114,7 +114,7 @@ namespace Flow.Launcher.Infrastructure.Image { return new ImageResult(ImageCache[path + ImageType.FullImageFile], ImageType.Cache); } - if (ImageCache.ContainsKey(path)) + if (!loadFullImage && ImageCache.ContainsKey(path)) { return new ImageResult(ImageCache[path], ImageType.Cache); } @@ -236,10 +236,7 @@ namespace Flow.Launcher.Infrastructure.Image if (imageResult.ImageType != ImageType.Error && imageResult.ImageType != ImageType.Cache) { // we need to get image hash string hash = EnableImageHash ? _hashGenerator.GetHashFromImage(img) : null; - if (imageResult.ImageType == ImageType.FullImageFile) - { - path = path + ImageType.FullImageFile; - } + if (hash != null) { @@ -249,6 +246,10 @@ namespace Flow.Launcher.Infrastructure.Image } else { // new guid + if (imageResult.ImageType == ImageType.FullImageFile) + { + path = path + ImageType.FullImageFile; + } GuidToKey[hash] = path; } } diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index ab02abbef..1e6ee2b92 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -182,27 +182,7 @@ namespace Flow.Launcher.ViewModel private async ValueTask LoadPreviewImageAsync() { var imagePath = Result.PreviewImage ?? Result.IcoPath; - if (string.IsNullOrEmpty(imagePath) && Result.Icon != null) - { - try - { - previewImage = Result.Icon(); - return; - } - catch (Exception e) - { - Log.Exception( - $"|ResultViewModel.Image|IcoPath is empty and exception when calling Icon() for result <{Result.Title}> of plugin <{Result.PluginDirectory}>", - e); - } - } - if (ImageLoader.CacheContainImage(imagePath, true)) - { - // will get here either when icoPath has value\icon delegate is null\when had exception in delegate - previewImage = ImageLoader.Load(imagePath, true); - return; - } // We need to modify the property not field here to trigger the OnPropertyChanged event PreviewImage = await Task.Run(() => ImageLoader.Load(imagePath, true)).ConfigureAwait(false); From c2d2fc00922ba0ba8912b6133d1b0489f89269d6 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Fri, 2 Sep 2022 08:36:07 -0400 Subject: [PATCH 16/73] Fix caching --- .../Image/ImageLoader.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 3c5c8b9b6..ef034e194 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -110,9 +110,9 @@ namespace Flow.Launcher.Infrastructure.Image { return new ImageResult(ImageCache[Constant.MissingImgIcon], ImageType.Error); } - if (loadFullImage && ImageCache.ContainsKey(path + ImageType.FullImageFile)) + if (loadFullImage && ImageCache.ContainsKey($"{path}_{ImageType.FullImageFile}")) { - return new ImageResult(ImageCache[path + ImageType.FullImageFile], ImageType.Cache); + return new ImageResult(ImageCache[$"{path}_{ImageType.FullImageFile}"], ImageType.Cache); } if (!loadFullImage && ImageCache.ContainsKey(path)) { @@ -223,7 +223,7 @@ namespace Flow.Launcher.Infrastructure.Image { if (fullImage) { - return ImageCache.ContainsKey(path + ImageType.FullImageFile); + return ImageCache.ContainsKey($"{path}_{ImageType.FullImageFile}"); } return ImageCache.ContainsKey(path) && ImageCache[path] != null; } @@ -236,7 +236,10 @@ namespace Flow.Launcher.Infrastructure.Image if (imageResult.ImageType != ImageType.Error && imageResult.ImageType != ImageType.Cache) { // we need to get image hash string hash = EnableImageHash ? _hashGenerator.GetHashFromImage(img) : null; - + if (imageResult.ImageType == ImageType.FullImageFile) + { + path = $"{path}_{ImageType.FullImageFile}"; + } if (hash != null) { @@ -246,10 +249,7 @@ namespace Flow.Launcher.Infrastructure.Image } else { // new guid - if (imageResult.ImageType == ImageType.FullImageFile) - { - path = path + ImageType.FullImageFile; - } + GuidToKey[hash] = path; } } From 733ebb8ac1e1874668b693f86754ef2bdbbeadd5 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Tue, 13 Sep 2022 17:34:11 -0500 Subject: [PATCH 17/73] Add support for customized usercontrol --- Flow.Launcher.Plugin/Result.cs | 6 + Flow.Launcher/MainWindow.xaml | 167 +++++++++++------- Flow.Launcher/ViewModel/ResultViewModel.cs | 6 +- .../Programs/Win32.cs | 10 ++ 4 files changed, 123 insertions(+), 66 deletions(-) diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 7451d29c7..b51288fe3 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +using System.Windows.Controls; using System.Windows.Media; namespace Flow.Launcher.Plugin @@ -193,6 +194,11 @@ namespace Flow.Launcher.Plugin /// public string SubTitleToolTip { get; set; } + /// + /// Customized Preview Panel + /// + public Lazy PreviewPanel { get; set; } + /// /// Run this result, asynchronously /// diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 2126c4906..54c577f84 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -12,7 +12,6 @@ Title="Flow Launcher" MinWidth="{Binding MainWindowWidth, Mode=OneWay}" MaxWidth="{Binding MainWindowWidth, Mode=OneWay}" - d:DataContext="{d:DesignInstance vm:MainViewModel}" AllowDrop="True" AllowsTransparency="True" Background="Transparent" @@ -235,9 +234,10 @@ + Width="Auto" + HorizontalAlignment="Stretch" + Style="{DynamicResource SeparatorStyle}" + Visibility="Visible" /> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 1e6ee2b92..372fb40e5 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -15,7 +15,7 @@ namespace Flow.Launcher.ViewModel public class ResultViewModel : BaseModel { private static PrivateFontCollection fontCollection = new(); - private static Dictionary fonts = new(); + private static Dictionary fonts = new(); public ResultViewModel(Result result, Settings settings) { @@ -67,6 +67,10 @@ namespace Flow.Launcher.ViewModel public Visibility ShowOpenResultHotkey => Settings.ShowOpenResultHotkey ? Visibility.Visible : Visibility.Collapsed; + public Visibility ShowDefaultPreview => Result.PreviewPanel == null ? Visibility.Visible : Visibility.Collapsed; + + public Visibility ShowCustomizedPrewview => Result.PreviewPanel == null ? Visibility.Collapsed : Visibility.Visible; + public Visibility ShowIcon { get diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index 6a8b232e9..812bb01a0 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -17,6 +17,7 @@ using System.Diagnostics; using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch; using System.Diagnostics.CodeAnalysis; using System.Threading.Channels; +using System.Windows.Controls; namespace Flow.Launcher.Plugin.Program.Programs { @@ -104,6 +105,15 @@ namespace Flow.Launcher.Plugin.Program.Programs Score = matchResult.Score, TitleHighlightData = matchResult.MatchData, ContextData = this, + PreviewPanel = new Lazy(() => + { + var control = new UserControl(); + control.Content = new TextBlock() + { + Text = "test" + }; + return control; + }), Action = c => { var runAsAdmin = ( From ea728ccc7d5b2d8cd6fc5d23ee1f0b6ee8d5ea75 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 16 Sep 2022 15:04:18 +0900 Subject: [PATCH 18/73] Add WindowsAPICodePack for HighResThumb --- Flow.Launcher/Flow.Launcher.csproj | 1 + Flow.Launcher/MainWindow.xaml.cs | 2 -- Flow.Launcher/ViewModel/ResultViewModel.cs | 7 ++++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index 66cc911ee..52267e16c 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -97,6 +97,7 @@ + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 266a0b17e..a9cd2eff0 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -562,13 +562,11 @@ namespace Flow.Launcher if (Preview.Visibility == Visibility.Collapsed) { ResultArea.SetValue(Grid.ColumnSpanProperty, 1); - //HotkeyArea.SetValue(Visibility, Visibility.Collapsed); Preview.Visibility = Visibility.Visible; } else { ResultArea.SetValue(Grid.ColumnSpanProperty, 2); - //HotkeyArea.SetValue(Visibility, Visibility.Visible); Preview.Visibility = Visibility.Collapsed; } } diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 372fb40e5..6feb9d501 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -9,6 +9,8 @@ using Flow.Launcher.Plugin; using System.IO; using System.Drawing.Text; using System.Collections.Generic; +using Microsoft.WindowsAPICodePack.Shell; +using System.Drawing; namespace Flow.Launcher.ViewModel { @@ -186,10 +188,9 @@ namespace Flow.Launcher.ViewModel private async ValueTask LoadPreviewImageAsync() { var imagePath = Result.PreviewImage ?? Result.IcoPath; - - // We need to modify the property not field here to trigger the OnPropertyChanged event - PreviewImage = await Task.Run(() => ImageLoader.Load(imagePath, true)).ConfigureAwait(false); + //PreviewImage = await Task.Run(() => ImageLoader.Load(imagePath, true)).ConfigureAwait(false); + PreviewImage = ShellFile.FromFilePath(imagePath).Thumbnail.LargeBitmapSource; } public Result Result { get; } From b502f2af1be5017f8d12938d9feca7850fd73a83 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 16 Sep 2022 16:07:55 +0900 Subject: [PATCH 19/73] - Adjust Layout - Change Preview High Resolution --- Flow.Launcher/MainWindow.xaml | 11 ++++++----- Flow.Launcher/ViewModel/ResultViewModel.cs | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 54c577f84..136a90fcf 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -313,7 +313,7 @@ Visibility="Collapsed"> @@ -325,8 +325,9 @@ x:Name="ImageIcon" Grid.Row="0" Grid.Column="0" - Height="128" - Margin="0,0,0,8" + MaxWidth="{Binding ActualWidth, ElementName=Preview}" + MaxHeight="400" + Margin="0,10,0,8" HorizontalAlignment="Center" Source="{Binding PreviewImage}" Visibility="{Binding ShowIcon}" /> @@ -343,10 +344,10 @@ ImageLoader.Load(imagePath, true)).ConfigureAwait(false); - PreviewImage = ShellFile.FromFilePath(imagePath).Thumbnail.LargeBitmapSource; + PreviewImage = ShellFile.FromFilePath(imagePath).Thumbnail.ExtraLargeBitmapSource; } public Result Result { get; } From bb0c57d3d2fadd70d5925d6636f59e5116fb8265 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 16 Sep 2022 20:33:54 +0900 Subject: [PATCH 20/73] - remove test customcontrol in program plugin - change small icon in result to folder thumbnail --- Flow.Launcher/ViewModel/ResultViewModel.cs | 5 +++-- Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs | 9 --------- Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs | 4 ++-- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 2ea116029..2ccf3b416 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -181,7 +181,8 @@ namespace Flow.Launcher.ViewModel } // We need to modify the property not field here to trigger the OnPropertyChanged event - Image = await Task.Run(() => ImageLoader.Load(imagePath)).ConfigureAwait(false); + //Image = await Task.Run(() => ImageLoader.Load(imagePath)).ConfigureAwait(false); + Image = ShellFolder.FromParsingName(imagePath).Thumbnail.MediumBitmapSource; } @@ -190,7 +191,7 @@ namespace Flow.Launcher.ViewModel var imagePath = Result.PreviewImage ?? Result.IcoPath; // We need to modify the property not field here to trigger the OnPropertyChanged event //PreviewImage = await Task.Run(() => ImageLoader.Load(imagePath, true)).ConfigureAwait(false); - PreviewImage = ShellFile.FromFilePath(imagePath).Thumbnail.ExtraLargeBitmapSource; + PreviewImage = ShellFolder.FromParsingName(imagePath).Thumbnail.LargeBitmapSource; } public Result Result { get; } diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index 812bb01a0..64a40954c 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -105,15 +105,6 @@ namespace Flow.Launcher.Plugin.Program.Programs Score = matchResult.Score, TitleHighlightData = matchResult.MatchData, ContextData = this, - PreviewPanel = new Lazy(() => - { - var control = new UserControl(); - control.Content = new TextBlock() - { - Text = "test" - }; - return control; - }), Action = c => { var runAsAdmin = ( diff --git a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs index b136e3b8b..179745e2d 100644 --- a/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.WebSearch/Main.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; @@ -192,4 +192,4 @@ namespace Flow.Launcher.Plugin.WebSearch public event ResultUpdatedEventHandler ResultsUpdated; } -} \ No newline at end of file +} From af2909b9d1d3ba9ec0160edc097b9974ad107672 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 16 Sep 2022 21:25:00 +0900 Subject: [PATCH 21/73] Fix Blank Preview when no result with query. --- Flow.Launcher/MainWindow.xaml | 4 ++-- Flow.Launcher/Themes/Base.xaml | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 136a90fcf..00cc77e6b 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -318,8 +318,8 @@ Background="Transparent"> - - + + - - @@ -297,7 +299,6 @@ - From e5a5a8c34dc1a8ed762e7efee3868f13e62c1454 Mon Sep 17 00:00:00 2001 From: DB p Date: Sun, 2 Oct 2022 12:30:35 +0900 Subject: [PATCH 22/73] - Rollabck to latest stable code - Fix Binding Error --- Flow.Launcher/MainWindow.xaml | 2 +- Flow.Launcher/SettingWindow.xaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 00cc77e6b..bcbea498a 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -254,7 +254,7 @@ - + diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 2585943be..484170e27 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -1565,7 +1565,7 @@ - From 20f61f523929fb85c5baea08d0d7139248d53cfb Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 26 Oct 2022 00:34:35 +0900 Subject: [PATCH 23/73] Removed MSApiCodePack --- Flow.Launcher/Flow.Launcher.csproj | 1 - Flow.Launcher/ViewModel/ResultViewModel.cs | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index 52267e16c..66cc911ee 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -97,7 +97,6 @@ - diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index d72f4f858..1e2531ec0 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -9,7 +9,6 @@ using Flow.Launcher.Plugin; using System.IO; using System.Drawing.Text; using System.Collections.Generic; -using Microsoft.WindowsAPICodePack.Shell; using System.Drawing; namespace Flow.Launcher.ViewModel @@ -194,8 +193,7 @@ namespace Flow.Launcher.ViewModel } // We need to modify the property not field here to trigger the OnPropertyChanged event - //Image = await Task.Run(() => ImageLoader.Load(imagePath)).ConfigureAwait(false); - Image = ShellFolder.FromParsingName(imagePath).Thumbnail.MediumBitmapSource; + Image = await Task.Run(() => ImageLoader.Load(imagePath)).ConfigureAwait(false); } @@ -203,8 +201,7 @@ namespace Flow.Launcher.ViewModel { var imagePath = Result.PreviewImage ?? Result.IcoPath; // We need to modify the property not field here to trigger the OnPropertyChanged event - //PreviewImage = await Task.Run(() => ImageLoader.Load(imagePath, true)).ConfigureAwait(false); - PreviewImage = ShellFolder.FromParsingName(imagePath).Thumbnail.LargeBitmapSource; + PreviewImage = await Task.Run(() => ImageLoader.Load(imagePath, true)).ConfigureAwait(false); } public Result Result { get; } From 7fd06dae31d6f360c7373124b7d9757c4cf492c2 Mon Sep 17 00:00:00 2001 From: DB p Date: Mon, 14 Nov 2022 02:07:46 +0900 Subject: [PATCH 24/73] Fix Conflict --- Flow.Launcher/MainWindow.xaml | 52 ----------------------------------- 1 file changed, 52 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 1f536974e..cb7cc07ae 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -390,58 +390,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 1d674c4d0e2a71a95a8533d2d2700cd0c576173e Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 19 Nov 2022 00:03:01 +0900 Subject: [PATCH 25/73] Split Preview Style --- Flow.Launcher/MainWindow.xaml | 198 +++++++++++---------- Flow.Launcher/Themes/Atom.xaml | 17 +- Flow.Launcher/Themes/Base.xaml | 35 +++- Flow.Launcher/Themes/BlackAndWhite.xaml | 74 ++++++-- Flow.Launcher/Themes/BlurBlack Darker.xaml | 13 ++ Flow.Launcher/Themes/BlurBlack.xaml | 12 ++ Flow.Launcher/Themes/BlurWhite.xaml | 12 ++ Flow.Launcher/Themes/Darker Glass.xaml | 19 +- Flow.Launcher/Themes/Darker.xaml | 12 ++ Flow.Launcher/Themes/Discord Dark.xaml | 19 +- Flow.Launcher/Themes/Dracula.xaml | 20 ++- Flow.Launcher/Themes/Gray.xaml | 12 ++ Flow.Launcher/Themes/League.xaml | 19 +- Flow.Launcher/Themes/Light.xaml | 119 +++++++++---- Flow.Launcher/Themes/Metro Server.xaml | 17 +- Flow.Launcher/Themes/Nord Darker.xaml | 14 +- Flow.Launcher/Themes/Nord.xaml | 17 +- Flow.Launcher/Themes/Pink.xaml | 13 ++ Flow.Launcher/Themes/Sublime.xaml | 17 +- Flow.Launcher/Themes/Win10Light.xaml | 17 +- Flow.Launcher/Themes/Win11Dark.xaml | 17 +- Flow.Launcher/Themes/Win11Light.xaml | 12 ++ Flow.Launcher/Themes/Win11System.xaml | 19 +- 23 files changed, 565 insertions(+), 159 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index cb7cc07ae..8a9e026a2 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -1,4 +1,5 @@ - - - - - - + + + + - - - - - - - - - - - + + - - - - + - - - - - - - - - - - - + - - - - + + + - - + - - - - + + + - - + + - + - + Text="{Binding DateText}" + Visibility="{Binding Settings.UseDate, Converter={StaticResource BooleanToVisibilityConverter}}" /> + - - - - + Style="{DynamicResource PreviewItemSubTitleStyle}" + Text="{Binding Result.SubTitle}" /> diff --git a/Flow.Launcher/Themes/Atom.xaml b/Flow.Launcher/Themes/Atom.xaml index c1fcd90d1..87c2e6e83 100644 --- a/Flow.Launcher/Themes/Atom.xaml +++ b/Flow.Launcher/Themes/Atom.xaml @@ -167,7 +167,22 @@ TargetType="{x:Type TextBlock}"> - + + diff --git a/Flow.Launcher/Themes/Base.xaml b/Flow.Launcher/Themes/Base.xaml index 92b842c69..0bc64ddfd 100644 --- a/Flow.Launcher/Themes/Base.xaml +++ b/Flow.Launcher/Themes/Base.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"> - + + + + + + + + diff --git a/Flow.Launcher/Themes/BlackAndWhite.xaml b/Flow.Launcher/Themes/BlackAndWhite.xaml index 395f5d614..5c7b03d26 100644 --- a/Flow.Launcher/Themes/BlackAndWhite.xaml +++ b/Flow.Launcher/Themes/BlackAndWhite.xaml @@ -1,44 +1,80 @@ - + - - - - - - - - - #494949 - @@ -50,4 +86,16 @@ + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/BlurBlack Darker.xaml b/Flow.Launcher/Themes/BlurBlack Darker.xaml index 6dc0db45e..9e8a6f095 100644 --- a/Flow.Launcher/Themes/BlurBlack Darker.xaml +++ b/Flow.Launcher/Themes/BlurBlack Darker.xaml @@ -156,4 +156,17 @@ + + diff --git a/Flow.Launcher/Themes/BlurBlack.xaml b/Flow.Launcher/Themes/BlurBlack.xaml index 5a0023d4a..60237fdac 100644 --- a/Flow.Launcher/Themes/BlurBlack.xaml +++ b/Flow.Launcher/Themes/BlurBlack.xaml @@ -137,4 +137,16 @@ + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/BlurWhite.xaml b/Flow.Launcher/Themes/BlurWhite.xaml index 6308f9e47..f05327990 100644 --- a/Flow.Launcher/Themes/BlurWhite.xaml +++ b/Flow.Launcher/Themes/BlurWhite.xaml @@ -157,4 +157,16 @@ + + diff --git a/Flow.Launcher/Themes/Darker Glass.xaml b/Flow.Launcher/Themes/Darker Glass.xaml index 41f2d16bf..80a9c353b 100644 --- a/Flow.Launcher/Themes/Darker Glass.xaml +++ b/Flow.Launcher/Themes/Darker Glass.xaml @@ -150,7 +150,24 @@ TargetType="{x:Type TextBlock}"> - + + + + diff --git a/Flow.Launcher/Themes/Darker.xaml b/Flow.Launcher/Themes/Darker.xaml index b255c4d9e..3c4438384 100644 --- a/Flow.Launcher/Themes/Darker.xaml +++ b/Flow.Launcher/Themes/Darker.xaml @@ -94,4 +94,16 @@ TargetType="{x:Type TextBlock}"> + + diff --git a/Flow.Launcher/Themes/Discord Dark.xaml b/Flow.Launcher/Themes/Discord Dark.xaml index b8872385e..df0f143cb 100644 --- a/Flow.Launcher/Themes/Discord Dark.xaml +++ b/Flow.Launcher/Themes/Discord Dark.xaml @@ -165,7 +165,22 @@ TargetType="{x:Type TextBlock}"> - + + + diff --git a/Flow.Launcher/Themes/Dracula.xaml b/Flow.Launcher/Themes/Dracula.xaml index 0dd97b9fe..93cad211e 100644 --- a/Flow.Launcher/Themes/Dracula.xaml +++ b/Flow.Launcher/Themes/Dracula.xaml @@ -167,8 +167,22 @@ TargetType="{x:Type TextBlock}"> - - + + + diff --git a/Flow.Launcher/Themes/Gray.xaml b/Flow.Launcher/Themes/Gray.xaml index 1cacc8ec2..487c9a839 100644 --- a/Flow.Launcher/Themes/Gray.xaml +++ b/Flow.Launcher/Themes/Gray.xaml @@ -126,4 +126,16 @@ TargetType="{x:Type TextBlock}"> + + diff --git a/Flow.Launcher/Themes/League.xaml b/Flow.Launcher/Themes/League.xaml index d926f0519..70f63cb76 100644 --- a/Flow.Launcher/Themes/League.xaml +++ b/Flow.Launcher/Themes/League.xaml @@ -130,9 +130,24 @@ TargetType="{x:Type TextBlock}"> - + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Light.xaml b/Flow.Launcher/Themes/Light.xaml index dae40e9eb..97dd09a79 100644 --- a/Flow.Launcher/Themes/Light.xaml +++ b/Flow.Launcher/Themes/Light.xaml @@ -1,63 +1,103 @@ - + - + - - - - - - + - - - + + #d9d9d9 - - - - - + + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Metro Server.xaml b/Flow.Launcher/Themes/Metro Server.xaml index 1b6795b59..d6b3ed52b 100644 --- a/Flow.Launcher/Themes/Metro Server.xaml +++ b/Flow.Launcher/Themes/Metro Server.xaml @@ -110,7 +110,22 @@ - + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Nord Darker.xaml b/Flow.Launcher/Themes/Nord Darker.xaml index 3946b91ff..9f32a3add 100644 --- a/Flow.Launcher/Themes/Nord Darker.xaml +++ b/Flow.Launcher/Themes/Nord Darker.xaml @@ -131,5 +131,17 @@ + + + diff --git a/Flow.Launcher/Themes/Nord.xaml b/Flow.Launcher/Themes/Nord.xaml index dafb83c39..8c9a092cc 100644 --- a/Flow.Launcher/Themes/Nord.xaml +++ b/Flow.Launcher/Themes/Nord.xaml @@ -128,7 +128,22 @@ TargetType="{x:Type TextBlock}"> - + + diff --git a/Flow.Launcher/Themes/Pink.xaml b/Flow.Launcher/Themes/Pink.xaml index 7e1ae911a..f3fd4cdac 100644 --- a/Flow.Launcher/Themes/Pink.xaml +++ b/Flow.Launcher/Themes/Pink.xaml @@ -125,4 +125,17 @@ TargetType="{x:Type TextBlock}"> + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Sublime.xaml b/Flow.Launcher/Themes/Sublime.xaml index 4cc2248f3..0373467cd 100644 --- a/Flow.Launcher/Themes/Sublime.xaml +++ b/Flow.Launcher/Themes/Sublime.xaml @@ -164,7 +164,22 @@ TargetType="{x:Type TextBlock}"> - + + diff --git a/Flow.Launcher/Themes/Win10Light.xaml b/Flow.Launcher/Themes/Win10Light.xaml index 7d3ae2cac..af3c45260 100644 --- a/Flow.Launcher/Themes/Win10Light.xaml +++ b/Flow.Launcher/Themes/Win10Light.xaml @@ -167,7 +167,22 @@ TargetType="{x:Type TextBlock}"> - + + diff --git a/Flow.Launcher/Themes/Win11Dark.xaml b/Flow.Launcher/Themes/Win11Dark.xaml index 1558bd1f4..edf765a2d 100644 --- a/Flow.Launcher/Themes/Win11Dark.xaml +++ b/Flow.Launcher/Themes/Win11Dark.xaml @@ -168,7 +168,22 @@ TargetType="{x:Type TextBlock}"> - + + diff --git a/Flow.Launcher/Themes/Win11Light.xaml b/Flow.Launcher/Themes/Win11Light.xaml index 731246565..d55974570 100644 --- a/Flow.Launcher/Themes/Win11Light.xaml +++ b/Flow.Launcher/Themes/Win11Light.xaml @@ -179,4 +179,16 @@ + + diff --git a/Flow.Launcher/Themes/Win11System.xaml b/Flow.Launcher/Themes/Win11System.xaml index d136d24a8..1d1a4d437 100644 --- a/Flow.Launcher/Themes/Win11System.xaml +++ b/Flow.Launcher/Themes/Win11System.xaml @@ -168,7 +168,24 @@ TargetType="{x:Type TextBlock}"> - + + From 00a4d62b2220b37838338c5f06e4e6bb0859f9d1 Mon Sep 17 00:00:00 2001 From: DB p Date: Fri, 25 Nov 2022 22:03:17 +0900 Subject: [PATCH 26/73] - Temp Fix Confict / Change F2 to F1 --- Flow.Launcher/Languages/en.xaml | 2 +- Flow.Launcher/MainWindow.xaml.cs | 2 +- Flow.Launcher/ViewModel/ResultViewModel.cs | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 2b47935ab..73f7158d6 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -67,7 +67,7 @@ Search with Pinyin Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for translating Chinese. Always open preview when start search - If uncheck, preview not showing when start launch. Please use F2 key + If uncheck, preview not showing when start launch. Please use F1 key Shadow effect is not allowed while current theme has blur effect enabled diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 623b4f3c7..4db2ade69 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -619,7 +619,7 @@ namespace Flow.Launcher } } break; - case Key.F2: + case Key.F1: PreviewToggle(); e.Handled = true; break; diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 37b838251..25a48204d 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -202,8 +202,10 @@ namespace Flow.Launcher.ViewModel private async ValueTask LoadPreviewImageAsync() { var imagePath = Result.PreviewImage ?? Result.IcoPath; + var loadFullImage = (Path.GetExtension(imagePath) ?? "").Equals(".url", StringComparison.OrdinalIgnoreCase); // We need to modify the property not field here to trigger the OnPropertyChanged event - PreviewImage = await Task.Run(() => ImageLoader.Load(imagePath, true)).ConfigureAwait(false); + //PreviewImage = await Task.Run(() => ImageLoader.Load(imagePath, true)).ConfigureAwait(false); + PreviewImage = await ImageLoader.LoadAsync(imagePath, loadFullImage).ConfigureAwait(false); } public Result Result { get; } From 124318f96ab2e88c6202908f43b6625fee08ed67 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 26 Nov 2022 00:32:48 +0900 Subject: [PATCH 27/73] - Adjust Themes for Preview --- Flow.Launcher/Themes/Base.xaml | 8 ++++---- Flow.Launcher/Themes/BlurBlack Darker.xaml | 16 +++++++++++++++- Flow.Launcher/Themes/BlurBlack.xaml | 15 +++++++++++++++ Flow.Launcher/Themes/BlurWhite.xaml | 6 ++++++ Flow.Launcher/Themes/Bullet Light.xaml | 20 +++++++++++++++++++- Flow.Launcher/Themes/Circle Light.xaml | 8 ++++---- Flow.Launcher/Themes/Circle System.xaml | 20 +++++++++++++++++++- Flow.Launcher/Themes/Cyan Dark.xaml | 21 ++++++++++++++++++++- Flow.Launcher/Themes/Darker Glass.xaml | 2 +- Flow.Launcher/Themes/Discord Dark.xaml | 3 ++- Flow.Launcher/Themes/Dracula.xaml | 3 ++- Flow.Launcher/Themes/Gray.xaml | 16 +++++++++++++--- Flow.Launcher/Themes/League.xaml | 5 ++--- Flow.Launcher/Themes/Midnight.xaml | 7 ++++--- Flow.Launcher/Themes/Nord Darker.xaml | 14 +++++++++++++- Flow.Launcher/Themes/Pink.xaml | 16 +++++++++++++++- Flow.Launcher/Themes/Sublime.xaml | 1 + Flow.Launcher/Themes/Ubuntu.xaml | 20 +++++++++++++++++++- Flow.Launcher/Themes/Win10Light.xaml | 3 ++- Flow.Launcher/Themes/Win11Dark.xaml | 1 + Flow.Launcher/Themes/Win11Light.xaml | 8 ++++++-- Flow.Launcher/Themes/Win11System.xaml | 1 + 22 files changed, 184 insertions(+), 30 deletions(-) diff --git a/Flow.Launcher/Themes/Base.xaml b/Flow.Launcher/Themes/Base.xaml index 776ce0019..e28e60e07 100644 --- a/Flow.Launcher/Themes/Base.xaml +++ b/Flow.Launcher/Themes/Base.xaml @@ -414,6 +414,7 @@ diff --git a/Flow.Launcher/Themes/BlurBlack Darker.xaml b/Flow.Launcher/Themes/BlurBlack Darker.xaml index 904c7ead4..a8de180d8 100644 --- a/Flow.Launcher/Themes/BlurBlack Darker.xaml +++ b/Flow.Launcher/Themes/BlurBlack Darker.xaml @@ -37,7 +37,6 @@ x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}"> - @@ -48,6 +47,15 @@ + + + + + + + @@ -181,4 +181,22 @@ TargetType="{x:Type TextBlock}"> + + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Circle Light.xaml b/Flow.Launcher/Themes/Circle Light.xaml index 316023ab3..57e0da832 100644 --- a/Flow.Launcher/Themes/Circle Light.xaml +++ b/Flow.Launcher/Themes/Circle Light.xaml @@ -69,7 +69,7 @@ x:Key="SeparatorStyle" BasedOn="{StaticResource BaseSeparatorStyle}" TargetType="{x:Type Rectangle}"> - + @@ -167,18 +167,18 @@ x:Key="PreviewBorderStyle" BasedOn="{StaticResource BasePreviewBorderStyle}" TargetType="{x:Type Border}"> - + diff --git a/Flow.Launcher/Themes/Circle System.xaml b/Flow.Launcher/Themes/Circle System.xaml index b00f03e76..811b278fa 100644 --- a/Flow.Launcher/Themes/Circle System.xaml +++ b/Flow.Launcher/Themes/Circle System.xaml @@ -70,7 +70,7 @@ x:Key="SeparatorStyle" BasedOn="{StaticResource BaseSeparatorStyle}" TargetType="{x:Type Rectangle}"> - + @@ -164,4 +164,22 @@ TargetType="{x:Type TextBlock}"> + + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Cyan Dark.xaml b/Flow.Launcher/Themes/Cyan Dark.xaml index c79044f00..77e4b06bc 100644 --- a/Flow.Launcher/Themes/Cyan Dark.xaml +++ b/Flow.Launcher/Themes/Cyan Dark.xaml @@ -164,7 +164,7 @@ 0 0 - 0 0 0 0 + 0 0 0 4 + + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Darker Glass.xaml b/Flow.Launcher/Themes/Darker Glass.xaml index 1f079de05..d97789b90 100644 --- a/Flow.Launcher/Themes/Darker Glass.xaml +++ b/Flow.Launcher/Themes/Darker Glass.xaml @@ -5,7 +5,7 @@ - + 0 0 0 8 + + diff --git a/Flow.Launcher/Themes/League.xaml b/Flow.Launcher/Themes/League.xaml index f014ed055..7b42b1cd9 100644 --- a/Flow.Launcher/Themes/League.xaml +++ b/Flow.Launcher/Themes/League.xaml @@ -141,9 +141,8 @@ x:Key="PreviewBorderStyle" BasedOn="{StaticResource BasePreviewBorderStyle}" TargetType="{x:Type Border}"> - - - + + diff --git a/Flow.Launcher/Themes/Nord Darker.xaml b/Flow.Launcher/Themes/Nord Darker.xaml index 20f9b16c4..d7641afec 100644 --- a/Flow.Launcher/Themes/Nord Darker.xaml +++ b/Flow.Launcher/Themes/Nord Darker.xaml @@ -3,6 +3,7 @@ + 0 0 0 8 + - + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Sublime.xaml b/Flow.Launcher/Themes/Sublime.xaml index e03ab7c43..9f46a8077 100644 --- a/Flow.Launcher/Themes/Sublime.xaml +++ b/Flow.Launcher/Themes/Sublime.xaml @@ -5,6 +5,7 @@ + 0 0 0 8 + + + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Win10Light.xaml b/Flow.Launcher/Themes/Win10Light.xaml index c03f6ce1d..28737d14e 100644 --- a/Flow.Launcher/Themes/Win10Light.xaml +++ b/Flow.Launcher/Themes/Win10Light.xaml @@ -5,6 +5,7 @@ + 0 0 0 4 - + diff --git a/Flow.Launcher/Themes/Win11System.xaml b/Flow.Launcher/Themes/Win11System.xaml index 93b761ba2..63d7af073 100644 --- a/Flow.Launcher/Themes/Win11System.xaml +++ b/Flow.Launcher/Themes/Win11System.xaml @@ -6,6 +6,7 @@ + 0 0 0 8 @@ -325,57 +326,57 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + VerticalAlignment="Center"> + + + + + + + diff --git a/Flow.Launcher/Themes/Base.xaml b/Flow.Launcher/Themes/Base.xaml index e28e60e07..e3ad6360e 100644 --- a/Flow.Launcher/Themes/Base.xaml +++ b/Flow.Launcher/Themes/Base.xaml @@ -478,7 +478,8 @@ + - - - + - - - - + + + - @@ -351,14 +338,16 @@ - - - + + + - @@ -367,52 +356,64 @@ - - - + + + - - - - + - + - - - + + + + + - - + diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index fca37a359..1bfaa9c52 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -20,47 +20,51 @@ namespace Flow.Launcher.ViewModel public ResultViewModel(Result result, Settings settings) { - if (result != null) + Settings = settings; + + if (result == null) { - Result = result; + return; + } + Result = result; - if (Result.Glyph is { FontFamily: not null } glyph) + PreviewExtension = Path.GetExtension(result.PreviewImage ?? result.IcoPath); + + if (Result.Glyph is { FontFamily: not null } glyph) + { + // Checks if it's a system installed font, which does not require path to be provided. + if (glyph.FontFamily.EndsWith(".ttf") || glyph.FontFamily.EndsWith(".otf")) { - // Checks if it's a system installed font, which does not require path to be provided. - if (glyph.FontFamily.EndsWith(".ttf") || glyph.FontFamily.EndsWith(".otf")) + string fontFamilyPath = glyph.FontFamily; + + if (!Path.IsPathRooted(fontFamilyPath)) { - string fontFamilyPath = glyph.FontFamily; + fontFamilyPath = Path.Combine(Result.PluginDirectory, fontFamilyPath); + } - if (!Path.IsPathRooted(fontFamilyPath)) + if (fonts.ContainsKey(fontFamilyPath)) + { + Glyph = glyph with { - fontFamilyPath = Path.Combine(Result.PluginDirectory, fontFamilyPath); - } - - if (fonts.ContainsKey(fontFamilyPath)) - { - Glyph = glyph with - { - FontFamily = fonts[fontFamilyPath] - }; - } - else - { - fontCollection.AddFontFile(fontFamilyPath); - fonts[fontFamilyPath] = $"{Path.GetDirectoryName(fontFamilyPath)}/#{fontCollection.Families[^1].Name}"; - Glyph = glyph with - { - FontFamily = fonts[fontFamilyPath] - }; - } + FontFamily = fonts[fontFamilyPath] + }; } else { - Glyph = glyph; + fontCollection.AddFontFile(fontFamilyPath); + fonts[fontFamilyPath] = $"{Path.GetDirectoryName(fontFamilyPath)}/#{fontCollection.Families[^1].Name}"; + Glyph = glyph with + { + FontFamily = fonts[fontFamilyPath] + }; } } + else + { + Glyph = glyph; + } } - Settings = settings; } private Settings Settings { get; } @@ -165,6 +169,13 @@ namespace Flow.Launcher.ViewModel private set => previewImage = value; } + public string PreviewExtension { get; set; } + + public bool PreviewIsImageOrVideo => PreviewExtension is ".jpg" + or ".png" + or ".gif" + or ".mp4"; + public GlyphInfo Glyph { get; set; } private async Task LoadImageAsync() From c622edab99bcffc901de1cd55fdf8610c514d49e Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 26 Nov 2022 06:12:23 +0900 Subject: [PATCH 33/73] Add FileType / Ignore Case Senstive --- Flow.Launcher/ViewModel/ResultViewModel.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 1bfaa9c52..20ea9cf7c 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -29,6 +29,11 @@ namespace Flow.Launcher.ViewModel Result = result; PreviewExtension = Path.GetExtension(result.PreviewImage ?? result.IcoPath); + if (PreviewExtension != null) + { + PreviewExtension = PreviewExtension.ToLowerInvariant(); + + } if (Result.Glyph is { FontFamily: not null } glyph) { @@ -173,7 +178,11 @@ namespace Flow.Launcher.ViewModel public bool PreviewIsImageOrVideo => PreviewExtension is ".jpg" or ".png" + or ".avi" + or ".mkv" + or ".bmp" or ".gif" + or ".wmv" or ".mp4"; public GlyphInfo Glyph { get; set; } From c59449debd0b5c10ee792ffb359263c49ca04ae3 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 26 Nov 2022 15:31:22 +0900 Subject: [PATCH 34/73] Change String --- Flow.Launcher/Languages/en.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index abc81744e..ffb3b30eb 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -66,8 +66,8 @@ Changes minimum match score required for results. Search with Pinyin Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for translating Chinese. - Always display preview panel when open flow - If uncheck, preview not showing when start flow. Please use F1 key to toggle. + Always Preview + Preview will display when start flow. Shadow effect is not allowed while current theme has blur effect enabled From 24e526b03d71c313f3890da742f5c9583a7b9a6b Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sat, 26 Nov 2022 14:33:42 +0800 Subject: [PATCH 35/73] fix typo --- Flow.Launcher/MainWindow.xaml | 2 +- Flow.Launcher/ViewModel/ResultViewModel.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 1207034ae..231b0019b 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -429,7 +429,7 @@ + Visibility="{Binding ShowCustomizedPreview}" /> diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 20ea9cf7c..9e2774951 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -32,8 +32,8 @@ namespace Flow.Launcher.ViewModel if (PreviewExtension != null) { PreviewExtension = PreviewExtension.ToLowerInvariant(); - } + else if () if (Result.Glyph is { FontFamily: not null } glyph) { @@ -79,7 +79,7 @@ namespace Flow.Launcher.ViewModel public Visibility ShowDefaultPreview => Result.PreviewPanel == null ? Visibility.Visible : Visibility.Collapsed; - public Visibility ShowCustomizedPrewview => Result.PreviewPanel == null ? Visibility.Collapsed : Visibility.Visible; + public Visibility ShowCustomizedPreview => Result.PreviewPanel == null ? Visibility.Collapsed : Visibility.Visible; public Visibility ShowIcon { From 9cdbb3ada1d7c13c4799c37925a6f4511c8f3a75 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sat, 26 Nov 2022 14:51:11 +0800 Subject: [PATCH 36/73] fix uwp preview image --- Flow.Launcher/ViewModel/ResultViewModel.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 9e2774951..d58ecdfc3 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -33,7 +33,6 @@ namespace Flow.Launcher.ViewModel { PreviewExtension = PreviewExtension.ToLowerInvariant(); } - else if () if (Result.Glyph is { FontFamily: not null } glyph) { @@ -222,7 +221,16 @@ namespace Flow.Launcher.ViewModel private async Task LoadPreviewImageAsync() { var imagePath = Result.PreviewImage ?? Result.IcoPath; - PreviewImage = await ImageLoader.LoadAsync(imagePath, true).ConfigureAwait(false); + if (imagePath == null && Result.Icon != null) + { + // For UWP programs from program plugin + // TODO: Consider https://github.com/Flow-Launcher/Flow.Launcher/pull/1492#issuecomment-1304829947 + PreviewImage = Result.Icon(); + } + else + { + PreviewImage = await ImageLoader.LoadAsync(imagePath, true).ConfigureAwait(false); + } } public Result Result { get; } From 3c229fc69f9dcfb27cf5b38d4b6b526d429aa39a Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sat, 26 Nov 2022 14:56:37 +0800 Subject: [PATCH 37/73] Update preview tooltip --- 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 ffb3b30eb..a8511bb4e 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -67,7 +67,7 @@ Search with Pinyin Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for translating Chinese. Always Preview - Preview will display when start flow. + Always open preview panel when Flow starts. Press F1 to toggle preview. Shadow effect is not allowed while current theme has blur effect enabled From ca6c6cb62a939fa074dfaf863feb60601f0e29f9 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sat, 26 Nov 2022 10:16:04 -0600 Subject: [PATCH 38/73] Use loading.png for loading time image placeholder --- Flow.Launcher.Infrastructure/Constant.cs | 1 + Flow.Launcher.Infrastructure/Image/ImageLoader.cs | 5 +++-- Flow.Launcher/Images/loading.png | Bin 0 -> 164 bytes Flow.Launcher/ViewModel/PluginViewModel.cs | 4 ++-- Flow.Launcher/ViewModel/ResultViewModel.cs | 4 ++-- 5 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 Flow.Launcher/Images/loading.png diff --git a/Flow.Launcher.Infrastructure/Constant.cs b/Flow.Launcher.Infrastructure/Constant.cs index b0eebd2df..56f421e30 100644 --- a/Flow.Launcher.Infrastructure/Constant.cs +++ b/Flow.Launcher.Infrastructure/Constant.cs @@ -29,6 +29,7 @@ namespace Flow.Launcher.Infrastructure public static readonly string DefaultIcon = Path.Combine(ImagesDirectory, "app.png"); public static readonly string ErrorIcon = Path.Combine(ImagesDirectory, "app_error.png"); public static readonly string MissingImgIcon = Path.Combine(ImagesDirectory, "app_missing_img.png"); + public static readonly string LoadingImgIcon = Path.Combine(ImagesDirectory, "loading.png"); public static string PythonPath; diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 130221379..416c66d24 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -21,7 +21,8 @@ namespace Flow.Launcher.Infrastructure.Image private static readonly ConcurrentDictionary GuidToKey = new(); private static IImageHashGenerator _hashGenerator; private static readonly bool EnableImageHash = true; - public static ImageSource DefaultImage { get; } = new BitmapImage(new Uri(Constant.MissingImgIcon)); + public static ImageSource MissingImage { get; } = new BitmapImage(new Uri(Constant.MissingImgIcon)); + public static ImageSource LoadingImage { get; } = new BitmapImage(new Uri(Constant.LoadingImgIcon)); public const int SmallIconSize = 32; @@ -111,7 +112,7 @@ namespace Flow.Launcher.Infrastructure.Image { if (string.IsNullOrEmpty(path)) { - return new ImageResult(DefaultImage, ImageType.Error); + return new ImageResult(MissingImage, ImageType.Error); } if (ImageCache.ContainsKey(path, loadFullImage)) diff --git a/Flow.Launcher/Images/loading.png b/Flow.Launcher/Images/loading.png new file mode 100644 index 0000000000000000000000000000000000000000..2e2263a4daace5e6b301afeec8a9adb669ed97b8 GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1GZk{fVAr-gYoM+@@aNuAu_?xn9_nmDO0^8VLs|2_2weoWy e1Rl&6O<*{)gvqG9A?z^FL PluginPair.Metadata.ActionKeywords.Count == 1 ? Visibility.Visible : Visibility.Collapsed; public string InitilizaTime => PluginPair.Metadata.InitTime + "ms"; diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 2d61f6cab..53a7ffbb2 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -126,7 +126,7 @@ namespace Flow.Launcher.ViewModel private volatile bool ImageLoaded; - private ImageSource image = ImageLoader.DefaultImage; + private ImageSource image = ImageLoader.LoadingImage; public ImageSource Image { @@ -168,7 +168,7 @@ namespace Flow.Launcher.ViewModel if (ImageLoader.CacheContainImage(imagePath)) { // will get here either when icoPath has value\icon delegate is null\when had exception in delegate - image = await ImageLoader.LoadAsync(imagePath, loadFullImage); + image = await ImageLoader.LoadAsync(imagePath, loadFullImage).ConfigureAwait(false); return; } From 91a46f7cad36fd527127108210e1a6e42c8b9746 Mon Sep 17 00:00:00 2001 From: DB p Date: Sun, 27 Nov 2022 01:29:04 +0900 Subject: [PATCH 39/73] Fix Conflict --- Flow.Launcher/ViewModel/ResultViewModel.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index d63fed7ee..ece8ae92c 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -141,7 +141,7 @@ namespace Flow.Launcher.ViewModel private volatile bool PreviewImageLoaded; private ImageSource image = ImageLoader.LoadingImage; - private ImageSource previewImage = ImageLoader.DefaultImage; + private ImageSource previewImage = ImageLoader.LoadingImage; public ImageSource Image { From e5a19cc9e0545d9cb4e966aa0e7bfa748a8419b2 Mon Sep 17 00:00:00 2001 From: DB p Date: Sun, 27 Nov 2022 01:42:17 +0900 Subject: [PATCH 40/73] Change Loading Icon / Rmove Opacity in Darker Theme --- Flow.Launcher/Images/loading.png | Bin 164 -> 1435 bytes Flow.Launcher/Themes/Darker Glass.xaml | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Flow.Launcher/Images/loading.png b/Flow.Launcher/Images/loading.png index 2e2263a4daace5e6b301afeec8a9adb669ed97b8..ee6d1b85a790166ad9ad2ec8cbf953d34f52695b 100644 GIT binary patch literal 1435 zcmbVMJ#W)M7&a|Jw5SpSAt9tn#$7tzMs+yf7&U!c@6b zT<0T5zLO{Tzc%*!5g#VP((PCfPMuA@W5UyC=LO;Tj#u4a8}x1Nwtg(?65$ZUTHfbmF?9k-rmHfBQ0JP7rKxW_=F*` z>$id!b}gyT3;8_RRwc0yVVjnePXvk^_L^9r5fQVBE@J?Im^GEm{5+}S%oR}wx~_tZ z3QQSfp{_&S6o-$*#YK(_*NZDdVSHstO~yi~s+~?p=@<%)8meZRrV4ab*JX~7<6gi} zR}SKt5kry0IPyZ~(LhWXQJuD#C2>^;Huzym8^l9DagV886snp65}W!!2dB8O9ku$x z9juZT@kzj9j@43Z*rbfcP5KY&^mvZ|?pxbVW$deq@24VSw!Fp77&>HMbX@I)L|rE_ zZAX|aZ*ete5^F+OhzMdds#4k-MQUxNvZx!%oOr3`1rF`Rmv>ztMZ}0DB~g<#P1dtj zpg|qLj5Z5Q2*3bpQ^#|A`#}u@X7oK!o-+<&=s>W8p-Uqlaf3Y{HHaDp4M|Mh2n)1D zBQBV0XY{qOZCDOsh5}5=MN8r~E1u`TIY3X){%LVf=f~Ymb{n;t2eBO3b{X=wLGz(1rXsRyDbSPVI__< z-1d&_fdOr&NjT|$!aab+)MXtMk$i)D>%eqUx$6h ejo&%M`(=FP``DQ`uV>FC?X$eRT6}fw?!!N`wYuH_ literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezpTC$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWw1GZk{fVAr-gYoM+@@aNuAu_?xn9_nmDO0^8VLs|2_2weoWy e1Rl&6O<*{)gvqG9A?z^FL - + - - - - + - - - - + + + - @@ -338,16 +351,14 @@ - - - + + + - @@ -356,43 +367,52 @@ - - - + + + - - - - + - + - - + + + + + + - - + - - + diff --git a/Flow.Launcher/Themes/Base.xaml b/Flow.Launcher/Themes/Base.xaml index 5c6a0ac68..e1d2d1606 100644 --- a/Flow.Launcher/Themes/Base.xaml +++ b/Flow.Launcher/Themes/Base.xaml @@ -406,6 +406,15 @@ + - + + diff --git a/Flow.Launcher/Themes/BlurBlack.xaml b/Flow.Launcher/Themes/BlurBlack.xaml index 2cd367565..0f1264292 100644 --- a/Flow.Launcher/Themes/BlurBlack.xaml +++ b/Flow.Launcher/Themes/BlurBlack.xaml @@ -162,4 +162,10 @@ TargetType="{x:Type TextBlock}"> + \ No newline at end of file diff --git a/Flow.Launcher/Themes/BlurWhite.xaml b/Flow.Launcher/Themes/BlurWhite.xaml index 4fa39441a..4406724b8 100644 --- a/Flow.Launcher/Themes/BlurWhite.xaml +++ b/Flow.Launcher/Themes/BlurWhite.xaml @@ -173,4 +173,10 @@ TargetType="{x:Type TextBlock}"> + diff --git a/Flow.Launcher/Themes/Bullet Light.xaml b/Flow.Launcher/Themes/Bullet Light.xaml index 6a2b5cfbb..1f776a2ee 100644 --- a/Flow.Launcher/Themes/Bullet Light.xaml +++ b/Flow.Launcher/Themes/Bullet Light.xaml @@ -200,4 +200,10 @@ TargetType="{x:Type TextBlock}"> + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Circle Light.xaml b/Flow.Launcher/Themes/Circle Light.xaml index 57e0da832..e52e3a957 100644 --- a/Flow.Launcher/Themes/Circle Light.xaml +++ b/Flow.Launcher/Themes/Circle Light.xaml @@ -181,4 +181,10 @@ TargetType="{x:Type TextBlock}"> + diff --git a/Flow.Launcher/Themes/Circle System.xaml b/Flow.Launcher/Themes/Circle System.xaml index 811b278fa..2b2ce7ca3 100644 --- a/Flow.Launcher/Themes/Circle System.xaml +++ b/Flow.Launcher/Themes/Circle System.xaml @@ -182,4 +182,10 @@ TargetType="{x:Type TextBlock}"> + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Cyan Dark.xaml b/Flow.Launcher/Themes/Cyan Dark.xaml index 77e4b06bc..60bc09002 100644 --- a/Flow.Launcher/Themes/Cyan Dark.xaml +++ b/Flow.Launcher/Themes/Cyan Dark.xaml @@ -202,4 +202,10 @@ TargetType="{x:Type TextBlock}"> + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Darker Glass.xaml b/Flow.Launcher/Themes/Darker Glass.xaml index 140234e01..89b6dfa01 100644 --- a/Flow.Launcher/Themes/Darker Glass.xaml +++ b/Flow.Launcher/Themes/Darker Glass.xaml @@ -165,5 +165,10 @@ TargetType="{x:Type TextBlock}"> - + diff --git a/Flow.Launcher/Themes/Discord Dark.xaml b/Flow.Launcher/Themes/Discord Dark.xaml index ec957dd94..5315c7644 100644 --- a/Flow.Launcher/Themes/Discord Dark.xaml +++ b/Flow.Launcher/Themes/Discord Dark.xaml @@ -183,4 +183,10 @@ TargetType="{x:Type TextBlock}"> + diff --git a/Flow.Launcher/Themes/Dracula.xaml b/Flow.Launcher/Themes/Dracula.xaml index c156d8885..ce3350728 100644 --- a/Flow.Launcher/Themes/Dracula.xaml +++ b/Flow.Launcher/Themes/Dracula.xaml @@ -185,4 +185,10 @@ TargetType="{x:Type TextBlock}"> + diff --git a/Flow.Launcher/Themes/Gray.xaml b/Flow.Launcher/Themes/Gray.xaml index cf93d3a60..d8d344e21 100644 --- a/Flow.Launcher/Themes/Gray.xaml +++ b/Flow.Launcher/Themes/Gray.xaml @@ -186,4 +186,10 @@ TargetType="{x:Type TextBlock}"> + diff --git a/Flow.Launcher/Themes/League.xaml b/Flow.Launcher/Themes/League.xaml index 7b42b1cd9..7fbe56187 100644 --- a/Flow.Launcher/Themes/League.xaml +++ b/Flow.Launcher/Themes/League.xaml @@ -156,4 +156,10 @@ TargetType="{x:Type TextBlock}"> + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Midnight.xaml b/Flow.Launcher/Themes/Midnight.xaml index b00cde676..91ff620d5 100644 --- a/Flow.Launcher/Themes/Midnight.xaml +++ b/Flow.Launcher/Themes/Midnight.xaml @@ -182,4 +182,10 @@ TargetType="{x:Type TextBlock}"> + diff --git a/Flow.Launcher/Themes/Nord Darker.xaml b/Flow.Launcher/Themes/Nord Darker.xaml index d7641afec..d9ddb3076 100644 --- a/Flow.Launcher/Themes/Nord Darker.xaml +++ b/Flow.Launcher/Themes/Nord Darker.xaml @@ -155,4 +155,10 @@ TargetType="{x:Type TextBlock}"> + diff --git a/Flow.Launcher/Themes/Pink.xaml b/Flow.Launcher/Themes/Pink.xaml index f0d234007..dc97e4320 100644 --- a/Flow.Launcher/Themes/Pink.xaml +++ b/Flow.Launcher/Themes/Pink.xaml @@ -152,4 +152,10 @@ TargetType="{x:Type TextBlock}"> + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Sublime.xaml b/Flow.Launcher/Themes/Sublime.xaml index 9f46a8077..6df69ad3e 100644 --- a/Flow.Launcher/Themes/Sublime.xaml +++ b/Flow.Launcher/Themes/Sublime.xaml @@ -182,4 +182,10 @@ TargetType="{x:Type TextBlock}"> + diff --git a/Flow.Launcher/Themes/Ubuntu.xaml b/Flow.Launcher/Themes/Ubuntu.xaml index 244d80309..33f232699 100644 --- a/Flow.Launcher/Themes/Ubuntu.xaml +++ b/Flow.Launcher/Themes/Ubuntu.xaml @@ -206,4 +206,10 @@ TargetType="{x:Type TextBlock}"> + \ No newline at end of file diff --git a/Flow.Launcher/Themes/Win10Light.xaml b/Flow.Launcher/Themes/Win10Light.xaml index 28737d14e..5f837bdb3 100644 --- a/Flow.Launcher/Themes/Win10Light.xaml +++ b/Flow.Launcher/Themes/Win10Light.xaml @@ -184,4 +184,10 @@ TargetType="{x:Type TextBlock}"> + diff --git a/Flow.Launcher/Themes/Win11Dark.xaml b/Flow.Launcher/Themes/Win11Dark.xaml index 89e83d86e..5abb96cce 100644 --- a/Flow.Launcher/Themes/Win11Dark.xaml +++ b/Flow.Launcher/Themes/Win11Dark.xaml @@ -186,4 +186,10 @@ TargetType="{x:Type TextBlock}"> + diff --git a/Flow.Launcher/Themes/Win11Light.xaml b/Flow.Launcher/Themes/Win11Light.xaml index 47125eb4b..e2c37236c 100644 --- a/Flow.Launcher/Themes/Win11Light.xaml +++ b/Flow.Launcher/Themes/Win11Light.xaml @@ -200,4 +200,10 @@ TargetType="{x:Type TextBlock}"> + diff --git a/Flow.Launcher/Themes/Win11System.xaml b/Flow.Launcher/Themes/Win11System.xaml index 63d7af073..df09249be 100644 --- a/Flow.Launcher/Themes/Win11System.xaml +++ b/Flow.Launcher/Themes/Win11System.xaml @@ -194,4 +194,10 @@ + From bca2145aeaa7b73c181ed3c12c26dc05d1dda90c Mon Sep 17 00:00:00 2001 From: DB p Date: Sun, 27 Nov 2022 15:48:37 +0900 Subject: [PATCH 46/73] Add Darker Theme (Garul'fs request) --- Flow.Launcher/Themes/Darker.xaml | 100 +++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 Flow.Launcher/Themes/Darker.xaml diff --git a/Flow.Launcher/Themes/Darker.xaml b/Flow.Launcher/Themes/Darker.xaml new file mode 100644 index 000000000..d1abbe978 --- /dev/null +++ b/Flow.Launcher/Themes/Darker.xaml @@ -0,0 +1,100 @@ + + + + + 0 0 0 8 + + + + + + + + #4d4d4d + + + + + + From 26a713985c739e3e6c9a612a3595dabb98796949 Mon Sep 17 00:00:00 2001 From: DB p Date: Sun, 27 Nov 2022 16:58:26 +0900 Subject: [PATCH 47/73] Add flac/mp3 (for large coverart) --- Flow.Launcher/ViewModel/ResultViewModel.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index 1eded59c7..99528a9a7 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -182,6 +182,8 @@ namespace Flow.Launcher.ViewModel or ".bmp" or ".gif" or ".wmv" + or ".mp3" + or ".flac" or ".mp4"; public GlyphInfo Glyph { get; set; } From 1e8fe9342b5794a98df8a22dc5e77ea688b9a90f Mon Sep 17 00:00:00 2001 From: DB p Date: Sun, 27 Nov 2022 17:54:56 +0900 Subject: [PATCH 48/73] Change Loading Image / Change Stretch for small icons (under 128) --- Flow.Launcher/Images/loading.png | Bin 1435 -> 274 bytes Flow.Launcher/MainWindow.xaml | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/Images/loading.png b/Flow.Launcher/Images/loading.png index ee6d1b85a790166ad9ad2ec8cbf953d34f52695b..1600b5967ed39c48a5dea2678d9f57a70412603d 100644 GIT binary patch delta 246 zcmbQuJ&9?8O1)%>YeY$Kep*R+Vo@rCV@iHfs)A>3VtQ&&YGO)d;mK4R1_p*Lo-U3d z6}R5ZI>_6gAi#1p;&iBoWXO)Q52m*(dGVB|eRE&5;qlv7$G1+|vd$@?2>>E5XG;J8 literal 1435 zcmbVMJ#W)M7&a|Jw5SpSAt9tn#$7tzMs+yf7&U!c@6b zT<0T5zLO{Tzc%*!5g#VP((PCfPMuA@W5UyC=LO;Tj#u4a8}x1Nwtg(?65$ZUTHfbmF?9k-rmHfBQ0JP7rKxW_=F*` z>$id!b}gyT3;8_RRwc0yVVjnePXvk^_L^9r5fQVBE@J?Im^GEm{5+}S%oR}wx~_tZ z3QQSfp{_&S6o-$*#YK(_*NZDdVSHstO~yi~s+~?p=@<%)8meZRrV4ab*JX~7<6gi} zR}SKt5kry0IPyZ~(LhWXQJuD#C2>^;Huzym8^l9DagV886snp65}W!!2dB8O9ku$x z9juZT@kzj9j@43Z*rbfcP5KY&^mvZ|?pxbVW$deq@24VSw!Fp77&>HMbX@I)L|rE_ zZAX|aZ*ete5^F+OhzMdds#4k-MQUxNvZx!%oOr3`1rF`Rmv>ztMZ}0DB~g<#P1dtj zpg|qLj5Z5Q2*3bpQ^#|A`#}u@X7oK!o-+<&=s>W8p-Uqlaf3Y{HHaDp4M|Mh2n)1D zBQBV0XY{qOZCDOsh5}5=MN8r~E1u`TIY3X){%LVf=f~Ymb{n;t2eBO3b{X=wLGz(1rXsRyDbSPVI__< z-1d&_fdOr&NjT|$!aab+)MXtMk$i)D>%eqUx$6h ejo&%M`(=FP``DQ`uV>FC?X$eRT6}fw?!!N`wYuH_ diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 10e97074b..6d1c0958b 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -413,11 +413,12 @@ + - + + + + + +