diff --git a/Flow.Launcher.Core/Flow.Launcher.Core.csproj b/Flow.Launcher.Core/Flow.Launcher.Core.csproj index 7d18c467b..ec99dc520 100644 --- a/Flow.Launcher.Core/Flow.Launcher.Core.csproj +++ b/Flow.Launcher.Core/Flow.Launcher.Core.csproj @@ -55,7 +55,7 @@ - + diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 8f503131c..91dcb3336 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -241,7 +241,7 @@ namespace Flow.Launcher.Plugin public string ProgressBarColor { get; set; } = "#26a0da"; /// - /// Suggests a result's file extension should use full width of the default preview panel. + /// Suggests the preview image of result should use full width of the default preview panel by result's file extension. /// /// File extension. Dot included. public static bool ShouldUseBigThumbnail(string extension) diff --git a/Flow.Launcher.Test/Plugins/ProgramTest.cs b/Flow.Launcher.Test/Plugins/ProgramTest.cs deleted file mode 100644 index e3a05f484..000000000 --- a/Flow.Launcher.Test/Plugins/ProgramTest.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Flow.Launcher.Plugin.Program.Programs; -using NUnit.Framework; -using System; -using Windows.ApplicationModel; - -namespace Flow.Launcher.Test.Plugins -{ - [TestFixture] - public class ProgramTest - { - [TestCase("Microsoft.WindowsCamera", "ms-resource:LensSDK/Resources/AppTitle", "ms-resource://Microsoft.WindowsCamera/LensSDK/Resources/AppTitle")] - [TestCase("microsoft.windowscommunicationsapps", "ms-resource://microsoft.windowscommunicationsapps/hxoutlookintl/AppManifest_MailDesktop_DisplayName", - "ms-resource://microsoft.windowscommunicationsapps/hxoutlookintl/AppManifest_MailDesktop_DisplayName")] - [TestCase("windows.immersivecontrolpanel", "ms-resource:DisplayName", "ms-resource://windows.immersivecontrolpanel/Resources/DisplayName")] - [TestCase("Microsoft.MSPaint", "ms-resource:AppName", "ms-resource://Microsoft.MSPaint/Resources/AppName")] - public void WhenGivenPriReferenceValueShouldReturnCorrectFormat(string packageName, string rawPriReferenceValue, string expectedFormat) - { - // Arrange - var app = new UWP.Application(); - - // Act - var result = UWP.Application.FormattedPriReferenceValue(packageName, rawPriReferenceValue); - - // Assert - Assert.IsTrue(result == expectedFormat, - $"Expected Pri reference format: {expectedFormat}{Environment.NewLine} " + - $"Actual: {result}{Environment.NewLine}"); - } - } -} diff --git a/Flow.Launcher.sln b/Flow.Launcher.sln index f59d3d26f..1d403c5a1 100644 --- a/Flow.Launcher.sln +++ b/Flow.Launcher.sln @@ -80,7 +80,7 @@ Global EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|Any CPU.Build.0 = Debug|Any CPU {FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|x64.ActiveCfg = Debug|Any CPU {FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|x64.Build.0 = Debug|Any CPU {FF742965-9A80-41A5-B042-D6C7D3A21708}.Debug|x86.ActiveCfg = Debug|Any CPU diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index d18d30a78..fe2e4a8e4 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -118,6 +118,14 @@ Theme Gallery How to create a theme Hi There + Explorer + Search for files, folders and file contents + WebSearch + Search the web with different search engine support + Program + Launch programs as admin or a different user + ProcessKiller + Terminate unwanted processes Query Box Font Result Item Font Window Mode diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 8aabaa0c2..6052c4187 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -443,10 +443,9 @@ Margin="2,2,2,0" Panel.ZIndex="1" Background="Transparent" - IsItemsHost="true" + IsItemsHost="true" LastChildFill="False" /> - + @@ -1011,6 +1010,7 @@ TextAlignment="Left" /> - + @@ -1813,6 +1819,7 @@ @@ -1850,7 +1857,10 @@ - + diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 70758540d..d178be77c 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -562,5 +562,15 @@ namespace Flow.Launcher }; } + + private void PluginStore_GotFocus(object sender, RoutedEventArgs e) + { + Keyboard.Focus(pluginStoreFilterTxb); + } + + private void Plugin_GotFocus(object sender, RoutedEventArgs e) + { + Keyboard.Focus(pluginFilterTxb); + } } } diff --git a/Flow.Launcher/ViewModel/ResultViewModel.cs b/Flow.Launcher/ViewModel/ResultViewModel.cs index d08f526b2..50b9aca21 100644 --- a/Flow.Launcher/ViewModel/ResultViewModel.cs +++ b/Flow.Launcher/ViewModel/ResultViewModel.cs @@ -195,14 +195,32 @@ namespace Flow.Launcher.ViewModel private async Task LoadImageAsync() { - // We need to modify the property not field here to trigger the OnPropertyChanged event - Image = await LoadImageInternalAsync(Result.IcoPath, Result.Icon, false).ConfigureAwait(false); + var imagePath = Result.IcoPath; + var iconDelegate = Result.Icon; + if (ImageLoader.CacheContainImage(imagePath, false)) + { + image = await LoadImageInternalAsync(imagePath, iconDelegate, false).ConfigureAwait(false); + } + else + { + // We need to modify the property not field here to trigger the OnPropertyChanged event + Image = await LoadImageInternalAsync(imagePath, iconDelegate, false).ConfigureAwait(false); + } } private async Task LoadPreviewImageAsync() { var imagePath = Result.PreviewImage ?? Result.IcoPath; - PreviewImage = await LoadImageInternalAsync(Result.IcoPath, Result.Icon, true).ConfigureAwait(false); + var iconDelegate = Result.Icon; + if (ImageLoader.CacheContainImage(imagePath, true)) + { + previewImage = await LoadImageInternalAsync(imagePath, iconDelegate, true).ConfigureAwait(false); + } + else + { + // We need to modify the property not field here to trigger the OnPropertyChanged event + PreviewImage = await LoadImageInternalAsync(imagePath, iconDelegate, true).ConfigureAwait(false); + } } public Result Result { get; } diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index 858588dae..f63a5e5bf 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -609,26 +609,26 @@ namespace Flow.Launcher.ViewModel { new Result { - Title = "Explorer", - SubTitle = "Search for files, folders and file contents", + Title = InternationalizationManager.Instance.GetTranslation("SampleTitleExplorer"), + SubTitle = InternationalizationManager.Instance.GetTranslation("SampleSubTitleExplorer"), IcoPath = Path.Combine(Constant.ProgramDirectory, @"Plugins\Flow.Launcher.Plugin.Explorer\Images\explorer.png") }, new Result { - Title = "WebSearch", - SubTitle = "Search the web with different search engine support", + Title = InternationalizationManager.Instance.GetTranslation("SampleTitleWebSearch"), + SubTitle = InternationalizationManager.Instance.GetTranslation("SampleSubTitleWebSearch"), IcoPath = Path.Combine(Constant.ProgramDirectory, @"Plugins\Flow.Launcher.Plugin.WebSearch\Images\web_search.png") }, new Result { - Title = "Program", - SubTitle = "Launch programs as admin or a different user", + Title = InternationalizationManager.Instance.GetTranslation("SampleTitleProgram"), + SubTitle = InternationalizationManager.Instance.GetTranslation("SampleSubTitleProgram"), IcoPath = Path.Combine(Constant.ProgramDirectory, @"Plugins\Flow.Launcher.Plugin.Program\Images\program.png") }, new Result { - Title = "ProcessKiller", - SubTitle = "Terminate unwanted processes", + Title = InternationalizationManager.Instance.GetTranslation("SampleTitleProcessKiller"), + SubTitle = InternationalizationManager.Instance.GetTranslation("SampleSubTitleProcessKiller"), IcoPath = Path.Combine(Constant.ProgramDirectory, @"Plugins\Flow.Launcher.Plugin.ProcessKiller\Images\app.png") } }; diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Commands/BookmarkLoader.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Commands/BookmarkLoader.cs index 40d10b26f..77d9c64a0 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Commands/BookmarkLoader.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Commands/BookmarkLoader.cs @@ -19,21 +19,28 @@ namespace Flow.Launcher.Plugin.BrowserBookmark.Commands internal static List LoadAllBookmarks(Settings setting) { - - var chromeBookmarks = new ChromeBookmarkLoader(); - var mozBookmarks = new FirefoxBookmarkLoader(); - var edgeBookmarks = new EdgeBookmarkLoader(); - var allBookmarks = new List(); - // Add Firefox bookmarks - allBookmarks.AddRange(mozBookmarks.GetBookmarks()); + if (setting.LoadChromeBookmark) + { + // Add Chrome bookmarks + var chromeBookmarks = new ChromeBookmarkLoader(); + allBookmarks.AddRange(chromeBookmarks.GetBookmarks()); + } - // Add Chrome bookmarks - allBookmarks.AddRange(chromeBookmarks.GetBookmarks()); + if (setting.LoadFirefoxBookmark) + { + // Add Firefox bookmarks + var mozBookmarks = new FirefoxBookmarkLoader(); + allBookmarks.AddRange(mozBookmarks.GetBookmarks()); + } - // Add Edge (Chromium) bookmarks - allBookmarks.AddRange(edgeBookmarks.GetBookmarks()); + if (setting.LoadEdgeBookmark) + { + // Add Edge (Chromium) bookmarks + var edgeBookmarks = new EdgeBookmarkLoader(); + allBookmarks.AddRange(edgeBookmarks.GetBookmarks()); + } foreach (var browser in setting.CustomChromiumBrowsers) { diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml index 8f5396dd7..7c88708f5 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Languages/en.xaml @@ -21,4 +21,5 @@ Data Directory Path Add Delete + Others \ No newline at end of file diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs index 5080ad301..17b794e03 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Models/Settings.cs @@ -10,6 +10,10 @@ namespace Flow.Launcher.Plugin.BrowserBookmark.Models public string BrowserPath { get; set; } + public bool LoadChromeBookmark { get; set; } = true; + public bool LoadFirefoxBookmark { get; set; } = true; + public bool LoadEdgeBookmark { get; set; } = true; + public ObservableCollection CustomChromiumBrowsers { get; set; } = new(); } } \ No newline at end of file diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml index 09ad2101b..12a84cb5a 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml @@ -1,47 +1,66 @@  - + x:Class="Flow.Launcher.Plugin.BrowserBookmark.Views.SettingsControl" + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + d:DesignHeight="300" + d:DesignWidth="500" + DataContext="{Binding RelativeSource={RelativeSource Self}}" + mc:Ignorable="d"> + - + - - - - - - - - - - - + + + + + +