From 2e8c91968f5f2fc4bc19c6a0d6912b88ae3109e2 Mon Sep 17 00:00:00 2001 From: Florian Grabmeier Date: Thu, 1 Feb 2024 16:38:44 +0100 Subject: [PATCH 001/141] Add local plugin installation Signed-off-by: Florian Grabmeier --- .../PluginsManager.cs | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs index 8cd58ac52..b9eaea2d4 100644 --- a/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs +++ b/Plugins/Flow.Launcher.Plugin.PluginsManager/PluginsManager.cs @@ -14,6 +14,8 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; using System.Windows; +using System.IO.Compression; +using Newtonsoft.Json; namespace Flow.Launcher.Plugin.PluginsManager { @@ -138,6 +140,12 @@ namespace Flow.Launcher.Plugin.PluginsManager MessageBoxButton.YesNo) == MessageBoxResult.No) return; + if (File.Exists(plugin.UrlDownload)) + { + Install(plugin, plugin.UrlDownload); + return; + } + // at minimum should provide a name, but handle plugin that is not downloaded from plugins manifest and is a url download var downloadFilename = string.IsNullOrEmpty(plugin.Version) ? $"{plugin.Name}-{Guid.NewGuid()}.zip" @@ -470,6 +478,54 @@ namespace Flow.Launcher.Plugin.PluginsManager return new List { result }; } + internal List InstallFromLocal(string path) + { + if (string.IsNullOrEmpty(path) || !File.Exists(path)) + { + return new List(); + } + + var plugin = null as UserPlugin; + + using (ZipArchive archive = ZipFile.OpenRead(path)) + { + var pluginJsonPath = archive.Entries.FirstOrDefault(x => x.Name == "plugin.json").ToString(); + ZipArchiveEntry pluginJsonEntry = archive.GetEntry(pluginJsonPath); + + if (pluginJsonEntry != null) + { + using (StreamReader reader = new StreamReader(pluginJsonEntry.Open())) + { + string pluginJsonContent = reader.ReadToEnd(); + plugin = JsonConvert.DeserializeObject(pluginJsonContent); + plugin.IcoPath = Path.Combine(path, pluginJsonEntry.FullName.Split('/')[0], plugin.IcoPath); + } + } + } + + if (plugin == null) + { + return new List(); + } + + plugin.UrlDownload = path; + + var result = new Result + { + Title = plugin.Name, + SubTitle = plugin.UrlDownload, + IcoPath = plugin.IcoPath, + Action = e => + { + Application.Current.MainWindow.Hide(); + _ = InstallOrUpdateAsync(plugin); + + return ShouldHideWindow; + } + }; + return new List { result }; + } + private bool InstallSourceKnown(string url) { var author = url.Split('/')[3]; @@ -489,6 +545,9 @@ namespace Flow.Launcher.Plugin.PluginsManager && search.Split('.').Last() == zip) return InstallFromWeb(search); + if (File.Exists(search) && search.Split('.').Last() == zip) + return InstallFromLocal(search); + var results = PluginsManifest .UserPlugins From 1dd526a2f984e1876f912a4d6a27f3f753f7a33e Mon Sep 17 00:00:00 2001 From: Florian Grabmeier Date: Sun, 4 Feb 2024 17:29:05 +0100 Subject: [PATCH 002/141] Add update from local file Signed-off-by: Florian Grabmeier --- .../Images/zipfolder.png | Bin 0 -> 2939 bytes .../PluginsManager.cs | 126 +++++++++++++++++- 2 files changed, 121 insertions(+), 5 deletions(-) create mode 100644 Plugins/Flow.Launcher.Plugin.PluginsManager/Images/zipfolder.png diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Images/zipfolder.png b/Plugins/Flow.Launcher.Plugin.PluginsManager/Images/zipfolder.png new file mode 100644 index 0000000000000000000000000000000000000000..5d3ed0ace3f8a26662b82611eccd95463f32f8c8 GIT binary patch literal 2939 zcmV->3xxEEP)i4qW7iveum z16oBzMNC8s@qNxuAq%F7b`~q@dk$jEvAH z1Q7W&9nVLj$jZPtuZ4~|T^x@3<`BCuQ~-sZYRY-Wmbr)^svJkF5U~?r91*aia=Wq4 zoxmb-Kpf)HOg|}ysYLFfhvI`65Th4{zPWJh4cTOUc|+2=gQ()fw(?9tRKEx=^__suGCbd{taS^cvz?pSRFQ0GsGTxDv_At|*8lUBqf*)B-Ih`BNl`@5os zK!OA~Dv;=x5?n2*v9qBiK-0)L_N(x5`v4ILeXL)NQgq|)?O0~K3=Bvrg*aZ_PD%tS zRmXvb1rRVo_(2gAoX!HqYm35^L_6i_KtL7sM+t_8!1_2{`C1P7qsu1B2sbK#QG)%W zc*ifK<15#bp1%r7chIW-<0x7!;_rQtp$%73-u5DHZx(F*@~JO?2*JQ8-U&TU&wY$9%JRe zJ^)YLOKZ^8C_=$F6jtWO{{@Be2n_F1%EL7gm?VH#fWGB|-aAhoWx8W#D{Q-$0!0h=w2-B z*%BR^h=SZUqMF~T53UrxE}EKKMhA>S@o*TWlrp8UIi zfUsJNr(?*}Ff_JQ%lNa;X5ce7APQ2)3#mYH-ual|eX=|M0@-*!V!W*bun?wt5FgxX zxq*H_Q7I5+l99iP|D3RZ*b1Vxe;T+UYAMATHf(x`zW_%$2@&9vLm4YZ3SsTun3Dhjhzc{`Na5FLTV4|&uKAUNBtQU(vb0`r1?)0t5&nEAz`5za_sIJU}ZmWz@70e*wY@WDRt!JoMbqlW<`Dp~us`;Cf(Vn2Mf4 z`~?Us=c&Ae~OhP2ml;5p6^@{O{0zh9j6`UmSCohnik?e z5_W*n_Ct@)y9Cb4KrjX;{P@uG0~?a?bO|ugbK(7$p!g~jrYw=4^S#60;~#*%k3u^B z4Ltr9IvEHQUcR*PdtUn)Q~)Rbi;CkffGQNSuzNGSysrNBZ~Ydw-2wRwtyIKxp$-%> zu=Qrx{AJkp7*Q1;$D#+Gg6F>muUrGU6qpoANXEs#4*;S){w}oTVBZr^IfsATaz2mr ze;d~oR(3zgWh?K5A)qY{l8WbotizBH0jN#F2;>XUS!Cyq9o%vIdO$hu8*d`#0by-_ zZi3$CksJZWQ3VTa?Va?V*hgRu$M?PivjH;-!!DGv;Ivx6j56N6&dQDQ`o1|l_~;63 z*|28G%cOH>(%{)}8)%}_Np>aY>Qe;0!WApQZVq$j>Ys3&5EXpRS-1VkD(G(r4T6R661a#DJ?(^ zR9$|uVm*pt(uQ5Te73%uCht`lEaiD^%K|!rkhy*RP{}p)s+c$+6JO%sn^)EaH#cb3W$Cn#fQ@kP}E(kCRV+E)< zU?LZUYRwG^p6j!>*v>7_oE2T;CSyV-IRaRLLbU0kG~`hYU0h=c)R1v~+OuOU>E6R7 zr*8z$LXZsanhYxe3MF3Ov54z8tYysRC=L!VuXB+8p;=sZ$`*d{ty{^CxugrjFj{+E zSgbuzL^4`{SV)K5^yInRv*lCiGUzUQIIHjW!~O1p93bty&D&D`{qToXG$!c z8?baCn832`jK`RN-0sK?#d|z(BWsFRB&QFs2C5lOTJR1h9S1MG)WL9hIrG{F*)`b5 z&Mhahb)b`-gR{Byhku5YpNNh){uYj-5`~s2z=@J?O6_|FR44}?jtQC5{z2{iJjrlF z$q^v!Q>}Wef9f;_CCdx%cF~g`Vc%$hRZDhq_NgzC3Ioo%-qZd(~I+)i(ypV#*t&(hvkxoGVs_y8DkVJtZ_VhM?Y0D+-Wo@(Hdas!M+ zBVa+XYNAA309YpxHGiCBv;Y+-dHnp$hsb*sMr@vKJ1noflcgZ$>6A~|PqAtHG6)Qq1nkZrDK2O-YN9tz)!a)pbm>l) z>FGK^cm4oZo%H~uEL74>Hnc7u=L;O-OaD+8Yd`lAzxwV*+_He@!$=|i{@)dW$x%?1 z#3ZmLV^v6*05=~*g+7{(ci{`s>b(KG2__5B7yglQ{MXS;#fTDECt9oPd(AedJ{1FP z_AX8ty9*`@u( x.Name == "plugin.json").ToString(); + ZipArchiveEntry pluginJsonEntry = archive.GetEntry(pluginJsonPath); + + if (pluginJsonEntry != null) + { + using (StreamReader reader = new StreamReader(pluginJsonEntry.Open())) + { + string pluginJsonContent = await reader.ReadToEndAsync(); + plugin = JsonConvert.DeserializeObject(pluginJsonContent); + plugin.IcoPath = "Images\\zipfolder.png"; + } + } + } + if (plugin == null) + { + return new List + { + new Result + { + Title = Context.API.GetTranslation("plugin_pluginsmanager_update_noresult_title"), + SubTitle = Context.API.GetTranslation("plugin_pluginsmanager_update_noresult_subtitle"), + IcoPath = icoPath + } + }; + } + + var pluginOld = Context.API.GetAllPlugins().FirstOrDefault(x => x.Metadata.ID == plugin.ID); + + return new List { + new Result + { + + Title = $"{plugin.Name} by {plugin.Author}", + SubTitle = $"Update from version {pluginOld.Metadata.Version} to {plugin.Version}", + IcoPath = pluginOld.Metadata.IcoPath, + Action = e => + { + string message; + if (Settings.AutoRestartAfterChanging) + { + message = string.Format( + Context.API.GetTranslation("plugin_pluginsmanager_update_prompt"), + plugin.Name, plugin.Author, + Environment.NewLine, Environment.NewLine); + } + else + { + message = string.Format( + Context.API.GetTranslation("plugin_pluginsmanager_update_prompt_no_restart"), + plugin.Name, plugin.Author, + Environment.NewLine); + } + + if (MessageBox.Show(message, + Context.API.GetTranslation("plugin_pluginsmanager_update_title"), + MessageBoxButton.YesNo) != MessageBoxResult.Yes) + { + return false; + } + + var downloadToFilePath = search; + + + PluginManager.UpdatePlugin(pluginOld.Metadata, plugin, + downloadToFilePath); + + if (Settings.AutoRestartAfterChanging) + { + Context.API.ShowMsg( + Context.API.GetTranslation("plugin_pluginsmanager_update_title"), + string.Format( + Context.API.GetTranslation( + "plugin_pluginsmanager_update_success_restart"), + plugin.Name)); + Context.API.RestartApp(); + } + else + { + Context.API.ShowMsg( + Context.API.GetTranslation("plugin_pluginsmanager_update_title"), + string.Format( + Context.API.GetTranslation( + "plugin_pluginsmanager_update_success_no_restart"), + plugin.Name)); + } + + return true; + + }, + ContextData = + new UserPlugin + { + Website = plugin.Website, + UrlSourceCode = plugin.UrlSourceCode + } + }}; + } + var resultsForUpdate = ( from existingPlugin in Context.API.GetAllPlugins() join pluginFromManifest in PluginsManifest.UserPlugins @@ -498,7 +610,7 @@ namespace Flow.Launcher.Plugin.PluginsManager { string pluginJsonContent = reader.ReadToEnd(); plugin = JsonConvert.DeserializeObject(pluginJsonContent); - plugin.IcoPath = Path.Combine(path, pluginJsonEntry.FullName.Split('/')[0], plugin.IcoPath); + plugin.IcoPath = "Images\\zipfolder.png"; } } } @@ -584,7 +696,11 @@ namespace Flow.Launcher.Plugin.PluginsManager try { PluginManager.InstallPlugin(plugin, downloadedFilePath); - File.Delete(downloadedFilePath); + if (downloadedFilePath.StartsWith(Path.GetTempPath())) + { + File.Delete(downloadedFilePath); + } + } catch (FileNotFoundException e) { From a140b118e59e782f1cf58034aec928718cc7f0e7 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 27 Apr 2024 20:00:24 +0900 Subject: [PATCH 003/141] - Split Style Code to SettingWindowStyle - Adjust Navigation Style - Add General.xaml --- Flow.Launcher/Flow.Launcher.csproj | 4 + .../Resources/CustomControlTemplate.xaml | 1649 +++++ .../Resources/SettingWindowStyle.xaml | 440 ++ Flow.Launcher/SettingPages/General.xaml | 19 + Flow.Launcher/SettingPages/General.xaml.cs | 22 + .../ViewModels/GeneralViewModel.cs | 26 + Flow.Launcher/SettingWindow.xaml | 6422 ++++++++--------- Flow.Launcher/SettingWindow.xaml.cs | 24 + .../ViewModel/SettingWindowViewModel.cs | 7 + 9 files changed, 5261 insertions(+), 3352 deletions(-) create mode 100644 Flow.Launcher/Resources/SettingWindowStyle.xaml create mode 100644 Flow.Launcher/SettingPages/General.xaml create mode 100644 Flow.Launcher/SettingPages/General.xaml.cs create mode 100644 Flow.Launcher/SettingPages/ViewModels/GeneralViewModel.cs diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index 53c1bafc7..c280c3c7e 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -111,6 +111,10 @@ + + + + diff --git a/Flow.Launcher/Resources/CustomControlTemplate.xaml b/Flow.Launcher/Resources/CustomControlTemplate.xaml index 2ce53bfdb..e52143fa5 100644 --- a/Flow.Launcher/Resources/CustomControlTemplate.xaml +++ b/Flow.Launcher/Resources/CustomControlTemplate.xaml @@ -3695,4 +3695,1653 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + - - - - + + + + + + + + @@ -609,1579 +212,2195 @@ Grid.Row="0" Width="50" Height="50" + RenderOptions.BitmapScalingMode="HighQuality" Source="images/app.png" /> + TextAlignment="Center" /> - - - - - - - - - - - -  - - - - - - - - - - - - - - - - -  - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - -  - - - - - - - - - - - - -  - - - - - - - - - - - -  - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +  + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + - - - - - - - -  - - - - - - - + - - + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + +  + + + + + - - - - - - - - -  - - - - - + + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + +  + + + + + + + + + + - - - -  - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - -  - - - - - - + Click="OnTestProxyClick" + Content="{DynamicResource testProxy}" + IsEnabled="{Binding Settings.Proxy.Enabled}" /> + + + + - - - - - + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + +  + + + + + + + + + + + + + diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 8144c8ff8..0bba24997 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -24,6 +24,7 @@ using KeyEventArgs = System.Windows.Input.KeyEventArgs; using MessageBox = System.Windows.MessageBox; using TextBox = System.Windows.Controls.TextBox; using ThemeManager = ModernWpf.ThemeManager; +using Flow.Launcher.SettingPages.Views; namespace Flow.Launcher { @@ -503,5 +504,28 @@ namespace Flow.Launcher { Keyboard.Focus(pluginFilterTxb); } + + /** For Navigation View **/ + private void NavigationView_SelectionChanged(ModernWpf.Controls.NavigationView sender, ModernWpf.Controls.NavigationViewSelectionChangedEventArgs args) + { + if (args.IsSettingsSelected) + { + contentFrame.Navigate(typeof(General)); + } + else + { + var selectedItem = (ModernWpf.Controls.NavigationViewItem)args.SelectedItem; + if (selectedItem == null) + { + return; + } + string selectedItemTag = (string)selectedItem.Tag; + + sender.Header = (string)selectedItem.Content; + string pageName = $"Flow.Launcher.SettingPages.Views.{selectedItemTag}"; + Type pageType = typeof(About).Assembly.GetType(pageName); + contentFrame.Navigate(pageType, settings); + } + } } } diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index fe1ea4e7b..efd37b0e1 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -24,6 +24,7 @@ using CommunityToolkit.Mvvm.Input; using System.Globalization; using System.Runtime.CompilerServices; using Flow.Launcher.Infrastructure.Hotkey; +using ModernWpf.Media.Animation; namespace Flow.Launcher.ViewModel { @@ -33,6 +34,12 @@ namespace Flow.Launcher.ViewModel private readonly IPortable _portable; private readonly FlowLauncherJsonStorage _storage; + /* For Navigation View */ + private NavigationTransitionInfo _transitionInfo = new SlideNavigationTransitionInfo() + { + Effect = SlideNavigationTransitionEffect.FromBottom + }; + public SettingWindowViewModel(Updater updater, IPortable portable) { _updater = updater; From b4570e9aaa497037abb8e97be2c3cf8ded7bc723 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 27 Apr 2024 21:57:55 +0900 Subject: [PATCH 004/141] - Add Pages --- Flow.Launcher/Flow.Launcher.csproj | 4 - .../Resources/SettingWindowStyle.xaml | 4 + Flow.Launcher/SettingPages/General.xaml | 19 - Flow.Launcher/SettingPages/General.xaml.cs | 22 - .../ViewModels/GeneralViewModel.cs | 49 +- Flow.Launcher/SettingPages/Views/About.xaml | 232 ++ .../SettingPages/Views/About.xaml.cs | 37 + Flow.Launcher/SettingPages/Views/General.xaml | 517 +++ .../SettingPages/Views/General.xaml.cs | 51 + Flow.Launcher/SettingPages/Views/Hotkey.xaml | 471 +++ .../SettingPages/Views/Hotkey.xaml.cs | 28 + .../SettingPages/Views/PluginStore.xaml | 347 ++ .../SettingPages/Views/PluginStore.xaml.cs | 28 + Flow.Launcher/SettingPages/Views/Plugins.xaml | 384 +++ .../SettingPages/Views/Plugins.xaml.cs | 28 + Flow.Launcher/SettingPages/Views/Proxy.xaml | 180 + .../SettingPages/Views/Proxy.xaml.cs | 28 + Flow.Launcher/SettingPages/Views/Theme.xaml | 744 +++++ .../SettingPages/Views/Theme.xaml.cs | 25 + Flow.Launcher/SettingWindow.xaml | 2933 ----------------- Flow.Launcher/SettingWindow.xaml.cs | 166 +- .../ViewModel/SettingWindowViewModel.cs | 23 - 22 files changed, 3235 insertions(+), 3085 deletions(-) delete mode 100644 Flow.Launcher/SettingPages/General.xaml delete mode 100644 Flow.Launcher/SettingPages/General.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/About.xaml create mode 100644 Flow.Launcher/SettingPages/Views/About.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/General.xaml create mode 100644 Flow.Launcher/SettingPages/Views/General.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/Hotkey.xaml create mode 100644 Flow.Launcher/SettingPages/Views/Hotkey.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/PluginStore.xaml create mode 100644 Flow.Launcher/SettingPages/Views/PluginStore.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/Plugins.xaml create mode 100644 Flow.Launcher/SettingPages/Views/Plugins.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/Proxy.xaml create mode 100644 Flow.Launcher/SettingPages/Views/Proxy.xaml.cs create mode 100644 Flow.Launcher/SettingPages/Views/Theme.xaml create mode 100644 Flow.Launcher/SettingPages/Views/Theme.xaml.cs diff --git a/Flow.Launcher/Flow.Launcher.csproj b/Flow.Launcher/Flow.Launcher.csproj index c280c3c7e..53c1bafc7 100644 --- a/Flow.Launcher/Flow.Launcher.csproj +++ b/Flow.Launcher/Flow.Launcher.csproj @@ -111,10 +111,6 @@ - - - - diff --git a/Flow.Launcher/Resources/SettingWindowStyle.xaml b/Flow.Launcher/Resources/SettingWindowStyle.xaml index 97671b088..485a0159d 100644 --- a/Flow.Launcher/Resources/SettingWindowStyle.xaml +++ b/Flow.Launcher/Resources/SettingWindowStyle.xaml @@ -20,6 +20,10 @@ + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + + +  + + + + + + + + + + + + +  + + + + + + + + + + + +  + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/SettingPages/Views/PluginStore.xaml.cs b/Flow.Launcher/SettingPages/Views/PluginStore.xaml.cs new file mode 100644 index 000000000..3d756f6fa --- /dev/null +++ b/Flow.Launcher/SettingPages/Views/PluginStore.xaml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Flow.Launcher.SettingPages.Views +{ + /// + /// PluginStore.xaml에 대한 상호 작용 논리 + /// + public partial class PluginStore : Page + { + public PluginStore() + { + InitializeComponent(); + } + } +} diff --git a/Flow.Launcher/SettingPages/Views/Plugins.xaml b/Flow.Launcher/SettingPages/Views/Plugins.xaml new file mode 100644 index 000000000..d0545de11 --- /dev/null +++ b/Flow.Launcher/SettingPages/Views/Plugins.xaml @@ -0,0 +1,384 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +  + + + - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - -  - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - -  - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - - - - -  - - - - - - - - - - - - - -  - - - - - - - - - - - - diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 0bba24997..8f3edc872 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -42,7 +42,7 @@ namespace Flow.Launcher API = api; InitializePosition(); InitializeComponent(); - + NavView.SelectedItem = NavView.MenuItems[0]; /* Set First Page */ } #region General @@ -54,28 +54,28 @@ namespace Flow.Launcher // https://stackoverflow.com/questions/4951058/software-rendering-mode-wpf HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource; HwndTarget hwndTarget = hwndSource.CompositionTarget; - hwndTarget.RenderMode = RenderMode.SoftwareOnly; + hwndTarget.RenderMode = RenderMode.Default; - pluginListView = (CollectionView)CollectionViewSource.GetDefaultView(Plugins.ItemsSource); - pluginListView.Filter = PluginListFilter; + //pluginListView = (CollectionView)CollectionViewSource.GetDefaultView(Plugins.ItemsSource); + //pluginListView.Filter = PluginListFilter; - pluginStoreView = (CollectionView)CollectionViewSource.GetDefaultView(StoreListBox.ItemsSource); - pluginStoreView.Filter = PluginStoreFilter; + //pluginStoreView = (CollectionView)CollectionViewSource.GetDefaultView(StoreListBox.ItemsSource); + //pluginStoreView.Filter = PluginStoreFilter; - viewModel.PropertyChanged += new PropertyChangedEventHandler(SettingsWindowViewModelChanged); + //viewModel.PropertyChanged += new PropertyChangedEventHandler(SettingsWindowViewModelChanged); InitializePosition(); } - private void SettingsWindowViewModelChanged(object sender, PropertyChangedEventArgs e) - { - if (e.PropertyName == nameof(viewModel.ExternalPlugins)) - { - pluginStoreView = (CollectionView)CollectionViewSource.GetDefaultView(StoreListBox.ItemsSource); - pluginStoreView.Filter = PluginStoreFilter; - pluginStoreView.Refresh(); - } - } + //private void SettingsWindowViewModelChanged(object sender, PropertyChangedEventArgs e) + //{ + // if (e.PropertyName == nameof(viewModel.ExternalPlugins)) + // { + // pluginStoreView = (CollectionView)CollectionViewSource.GetDefaultView(StoreListBox.ItemsSource); + // pluginStoreView.Filter = PluginStoreFilter; + // pluginStoreView.Refresh(); + // } + //} private void OnSelectPythonPathClick(object sender, RoutedEventArgs e) { @@ -375,75 +375,75 @@ namespace Flow.Launcher private CollectionView pluginListView; private CollectionView pluginStoreView; - private bool PluginListFilter(object item) - { - if (string.IsNullOrEmpty(pluginFilterTxb.Text)) - return true; - if (item is PluginViewModel model) - { - return StringMatcher.FuzzySearch(pluginFilterTxb.Text, model.PluginPair.Metadata.Name).IsSearchPrecisionScoreMet(); - } - return false; - } + //private bool PluginListFilter(object item) + //{ + // if (string.IsNullOrEmpty(pluginFilterTxb.Text)) + // return true; + // if (item is PluginViewModel model) + // { + // return StringMatcher.FuzzySearch(pluginFilterTxb.Text, model.PluginPair.Metadata.Name).IsSearchPrecisionScoreMet(); + // } + // return false; + //} - private bool PluginStoreFilter(object item) - { - if (string.IsNullOrEmpty(pluginStoreFilterTxb.Text)) - return true; - if (item is PluginStoreItemViewModel model) - { - return StringMatcher.FuzzySearch(pluginStoreFilterTxb.Text, model.Name).IsSearchPrecisionScoreMet() - || StringMatcher.FuzzySearch(pluginStoreFilterTxb.Text, model.Description).IsSearchPrecisionScoreMet(); - } - return false; - } + //private bool PluginStoreFilter(object item) + //{ + // if (string.IsNullOrEmpty(pluginStoreFilterTxb.Text)) + // return true; + // if (item is PluginStoreItemViewModel model) + // { + // return StringMatcher.FuzzySearch(pluginStoreFilterTxb.Text, model.Name).IsSearchPrecisionScoreMet() + // || StringMatcher.FuzzySearch(pluginStoreFilterTxb.Text, model.Description).IsSearchPrecisionScoreMet(); + // } + // return false; + //} private string lastPluginListSearch = ""; private string lastPluginStoreSearch = ""; - private void RefreshPluginListEventHandler(object sender, RoutedEventArgs e) - { - if (pluginFilterTxb.Text != lastPluginListSearch) - { - lastPluginListSearch = pluginFilterTxb.Text; - pluginListView.Refresh(); - } - } + //private void RefreshPluginListEventHandler(object sender, RoutedEventArgs e) + //{ + // if (pluginFilterTxb.Text != lastPluginListSearch) + // { + // lastPluginListSearch = pluginFilterTxb.Text; + // pluginListView.Refresh(); + // } + //} - private void RefreshPluginStoreEventHandler(object sender, RoutedEventArgs e) - { - if (pluginStoreFilterTxb.Text != lastPluginStoreSearch) - { - lastPluginStoreSearch = pluginStoreFilterTxb.Text; - pluginStoreView.Refresh(); - } - } + //private void RefreshPluginStoreEventHandler(object sender, RoutedEventArgs e) + //{ + // if (pluginStoreFilterTxb.Text != lastPluginStoreSearch) + // { + // lastPluginStoreSearch = pluginStoreFilterTxb.Text; + // pluginStoreView.Refresh(); + // } + //} - private void PluginFilterTxb_OnKeyDown(object sender, KeyEventArgs e) - { - if (e.Key == Key.Enter) - RefreshPluginListEventHandler(sender, e); - } + //private void PluginFilterTxb_OnKeyDown(object sender, KeyEventArgs e) + //{ + // if (e.Key == Key.Enter) + // RefreshPluginListEventHandler(sender, e); + //} - private void PluginStoreFilterTxb_OnKeyDown(object sender, KeyEventArgs e) - { - if (e.Key == Key.Enter) - RefreshPluginStoreEventHandler(sender, e); - } + //private void PluginStoreFilterTxb_OnKeyDown(object sender, KeyEventArgs e) + //{ + // if (e.Key == Key.Enter) + // RefreshPluginStoreEventHandler(sender, e); + //} - private void OnPluginSettingKeydown(object sender, KeyEventArgs e) - { - if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control && e.Key == Key.F) - pluginFilterTxb.Focus(); - } + //private void OnPluginSettingKeydown(object sender, KeyEventArgs e) + //{ + // if ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control && e.Key == Key.F) + // pluginFilterTxb.Focus(); + //} - private void PluginStore_OnKeyDown(object sender, KeyEventArgs e) - { - if (e.Key == Key.F && (Keyboard.Modifiers & ModifierKeys.Control) != 0) - { - pluginStoreFilterTxb.Focus(); - } - } + //private void PluginStore_OnKeyDown(object sender, KeyEventArgs e) + //{ + // if (e.Key == Key.F && (Keyboard.Modifiers & ModifierKeys.Control) != 0) + // { + // pluginStoreFilterTxb.Focus(); + // } + //} public void InitializePosition() { @@ -495,15 +495,15 @@ namespace Flow.Launcher } - private void PluginStore_GotFocus(object sender, RoutedEventArgs e) - { - Keyboard.Focus(pluginStoreFilterTxb); - } + //private void PluginStore_GotFocus(object sender, RoutedEventArgs e) + //{ + // Keyboard.Focus(pluginStoreFilterTxb); + //} - private void Plugin_GotFocus(object sender, RoutedEventArgs e) - { - Keyboard.Focus(pluginFilterTxb); - } + //private void Plugin_GotFocus(object sender, RoutedEventArgs e) + //{ + // Keyboard.Focus(pluginFilterTxb); + //} /** For Navigation View **/ private void NavigationView_SelectionChanged(ModernWpf.Controls.NavigationView sender, ModernWpf.Controls.NavigationViewSelectionChangedEventArgs args) diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index efd37b0e1..aa16e7cb7 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -481,29 +481,6 @@ namespace Flow.Launcher.ViewModel } } - public class SearchWindowScreen - { - public string Display { get; set; } - public SearchWindowScreens Value { get; set; } - } - - public List SearchWindowScreens - { - get - { - List modes = new List(); - var enums = (SearchWindowScreens[])Enum.GetValues(typeof(SearchWindowScreens)); - foreach (var e in enums) - { - var key = $"SearchWindowScreen{e}"; - var display = _translater.GetTranslation(key); - var m = new SearchWindowScreen { Display = display, Value = e, }; - modes.Add(m); - } - - return modes; - } - } public class SearchWindowAlign { From 6a2f23cf6bb22707280c2d681243ea6fc30b8bc5 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 27 Apr 2024 22:48:03 +0900 Subject: [PATCH 005/141] - Add Color Icons in Menu --- Flow.Launcher/Images/info.png | Bin 0 -> 1367 bytes Flow.Launcher/Images/keyboard.png | Bin 0 -> 873 bytes Flow.Launcher/Images/plugins.png | Bin 0 -> 804 bytes Flow.Launcher/Images/proxy.png | Bin 0 -> 1757 bytes Flow.Launcher/Images/store.png | Bin 0 -> 763 bytes Flow.Launcher/Images/theme.png | Bin 0 -> 1071 bytes .../Resources/CustomControlTemplate.xaml | 4 +++- Flow.Launcher/SettingWindow.xaml | 14 +++++++------- 8 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 Flow.Launcher/Images/info.png create mode 100644 Flow.Launcher/Images/keyboard.png create mode 100644 Flow.Launcher/Images/plugins.png create mode 100644 Flow.Launcher/Images/proxy.png create mode 100644 Flow.Launcher/Images/store.png create mode 100644 Flow.Launcher/Images/theme.png diff --git a/Flow.Launcher/Images/info.png b/Flow.Launcher/Images/info.png new file mode 100644 index 0000000000000000000000000000000000000000..75ffe11e0e80ad0abda0b0c6be6bf4fbec510a10 GIT binary patch literal 1367 zcmV-d1*rOoP)e~1+`))7_;wTGnkk_g98p=tV&f=wH13HFy2=%nPJAMqM#@$Uo}43 zQ3uZ(tRDDFa~=JDZ{GLj`yPf}>eJEtKhxS4$U2OYs6} zEuJS=i*>~PA|26Ms3ShkyGN#D|A$oRyn^y&`kKN(|5mYdd|JLlLHQyDW%rMvRDTR5 z3nY}xlTdt*fFd0Mg>wWH-hB)OKR*Wf?9pEZcaFZ4-z8!r4ql{%*DH zu}ndj@F1T#g8Vy2kT>n4a<#r28Cq9#MBo*MCvPiO=sm>>4Lra@uGR;+w+}(4Ik3qz zzIV?RzS2m4qgbI|@C~0c#RwdNY|{IWRPFr{1Bl|693ZOF=x?bs`r-WG4?sF`0NH9U zNX9+ts=n3Nc;l}!`c;vG_kv{13t1y>4OR`W@B#l_#NkIhkU8RkjA2&;61>7ly~B0S z%e8LEQ=1`g+zfdd7YBGZWDL1Z(}q0nbAr#+!=*|ijdOu7(%3-#hyd#3Mc^6VAs~O; z5+3|5H>3}_A#Kp*lMLH0hb>UK;=jRZ<)=MR^Tz=M=cfl=kf~ka!b94C3sUd82TfugzW`TQv-OgpV&7aHgGEKw+T2=321%S}$B%c7zCg zqPK%|+!Z#wxGx|8qHagcnFT7A=`EDgCP!_9&zBr<7bgSHrwshCg*$wY15&yi&NCgW zWripDyd0Gp56DJsARV!ROzlR3ztYVJ*dejg_7?l<8>lZ(;d92UkUg*qlKx$g^zA@a z?+!?Y%t-LbopwlWw|>w51s0EoQGZeld~hUY#XEVJq%0$tlk z@Ja19NKje#*ah^Y6SX~%^gav`$mrZcf=_H?1T0Tk1xocKh1%O>^@IwfcWfcSC#tNF zptPJ~T6pz81&ZehKWbx^*}WYikk+w@2H$Fh%SsDiY;AVQJn2R4DqkwlzKIMU-(o&t z-9p7WVgt1$W(qbqscoBx@D_+`Hal4bispzZ)P9~R*x-m&8%Xf+%@&AlG%v9V6wDFd zq7EZW!G;L5ZXm(OHJKTKM)of-OI}5tq?m#Yj!3zV3J-z?^LwlU%rPaO^?A6Df$l)T z2Ior4Iug9F0rz9o_BYrCFbtE=_!_ywGe;#;u)#^Wxy~6rrojZldVCN&Yh+q)R_?U# zITv{5sALK@M4)+%Gki=Pek!cpFT=t~&TZcc&GQ*0Lp#n)w>m1?nXP4@6S=a&ri3#6loMzaLy}+JlwhgoLNsVieq}&Z3zRm=K z8vHtjl5F+CB95o!1?SP;GYX>@E>@&k!Fji-ys$E zIcLSaj#GZ%@x_?h{Q@k~N$Ihbi+b#1Dc$y`;ltx6G4-aY=sKMJuIJoEI(K3cyX+q% zx7#|C+H8L&s%-wyVZ`!xY@=y4w!zdVtlR(a{PsCd5j7tQg(|B^pmd}%f_%OAA{W8< Z&A)|h%;wC=< literal 0 HcmV?d00001 diff --git a/Flow.Launcher/Images/keyboard.png b/Flow.Launcher/Images/keyboard.png new file mode 100644 index 0000000000000000000000000000000000000000..5ac670419ab080f24aa88343a1054b92c78827d3 GIT binary patch literal 873 zcmV-v1D5=WP)lA4u5iug3Q!I*7lj{uF8>Mu9uXVhb9r;Q7U%!wqR{>T1Lb@3{2lV&A7TJ# z0+A|n{tajXk!t_!E6@ZYRr>S`&;%mY-pOa62}G*Y@h6}OM5^S`NBCDvxmYmS-h(&D zJ@_{esdf)PfLtP}6L_kshsx?YsM9qAm%S{h8#;P$?VXDib3%_VmXlqxw zdEw{?anZo|^a75(!34hemA5@pbDn!=2@o3ybBAyr^Q<5AhEB|8WUr()x9r3D#+O~V z_L?z)wy6yqE>`R@S{?WWJga?y?}pSoVgsR_EYJiZRWOkOnn0uyz92M#Nac_115F@O z`J!o{2}CO4>p>HUR4aivY-}Z|fZdFe8*t3CupZu}0{e`c+yFCd!GAogF9vHNt}J*q zB6#_}Av3vwzF`Z{1R_|J5t5(H&4L_ik= zFw<>mo9a0(o97~L?p;8#b1c&G}C{O)1jJXyjX{3e45ozu!NOo;l1oL^IX^i zpYO7~0}h8h_Sj>OJuRF2+qbyEtsQP~8@RzO;08V%EE(7YqL+Z^8$e>l7J)?9!5Lix zXTPzl;OtxZyUW091>m(M;3LK^0^j={_}+IQ+%t9ogr2vD8=eOt{078u9)#}vju_0} zMETKptuegVZEOyNVD>XIfE`{8y#_Iq1?(qqjMtlipRb7*gV=yGG}aAR{CCj+N|%B{# zSN0`tpX-=DPko7JWxTn7^2FBUlP?|O7n+KfJ0?Nym;l*lYyv9rF3%|L*C=be%k#>D z0ET#1`v@|CG2Vp_Xd&M7FJ5uKL1P)rh&w_ldV0?z(=5`#3_XsDqu$R$j|h18W&q=`mQSj>1xM z6h$S~Os;Aax~foET!n(-N+xF|%uY9xqXPLv_HwEtM7A=jJXBmV( zKTks1GXW`W0@B_INa^E{_Kia(+CL8Y0MQsTU~%E`41DkqE7mRmzIhtPZ>C|~ItAnQ zsW9{|E%YR$p9u7PU|E139D{sl4Dw;3QOFsikTaQbEiUp8Jca=RzHSbNPYC$z0^qu| zck`sR(CHH_;d#KLAy7GM6ms@$$T?iOOgYOjK>AKoCw2LF4u*}hFnp$|iXL2>wy1|l zS_@4Q&d|Z;GAVhtpd7gcC7;VoG(zEXii)E*ATC&17n=GE44==y_@$=fqACl4i+U^q zt!RPGBTx!PpcIZkDIyw%Vqqfi*~>DpQCF8O)9m8ZRwV?kOPka~^jJXW-Ch8An88|y zq1cFqpxB3CaxfA2?7~%mFdB55tONH_#M6oz#U!BjlR zPErp;iT% zs)H0hs~}bbWi_lashZS77w9OYv_7n@9zplm14svYG>LO?ecB>vp0aH7pnGx->(2GV zRJ-2wGz57fFosC5CT z$GJ`fD12rt2E;uMt&HgUzHvzDgLpkZh?e15EHzF2(~vFQkZs*)8kk!0^Pb5WtUlER zQ%yJ2lK~{w_cHy`%M6%fHgJqpX72>s=ZD5%O!vb-@c_||Z0msR=!p9By;E~A9cxG8 zsa_?4)j4b^RG!9Ndadko|?L^a16#u}T8LU3j z3AMfxiNE@hc!ujYV!$4o0dZ?g*CRPa`G%nv>5%~>=lW1^eLVEzN)2kgi`3kx`qL|Nfc`*U4v>RTYGei)bfk*L?GO0QH=&aOtr1>-kZhx zD*>qW?MOW9rLa`zdyw>pkEzjzjQp4lum_V6d_IRKtI;;h)}m_=io*}t)&-^1A2qnB zg?icpQ++Gc22U8ck*mpvqzgn|BsF^}d~62zQ`MvJ{2(IxoSc?4^?tUy`Oc=RZxL`> z4{geg8sKIIoOF@vPbLC?_=q)n1LBd8!iz(R97s-n_mz>C!D19bI81%AO7 z0k|7Um$)u75%|~*xT+(=mveY+W%Q{x^s-G730#}@MIAH;PQF6a#dNi683y>ncnF@{ z29yje4zEvLY?8&mFGYa9%5^QQm<@pZZeZ*Sa17PX3$7gX9|?ti0h_h5`N(YTgCAApHEwB%Rl!t_Qyy z0sQ)WXac;lMWfb^*bSJS?%*=tpwV|Y;ysRd7#EL(^udJR8jBmWOmfQdlUA(D$g)KL zV$1BRTw`{)gE7BBv+ChpOTuT)gI~yirSD+A?ahQ|Ih%LwfmR9swb>ju@RVoO_V$ab zcH9Kj&UU=2(JNGKR4=E5^-@Y}NG}ql61CuklpD=Y_3w|Q*982NFp%1Ux8Hde@2%g2 z4VzOI{LTN5foNvcj`rq%ZH3|!pZLTl;aSZ;fr-kPN32xC00000NkvXXu0mjfpb<|o literal 0 HcmV?d00001 diff --git a/Flow.Launcher/Images/store.png b/Flow.Launcher/Images/store.png new file mode 100644 index 0000000000000000000000000000000000000000..a4b19c8f9337fd4f8282973b7dbe19defa593be5 GIT binary patch literal 763 zcmVwF@z3GK^8{ODX&W3rAi&0PGf(gh5Y)sf- zc;v<^Q#MCSNaUi)#*Yj(9SFi0@gESv0S3mz1Bw3uXX8l|V?e*AXlHG@bnUWtn7mK& zIXz3C_tU<~5F#NVA^GofqcnZgemD&pDPcKWG{N18Cb)xWg8RxQcu+#e;m=_!JWtq) z#`*n+lhe0rK0KS?&MFPnOMorIoz)~Eym|GJdJ6CmjdSm75s+M)8CRv>3HMpEK#4!7 z^gLnfuK@pDw}A9b=zd5ew^<^fKP>qIh+LtX!jdb55E>hgfe6B!F}>SuJF$iKlKy|! zx>4f6y)&_-D&XFG{Gs88JygcM_vl#t3+%==FRZ|BY+F^}+U~@7qYv6%fws5oq^f{@ zd)U^x{Qxc^uEI#GssI9X$+Z>v;wp~9MZ#Ge{f0R1vbq35$We$KI|~s|f=T&+n(6>1 z?ZwhL%Zz-i>hR~+Xd_&7Yz~7GbkYOV6A#c+9auU?nedyc1#Ii#8T;!nC?O1q;OOik z>*1%>3#^5PZR;UWLOO<{v;D!k7K&6aurhSh`f3Q2kdEQ#tRicnTU84~fBOSxhF#^l}gl2)}jIY0WsSo5x$8dDb0vTVw z_Ajv5cioif1v%0&9GxlC3&L463)r9guNW7-Ka7h$kV1)n`$-Sr=!^@#pDoK>SCO6= z=DjC|c`rzzXFGvPb^twl7jSfjdG86*8!CNoi=OL&MncW?6m$#F&w3n9sqOIw&H4ZU002ovPDHLkV1hVaWcC06 literal 0 HcmV?d00001 diff --git a/Flow.Launcher/Images/theme.png b/Flow.Launcher/Images/theme.png new file mode 100644 index 0000000000000000000000000000000000000000..9518343b7fe7f827d3c084c01bab9889257acdf1 GIT binary patch literal 1071 zcmV+~1kn45P)&+o!$oH5zeW;8OvWXsGHEn!LqlDdwJ zvNh8XmPO;(#is6%U8pl-W^p9jE<{sjYGetp4rb{%qy@?*g%%jama@$Qd&xB zY3X_WnqC-(imPkWr^J5#fG4kap6_$>0GVZ$S!T(Yck7NL9%02kEX8@YY!}Q4w@2Ki zi)T~sK`rr}zX-$6YY-lovcf*p!Tf?;-{e~L_eL7R{ ze)wQKpmC8p`53k2cS1syhB`h#2X5_44G;@;CbTuRUQAW1IjK2Ts?M3ltTe`y1 z=FUUlVjd~@?t0kVr$H_Wqs0QIK45hD)LVbYw|3d3as{6g{QNnr_cX#g*8qwqzlQhW9A2V!jRjL;}o}tckM#p8_BI+CT{f>|#G~7ofzoBm~TIf)94%IlmH= za6lysaT4HH;aD;PCU!9!R{=MZ6fl@_d`OMLKsP8U0hO#eyh zp8D}bK#gFM-hc$DUQmluK{Y7R0LxxB=Gc$NQ;PRrLQYVNU=jkxC-&nhqPPSjM0bz zbiV+1J;Lr<=v@+4;}k>W5U2PfU2J!+peL+HFmwsFkQTQBJ@_u5!UdlKr+sbs$Rk7f pd=q#!IUZZ|A(>^CS!Vx>{SLrHrRuzJJ*fZy002ovPDHLkV1in_16cq7 literal 0 HcmV?d00001 diff --git a/Flow.Launcher/Resources/CustomControlTemplate.xaml b/Flow.Launcher/Resources/CustomControlTemplate.xaml index e52143fa5..17a9f1f64 100644 --- a/Flow.Launcher/Resources/CustomControlTemplate.xaml +++ b/Flow.Launcher/Resources/CustomControlTemplate.xaml @@ -3697,6 +3697,8 @@ + 48 + + 48 diff --git a/Flow.Launcher/Resources/SettingWindowStyle.xaml b/Flow.Launcher/Resources/SettingWindowStyle.xaml index 485a0159d..97671b088 100644 --- a/Flow.Launcher/Resources/SettingWindowStyle.xaml +++ b/Flow.Launcher/Resources/SettingWindowStyle.xaml @@ -20,10 +20,6 @@ - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index b2839231e..60e4a31b4 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -10,6 +10,7 @@ using Flow.Launcher.Plugin.Explorer.Search.Everything; using System.Windows.Input; using System.Windows.Shapes; using Path = System.IO.Path; +using System.Globalization; namespace Flow.Launcher.Plugin.Explorer.Search { @@ -189,11 +190,11 @@ namespace Flow.Launcher.Plugin.Explorer.Search if (mok == 1) uom = "KB"; else if (mok == 2) - uom = " MB"; + uom = "MB"; else if (mok == 3) - uom = " GB"; + uom = "GB"; else if (mok == 4) - uom = " TB"; + uom = "TB"; var returnStr = $"{Convert.ToInt32(drvSize)}{uom}"; if (mok != 0) @@ -241,14 +242,16 @@ namespace Flow.Launcher.Plugin.Explorer.Search var title = Path.GetFileName(filePath); + /* Preview Detail */ long fileSize = new System.IO.FileInfo(filePath).Length; - string fileSizStr = fileSize.ToString(); + string fileSizStr = ToReadableSize(fileSize, 2); DateTime created = System.IO.File.GetCreationTime(filePath); - string createdStr = created.ToString("yyyy-MM-dd HH:mm:ss"); + string createdStr = created.ToString("yy-M-dd ddd hh:mm", CultureInfo.CurrentCulture); DateTime lastModified = System.IO.File.GetLastWriteTime(filePath); - string lastModifiedStr = lastModified.ToString("yyyy-MM-dd HH:mm:ss"); + string lastModifiedStr = lastModified.ToString("yy-M-dd ddd hh:mm", CultureInfo.CurrentCulture); + var result = new Result From 08687d63cb3511b45a791ea49b5d4e87d41c6d79 Mon Sep 17 00:00:00 2001 From: Yusyuriv Date: Tue, 30 Apr 2024 09:16:43 +0600 Subject: [PATCH 023/141] Implement CardGroup control --- Flow.Launcher/Resources/Controls/Card.xaml | 21 +++++++++++++ Flow.Launcher/Resources/Controls/Card.xaml.cs | 17 ++++++++++ .../Resources/Controls/CardGroup.xaml | 31 +++++++++++++++++++ .../Resources/Controls/CardGroup.xaml.cs | 25 +++++++++++++++ .../Controls/CardGroupCardStyleSelector.cs | 21 +++++++++++++ 5 files changed, 115 insertions(+) create mode 100644 Flow.Launcher/Resources/Controls/CardGroup.xaml create mode 100644 Flow.Launcher/Resources/Controls/CardGroup.xaml.cs create mode 100644 Flow.Launcher/Resources/Controls/CardGroupCardStyleSelector.cs diff --git a/Flow.Launcher/Resources/Controls/Card.xaml b/Flow.Launcher/Resources/Controls/Card.xaml index bc1c42e1f..147c0e650 100644 --- a/Flow.Launcher/Resources/Controls/Card.xaml +++ b/Flow.Launcher/Resources/Controls/Card.xaml @@ -37,6 +37,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/Flow.Launcher/Resources/Controls/Card.xaml.cs b/Flow.Launcher/Resources/Controls/Card.xaml.cs index 06266c775..db4a136a3 100644 --- a/Flow.Launcher/Resources/Controls/Card.xaml.cs +++ b/Flow.Launcher/Resources/Controls/Card.xaml.cs @@ -12,10 +12,27 @@ namespace Flow.Launcher.Resources.Controls InsideFit } + public enum CardGroupPosition + { + NotInGroup, + First, + Middle, + Last + } + public Card() { InitializeComponent(); } + + public CardGroupPosition GroupPosition + { + get { return (CardGroupPosition)GetValue(GroupPositionProperty); } + set { SetValue(GroupPositionProperty, value); } + } + public static readonly DependencyProperty GroupPositionProperty = + DependencyProperty.Register(nameof(GroupPosition), typeof(CardGroupPosition), typeof(Card), new PropertyMetadata(CardGroupPosition.NotInGroup)); + public string Title { get { return (string)GetValue(TitleProperty); } diff --git a/Flow.Launcher/Resources/Controls/CardGroup.xaml b/Flow.Launcher/Resources/Controls/CardGroup.xaml new file mode 100644 index 000000000..d3383d20c --- /dev/null +++ b/Flow.Launcher/Resources/Controls/CardGroup.xaml @@ -0,0 +1,31 @@ + + + + + + + + + + + + diff --git a/Flow.Launcher/Resources/Controls/CardGroup.xaml.cs b/Flow.Launcher/Resources/Controls/CardGroup.xaml.cs new file mode 100644 index 000000000..6ddbf3597 --- /dev/null +++ b/Flow.Launcher/Resources/Controls/CardGroup.xaml.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.ObjectModel; +using System.Windows; +using System.Windows.Controls; + +namespace Flow.Launcher.Resources.Controls; + +public partial class CardGroup : UserControl +{ + public new ObservableCollection Content + { + get { return (ObservableCollection)GetValue(ContentProperty); } + set { SetValue(ContentProperty, value); } + } + + public static readonly DependencyProperty ContentProperty = + DependencyProperty.Register(nameof(Content), typeof(ObservableCollection), typeof(CardGroup)); + + public CardGroup() + { + InitializeComponent(); + DataContext = this; + Content = new ObservableCollection(); + } +} diff --git a/Flow.Launcher/Resources/Controls/CardGroupCardStyleSelector.cs b/Flow.Launcher/Resources/Controls/CardGroupCardStyleSelector.cs new file mode 100644 index 000000000..605934e80 --- /dev/null +++ b/Flow.Launcher/Resources/Controls/CardGroupCardStyleSelector.cs @@ -0,0 +1,21 @@ +using System.Windows; +using System.Windows.Controls; + +namespace Flow.Launcher.Resources.Controls; + +public class CardGroupCardStyleSelector : StyleSelector +{ + public Style FirstStyle { get; set; } + public Style MiddleStyle { get; set; } + public Style LastStyle { get; set; } + + public override Style SelectStyle(object item, DependencyObject container) + { + var itemsControl = ItemsControl.ItemsControlFromItemContainer(container); + var index = itemsControl.ItemContainerGenerator.IndexFromContainer(container); + + if (index == 0) return FirstStyle; + if (index == itemsControl.Items.Count - 1) return LastStyle; + return MiddleStyle; + } +} From a337163d9e6748b4067e5611ca8f5f050c930dc0 Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Wed, 1 May 2024 11:29:43 +0800 Subject: [PATCH 024/141] fix typo --- Flow.Launcher.Plugin/Result.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs index 2d3757ddc..87b9a8b18 100644 --- a/Flow.Launcher.Plugin/Result.cs +++ b/Flow.Launcher.Plugin/Result.cs @@ -276,7 +276,7 @@ namespace Flow.Launcher.Plugin public string ProgressBarColor { get; set; } = "#26a0da"; /// - /// Contains data used to populate the the preview section of this result. + /// Contains data used to populate the preview section of this result. /// public PreviewInfo Preview { get; set; } = PreviewInfo.Default; From fb6b1bb5187d01035a95098147619f8bdb53f871 Mon Sep 17 00:00:00 2001 From: Yusyuriv Date: Wed, 1 May 2024 14:19:20 +0600 Subject: [PATCH 025/141] Fix CardGroup overwriting DataContext of its children --- Flow.Launcher/Resources/Controls/CardGroup.xaml | 3 ++- Flow.Launcher/Resources/Controls/CardGroup.xaml.cs | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/Resources/Controls/CardGroup.xaml b/Flow.Launcher/Resources/Controls/CardGroup.xaml index d3383d20c..5ea9d1e60 100644 --- a/Flow.Launcher/Resources/Controls/CardGroup.xaml +++ b/Flow.Launcher/Resources/Controls/CardGroup.xaml @@ -26,6 +26,7 @@ - + diff --git a/Flow.Launcher/Resources/Controls/CardGroup.xaml.cs b/Flow.Launcher/Resources/Controls/CardGroup.xaml.cs index 6ddbf3597..02f4ca013 100644 --- a/Flow.Launcher/Resources/Controls/CardGroup.xaml.cs +++ b/Flow.Launcher/Resources/Controls/CardGroup.xaml.cs @@ -13,13 +13,12 @@ public partial class CardGroup : UserControl set { SetValue(ContentProperty, value); } } - public static readonly DependencyProperty ContentProperty = + public static new readonly DependencyProperty ContentProperty = DependencyProperty.Register(nameof(Content), typeof(ObservableCollection), typeof(CardGroup)); public CardGroup() { InitializeComponent(); - DataContext = this; Content = new ObservableCollection(); } } From bd867db99aa041b7699e0450287327d0944685f3 Mon Sep 17 00:00:00 2001 From: DB p Date: Thu, 2 May 2024 07:24:33 +0900 Subject: [PATCH 026/141] Add WMP warning --- Flow.Launcher/Languages/en.xaml | 1 + Flow.Launcher/SettingWindow.xaml | 34 +++++++++++++++++++++++++++++ Flow.Launcher/SettingWindow.xaml.cs | 14 ++++++++++-- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index bda86e481..7aca36e22 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -158,6 +158,7 @@ Play a small sound when the search window opens Sound Effect Volume Adjust the volume of the sound effect + Flow Launcher can't play sound because "Windows Media Player" doesn't exist on your system. If you need sound, install WMP. Animation Use Animation in UI Animation Speed diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 84b91e312..fd999585d 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -2561,6 +2561,40 @@ + + + + + + + + + + diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 8144c8ff8..58ffbb149 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -24,6 +24,7 @@ using KeyEventArgs = System.Windows.Input.KeyEventArgs; using MessageBox = System.Windows.MessageBox; using TextBox = System.Windows.Controls.TextBox; using ThemeManager = ModernWpf.ThemeManager; +using System.Diagnostics; namespace Flow.Launcher { @@ -63,9 +64,18 @@ namespace Flow.Launcher viewModel.PropertyChanged += new PropertyChangedEventHandler(SettingsWindowViewModelChanged); + CheckMediaPlayer(); InitializePosition(); } + private void CheckMediaPlayer() + { + + if (!File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Windows Media Player", "wmplayer.exe"))) + { + /* Binding WMPWarning visibility */ + } + } private void SettingsWindowViewModelChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == nameof(viewModel.ExternalPlugins)) @@ -294,8 +304,8 @@ namespace Flow.Launcher } private void window_MouseDown(object sender, MouseButtonEventArgs e) /* for close hotkey popup */ - { - if (Keyboard.FocusedElement is not TextBox textBox) + { + if (Keyboard.FocusedElement is not TextBox textBox) { return; } From aaef48cd16cba97278b08168295e7d888ad627ac Mon Sep 17 00:00:00 2001 From: Yusyuriv Date: Thu, 2 May 2024 20:48:24 +0600 Subject: [PATCH 027/141] Replace Card.GroupPosition with CardGroup.Position attached property --- Flow.Launcher/Resources/Controls/Card.xaml | 6 ++--- Flow.Launcher/Resources/Controls/Card.xaml.cs | 16 ------------- .../Resources/Controls/CardGroup.xaml | 6 ++--- .../Resources/Controls/CardGroup.xaml.cs | 23 +++++++++++++++++++ 4 files changed, 29 insertions(+), 22 deletions(-) diff --git a/Flow.Launcher/Resources/Controls/Card.xaml b/Flow.Launcher/Resources/Controls/Card.xaml index 147c0e650..c29a5f602 100644 --- a/Flow.Launcher/Resources/Controls/Card.xaml +++ b/Flow.Launcher/Resources/Controls/Card.xaml @@ -38,21 +38,21 @@ - + - + - + diff --git a/Flow.Launcher/Resources/Controls/Card.xaml.cs b/Flow.Launcher/Resources/Controls/Card.xaml.cs index db4a136a3..c8f788aca 100644 --- a/Flow.Launcher/Resources/Controls/Card.xaml.cs +++ b/Flow.Launcher/Resources/Controls/Card.xaml.cs @@ -12,27 +12,11 @@ namespace Flow.Launcher.Resources.Controls InsideFit } - public enum CardGroupPosition - { - NotInGroup, - First, - Middle, - Last - } - public Card() { InitializeComponent(); } - public CardGroupPosition GroupPosition - { - get { return (CardGroupPosition)GetValue(GroupPositionProperty); } - set { SetValue(GroupPositionProperty, value); } - } - public static readonly DependencyProperty GroupPositionProperty = - DependencyProperty.Register(nameof(GroupPosition), typeof(CardGroupPosition), typeof(Card), new PropertyMetadata(CardGroupPosition.NotInGroup)); - public string Title { get { return (string)GetValue(TitleProperty); } diff --git a/Flow.Launcher/Resources/Controls/CardGroup.xaml b/Flow.Launcher/Resources/Controls/CardGroup.xaml index 5ea9d1e60..f48bf4b6c 100644 --- a/Flow.Launcher/Resources/Controls/CardGroup.xaml +++ b/Flow.Launcher/Resources/Controls/CardGroup.xaml @@ -9,13 +9,13 @@ d:DesignHeight="300" d:DesignWidth="300"> Content { get { return (ObservableCollection)GetValue(ContentProperty); } @@ -16,6 +24,21 @@ public partial class CardGroup : UserControl public static new readonly DependencyProperty ContentProperty = DependencyProperty.Register(nameof(Content), typeof(ObservableCollection), typeof(CardGroup)); + public static readonly DependencyProperty PositionProperty = DependencyProperty.RegisterAttached( + "Position", typeof(CardGroupPosition), typeof(CardGroup), + new FrameworkPropertyMetadata(CardGroupPosition.NotInGroup, FrameworkPropertyMetadataOptions.AffectsRender) + ); + + public static void SetPosition(UIElement element, CardGroupPosition value) + { + element.SetValue(PositionProperty, value); + } + + public static CardGroupPosition GetPosition(UIElement element) + { + return (CardGroupPosition)element.GetValue(PositionProperty); + } + public CardGroup() { InitializeComponent(); From a4f7a47fbb8dff0cec8a7db8ea5bfcffd991277e Mon Sep 17 00:00:00 2001 From: DB P Date: Fri, 3 May 2024 06:53:14 +0900 Subject: [PATCH 028/141] Update Flow.Launcher/Languages/en.xaml Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> --- 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 7aca36e22..9962646c6 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -158,7 +158,7 @@ Play a small sound when the search window opens Sound Effect Volume Adjust the volume of the sound effect - Flow Launcher can't play sound because "Windows Media Player" doesn't exist on your system. If you need sound, install WMP. + Sound effect is unavailable because Windows Media Player is missing. Please install it if you need sound effect. Animation Use Animation in UI Animation Speed From 336e9726829a0df0246c65e80b01869f2d1d59f0 Mon Sep 17 00:00:00 2001 From: Yusyuriv Date: Fri, 3 May 2024 05:05:41 +0600 Subject: [PATCH 029/141] Fully functional Hotkey pane in the settings window --- Flow.Launcher/CustomShortcutSetting.xaml.cs | 2 +- .../SettingsPaneGeneralViewModel.cs | 10 +- .../ViewModels/SettingsPaneHotkeyViewModel.cs | 134 +++ .../Views/SettingsPaneHotkey.xaml | 841 +++++++++--------- .../Views/SettingsPaneHotkey.xaml.cs | 31 +- .../SettingPages/Views/SettingsPaneTheme.xaml | 8 + 6 files changed, 558 insertions(+), 468 deletions(-) create mode 100644 Flow.Launcher/SettingPages/ViewModels/SettingsPaneHotkeyViewModel.cs diff --git a/Flow.Launcher/CustomShortcutSetting.xaml.cs b/Flow.Launcher/CustomShortcutSetting.xaml.cs index 097d6a53b..880c49787 100644 --- a/Flow.Launcher/CustomShortcutSetting.xaml.cs +++ b/Flow.Launcher/CustomShortcutSetting.xaml.cs @@ -47,7 +47,7 @@ namespace Flow.Launcher } // Check if key is modified or adding a new one if (((update && originalKey != Key) || !update) - && viewModel.ShortcutExists(Key)) + && (viewModel?.ShortcutExists(Key) ?? false)) // TODO Remove this check after removing unused code from SettingWindow.xaml.cs { MessageBox.Show(InternationalizationManager.Instance.GetTranslation("duplicateShortcut")); return; diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs index e405ccc96..a9718a0ac 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs @@ -7,7 +7,6 @@ using Flow.Launcher.Core; using Flow.Launcher.Core.Configuration; using Flow.Launcher.Core.Resource; using Flow.Launcher.Helper; -using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Plugin; using Flow.Launcher.Plugin.SharedModels; @@ -16,7 +15,7 @@ namespace Flow.Launcher.SettingPages.ViewModels; public partial class SettingsPaneGeneralViewModel : BaseModel { - public Settings Settings { get; set; } + public Settings Settings { get; } private readonly Updater _updater; private readonly IPortable _portable; @@ -150,13 +149,6 @@ public partial class SettingsPaneGeneralViewModel : BaseModel .Select(v => v.ToString()) .ToList(); - public List OpenResultModifiersList => new List - { - KeyConstant.Alt, - KeyConstant.Ctrl, - $"{KeyConstant.Ctrl}+{KeyConstant.Alt}" - }; - public List Languages => InternationalizationManager.Instance.LoadAvailableLanguages(); public IEnumerable MaxResultsRange => Enumerable.Range(2, 16); diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneHotkeyViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneHotkeyViewModel.cs new file mode 100644 index 000000000..f56c4a971 --- /dev/null +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneHotkeyViewModel.cs @@ -0,0 +1,134 @@ +using System.Windows; +using CommunityToolkit.Mvvm.Input; +using Flow.Launcher.Core.Resource; +using Flow.Launcher.Helper; +using Flow.Launcher.Infrastructure; +using Flow.Launcher.Infrastructure.Hotkey; +using Flow.Launcher.Infrastructure.UserSettings; +using Flow.Launcher.Plugin; + +namespace Flow.Launcher.SettingPages.ViewModels; + +public partial class SettingsPaneHotkeyViewModel : BaseModel +{ + public Settings Settings { get; } + + public CustomPluginHotkey SelectedCustomPluginHotkey { get; set; } + public CustomShortcutModel SelectedCustomShortcut { get; set; } + + public string[] OpenResultModifiersList => new[] + { + KeyConstant.Alt, + KeyConstant.Ctrl, + $"{KeyConstant.Ctrl}+{KeyConstant.Alt}" + }; + + public SettingsPaneHotkeyViewModel(Settings settings) + { + Settings = settings; + } + + [RelayCommand] + private void SetTogglingHotkey(HotkeyModel hotkey) + { + HotKeyMapper.SetHotkey(hotkey, HotKeyMapper.OnToggleHotkey); + } + + [RelayCommand] + private void CustomHotkeyDelete() + { + var item = SelectedCustomPluginHotkey; + if (item is null) + { + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem")); + return; + } + + var result = MessageBox.Show( + string.Format( + InternationalizationManager.Instance.GetTranslation("deleteCustomHotkeyWarning"), item.Hotkey + ), + InternationalizationManager.Instance.GetTranslation("delete"), + MessageBoxButton.YesNo + ); + + if (result is MessageBoxResult.Yes) + { + Settings.CustomPluginHotkeys.Remove(item); + HotKeyMapper.RemoveHotkey(item.Hotkey); + } + } + + [RelayCommand] + private void CustomHotkeyEdit() + { + var item = SelectedCustomPluginHotkey; + if (item is null) + { + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem")); + return; + } + + var window = new CustomQueryHotkeySetting(null, Settings); + window.UpdateItem(item); + window.ShowDialog(); + } + + [RelayCommand] + private void CustomHotkeyAdd() + { + new CustomQueryHotkeySetting(null, Settings).ShowDialog(); + } + + [RelayCommand] + private void CustomShortcutDelete() + { + var item = SelectedCustomShortcut; + if (item is null) + { + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem")); + return; + } + + var result = MessageBox.Show( + string.Format( + InternationalizationManager.Instance.GetTranslation("deleteCustomShortcutWarning"), item.Key, item.Value + ), + InternationalizationManager.Instance.GetTranslation("delete"), + MessageBoxButton.YesNo + ); + + if (result is MessageBoxResult.Yes) + { + Settings.CustomShortcuts.Remove(item); + } + } + + [RelayCommand] + private void CustomShortcutEdit() + { + var item = SelectedCustomShortcut; + if (item is null) + { + MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem")); + return; + } + + var window = new CustomShortcutSetting(item.Key, item.Value, null); + if (window.ShowDialog() is not true) return; + + var index = Settings.CustomShortcuts.IndexOf(item); + Settings.CustomShortcuts[index] = new CustomShortcutModel(window.Key, window.Value); + } + + [RelayCommand] + private void CustomShortcutAdd() + { + var window = new CustomShortcutSetting(null); + if (window.ShowDialog() is true) + { + var shortcut = new CustomShortcutModel(window.Key, window.Value); + Settings.CustomShortcuts.Add(shortcut); + } + } +} diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml index 7afb7bdc7..170b596f0 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneHotkey.xaml @@ -1,472 +1,433 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + Title="{DynamicResource OpenContainFolderHotkey}" + Icon="" + Type="Inside"> + + + + + + + + + + + + + HotkeySettings="{Binding Settings}" + DefaultHotkey="Ctrl+I" + Hotkey="{Binding Settings.OpenContextMenuHotkey}" + ValidateKeyGesture="False" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + - - - - - - - - + HorizontalAlignment="Right" + VerticalAlignment="Top" + Orientation="Horizontal"> + + + + + + + + + + + + +  + + + - - - - - - - - - - - - - - - - -  - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs index fe1ea4e7b..d85d50e6f 100644 --- a/Flow.Launcher/ViewModel/SettingWindowViewModel.cs +++ b/Flow.Launcher/ViewModel/SettingWindowViewModel.cs @@ -49,6 +49,9 @@ namespace Flow.Launcher.ViewModel case nameof(Settings.WindowSize): OnPropertyChanged(nameof(WindowWidthSize)); break; + case nameof(Settings.WindowHeightSize): + OnPropertyChanged(nameof(WindowHeightSize)); + break; case nameof(Settings.UseDate): case nameof(Settings.DateFormat): OnPropertyChanged(nameof(DateText)); @@ -450,6 +453,34 @@ namespace Flow.Launcher.ViewModel } } + public double WindowHeightSize + { + get => Settings.WindowHeightSize; + set => Settings.WindowHeightSize = value; + } + + public double ItemHeightSize + { + get => Settings.ItemHeightSize; + set => Settings.ItemHeightSize = value; + } + + public double queryBoxFontSize + { + get => Settings.QueryBoxFontSize; + set => Settings.QueryBoxFontSize = value; + } + public double resultItemFontSize + { + get => Settings.ResultItemFontSize; + set => Settings.ResultItemFontSize = value; + } + + public double resultSubItemFontSize + { + get => Settings.ResultSubItemFontSize; + set => Settings.ResultSubItemFontSize = value; + } public class ColorScheme { public string Display { get; set; } @@ -838,6 +869,51 @@ namespace Flow.Launcher.ViewModel } } + public FontFamily SelectedResultSubFont + { + get + { + if (Fonts.SystemFontFamilies.Count(o => + o.FamilyNames.Values != null && + o.FamilyNames.Values.Contains(Settings.ResultSubFont)) > 0) + { + var font = new FontFamily(Settings.ResultSubFont); + return font; + } + else + { + var font = new FontFamily("Segoe UI"); + return font; + } + } + set + { + Settings.ResultSubFont = value.ToString(); + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public FamilyTypeface SelectedResultSubFontFaces + { + get + { + var typeface = SyntaxSugars.CallOrRescueDefault( + () => SelectedResultSubFont.ConvertFromInvariantStringsOrNormal( + Settings.ResultSubFontStyle, + Settings.ResultSubFontWeight, + Settings.ResultSubFontStretch + )); + return typeface; + } + set + { + Settings.ResultSubFontStretch = value.Stretch.ToString(); + Settings.ResultSubFontWeight = value.Weight.ToString(); + Settings.ResultSubFontStyle = value.Style.ToString(); + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + public string ThemeImage => Constant.QueryTextBoxIconImagePath; #endregion From 3659399ddaccca09943d902453925e2b02407920 Mon Sep 17 00:00:00 2001 From: DB p Date: Tue, 14 May 2024 18:03:26 +0900 Subject: [PATCH 036/141] Remove Hand Cursor Style --- Flow.Launcher/ResultListBox.xaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Flow.Launcher/ResultListBox.xaml b/Flow.Launcher/ResultListBox.xaml index 68d614e5b..382b7c2e4 100644 --- a/Flow.Launcher/ResultListBox.xaml +++ b/Flow.Launcher/ResultListBox.xaml @@ -48,7 +48,6 @@ Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" - Cursor="Hand" UseLayoutRounding="False"> @@ -210,7 +209,7 @@ - + From 5670085275c5bb936d6a824f109adb010d330e0d Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 15 May 2024 23:30:27 +0900 Subject: [PATCH 037/141] - add soundplay for no WMP - fix warning visibility --- Flow.Launcher/MainWindow.xaml.cs | 24 +++++++++++++++++++----- Flow.Launcher/SettingWindow.xaml | 2 +- Flow.Launcher/SettingWindow.xaml.cs | 2 +- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 76e587cdc..2678d7c27 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -29,6 +29,7 @@ using DataObject = System.Windows.DataObject; using System.Windows.Media; using System.Windows.Interop; using System.Runtime.InteropServices; +using System.IO; namespace Flow.Launcher { @@ -46,7 +47,8 @@ namespace Flow.Launcher private ContextMenu contextMenu = new ContextMenu(); private MainViewModel _viewModel; private bool _animating; - MediaPlayer animationSound = new MediaPlayer(); + MediaPlayer animationSoundWMP = new MediaPlayer(); + SoundPlayer animationSoundWPF = new SoundPlayer(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav"); #endregion @@ -59,7 +61,7 @@ namespace Flow.Launcher InitializeComponent(); InitializePosition(); - animationSound.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav")); + animationSoundWMP.Open(new Uri(AppDomain.CurrentDomain.BaseDirectory + "Resources\\open.wav")); DataObject.AddPastingHandler(QueryTextBox, OnPaste); } @@ -137,9 +139,7 @@ namespace Flow.Launcher { if (_settings.UseSound) { - animationSound.Position = TimeSpan.Zero; - animationSound.Volume = _settings.SoundVolume / 100.0; - animationSound.Play(); + SoundPlay(); } UpdatePosition(); PreviewReset(); @@ -503,6 +503,20 @@ namespace Flow.Launcher windowsb.Begin(FlowMainWindow); } + private void SoundPlay() + { + + if (!File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Windows Media Player", "wmplayer.exe"))) + { + animationSoundWPF.Play(); + } + else + { + animationSoundWMP.Position = TimeSpan.Zero; + animationSoundWMP.Volume = _settings.SoundVolume / 100.0; + animationSoundWMP.Play(); + } + } private void OnMouseDown(object sender, MouseButtonEventArgs e) { if (e.ChangedButton == MouseButton.Left) DragMove(); diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index fd999585d..daacd76d5 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -2570,7 +2570,7 @@ BorderBrush="{DynamicResource Color03B}" BorderThickness="0,1,0,0" CornerRadius="0 0 5 5" - Visibility="Visible"> + Visibility="Collapsed"> diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index 58ffbb149..292559b2f 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -73,7 +73,7 @@ namespace Flow.Launcher if (!File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "Windows Media Player", "wmplayer.exe"))) { - /* Binding WMPWarning visibility */ + WMPWarning.Visibility = Visibility.Visible; } } private void SettingsWindowViewModelChanged(object sender, PropertyChangedEventArgs e) From a64f10e3123949e71ff27881ec729b62233a3772 Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 15 May 2024 23:36:33 +0900 Subject: [PATCH 038/141] - Adjust Warning String --- 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 9962646c6..418efe1e2 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -158,7 +158,7 @@ Play a small sound when the search window opens Sound Effect Volume Adjust the volume of the sound effect - Sound effect is unavailable because Windows Media Player is missing. Please install it if you need sound effect. + Windows Media Player is unavailable and is required for volume adjust. Please check your WMP installation Animation Use Animation in UI Animation Speed From c950a689d5b29c92f51743c03ff27d4d5fab156c Mon Sep 17 00:00:00 2001 From: DB p Date: Thu, 16 May 2024 01:11:27 +0900 Subject: [PATCH 039/141] - Convert Garulf's Query Cycle feature - Add Reset CycleIndex when close window --- .../UserSettings/Settings.cs | 6 ++ Flow.Launcher/MainWindow.xaml | 8 +++ Flow.Launcher/SettingWindow.xaml | 20 ++++++ Flow.Launcher/ViewModel/MainViewModel.cs | 68 ++++++++++++++++++- 4 files changed, 101 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 7bb8fe200..3d4433493 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -31,6 +31,8 @@ namespace Flow.Launcher.Infrastructure.UserSettings public string SelectPrevPageHotkey { get; set; } = $"PageDown"; public string OpenContextMenuHotkey { get; set; } = $"Ctrl+O"; public string SettingWindowHotkey { get; set; } = $"Ctrl+I"; + public string CycleHistoryUpHotkey { get; set; } = $"{KeyConstant.Alt} + Up"; + public string CycleHistoryDownHotkey { get; set; } = $"{KeyConstant.Alt} + Down"; public string Language { @@ -340,6 +342,10 @@ namespace Flow.Launcher.Infrastructure.UserSettings list.Add(new(SelectNextPageHotkey, "SelectNextPageHotkey", () => SelectNextPageHotkey = "")); if(!string.IsNullOrEmpty(SelectPrevPageHotkey)) list.Add(new(SelectPrevPageHotkey, "SelectPrevPageHotkey", () => SelectPrevPageHotkey = "")); + if (!string.IsNullOrEmpty(CycleHistoryUpHotkey)) + list.Add(new(CycleHistoryUpHotkey, "CycleHistoryUpHotkey", () => CycleHistoryUpHotkey = "")); + if (!string.IsNullOrEmpty(CycleHistoryDownHotkey)) + list.Add(new(CycleHistoryDownHotkey, "CycleHistoryDownHotkey", () => CycleHistoryDownHotkey = "")); foreach (var customPluginHotkey in CustomPluginHotkeys) { diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 2e6e973a7..da5ec63bf 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -197,6 +197,14 @@ Key="{Binding SelectPrevPageHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='key'}" Command="{Binding SelectPrevPageCommand}" Modifiers="{Binding SelectPrevPageHotkey, Converter={StaticResource StringToKeyBindingConverter}, ConverterParameter='modifiers'}" /> + + diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 119268d6b..4a563bc45 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -2810,6 +2810,26 @@ Type="Inside"> + + + + + + _userSelectedRecordStorage; private readonly FlowLauncherJsonStorage _topMostRecordStorage; private readonly History _history; + private int lasthistoryindex = 1; private readonly UserSelectedRecord _userSelectedRecord; private readonly TopMostRecord _topMostRecord; @@ -83,6 +84,12 @@ namespace Flow.Launcher.ViewModel case nameof(Settings.AutoCompleteHotkey): OnPropertyChanged(nameof(AutoCompleteHotkey)); break; + case nameof(Settings.CycleHistoryUpHotkey): + OnPropertyChanged(nameof(CycleHistoryUpHotkey)); + break; + case nameof(Settings.CycleHistoryDownHotkey): + OnPropertyChanged(nameof(CycleHistoryDownHotkey)); + break; case nameof(Settings.AutoCompleteHotkey2): OnPropertyChanged(nameof(AutoCompleteHotkey2)); break; @@ -256,6 +263,49 @@ namespace Flow.Launcher.ViewModel } } + [RelayCommand] + public void ReverseHistory() + { + if (_history.Items.Count > 0) + { + ChangeQueryText(_history.Items[_history.Items.Count - lasthistoryindex].Query.ToString()); + if (lasthistoryindex < _history.Items.Count) + { + lasthistoryindex++; + } + } + } + + [RelayCommand] + public void ForwardHistory() + { + if (_history.Items.Count > 0) + { + ChangeQueryText(_history.Items[_history.Items.Count - lasthistoryindex].Query.ToString()); + if (lasthistoryindex > 1) + { + lasthistoryindex--; + } + } + } + + [RelayCommand] + public void ReverseHistoryOnEmptyQuery() + { + var results = SelectedResults; + if (_history.Items.Count > 0 + && _queryText == String.Empty + && !HistorySelected() + && !ContextMenuSelected()) + { + ReverseHistory(); + } + else + { + SelectedResults.SelectPrevResult(); + } + } + [RelayCommand] private void LoadContextMenu() { @@ -394,7 +444,20 @@ namespace Flow.Launcher.ViewModel [RelayCommand] private void SelectPrevItem() { - SelectedResults.SelectPrevResult(); + var results = SelectedResults; + if (_history.Items.Count > 0 + && _queryText == String.Empty + && !HistorySelected() + && !ContextMenuSelected()) + { + lasthistoryindex = 1; + ReverseHistory(); + } + else + { + SelectedResults.SelectPrevResult(); + } + } [RelayCommand] @@ -690,6 +753,8 @@ namespace Flow.Launcher.ViewModel public string SelectPrevPageHotkey => VerifyOrSetDefaultHotkey(Settings.SelectPrevPageHotkey, ""); public string OpenContextMenuHotkey => VerifyOrSetDefaultHotkey(Settings.OpenContextMenuHotkey, "Ctrl+O"); public string SettingWindowHotkey => VerifyOrSetDefaultHotkey(Settings.SettingWindowHotkey, "Ctrl+I"); + public string CycleHistoryUpHotkey => VerifyOrSetDefaultHotkey(Settings.CycleHistoryUpHotkey, "Alt+Up"); + public string CycleHistoryDownHotkey => VerifyOrSetDefaultHotkey(Settings.CycleHistoryDownHotkey, "Alt+Down"); public string Image => Constant.QueryTextBoxIconImagePath; @@ -1116,6 +1181,7 @@ namespace Flow.Launcher.ViewModel public async void Hide() { + lasthistoryindex = 1; // Trick for no delay MainWindowOpacity = 0; lastContextMenuResult = new Result(); From 572e889c3449d604c7ad833cd8409f4bfb9da8ce Mon Sep 17 00:00:00 2001 From: DB p Date: Thu, 16 May 2024 01:44:00 +0900 Subject: [PATCH 040/141] Delete unused code --- Flow.Launcher/ViewModel/MainViewModel.cs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index ac5b980e0..2e52f92c1 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -289,23 +289,6 @@ namespace Flow.Launcher.ViewModel } } - [RelayCommand] - public void ReverseHistoryOnEmptyQuery() - { - var results = SelectedResults; - if (_history.Items.Count > 0 - && _queryText == String.Empty - && !HistorySelected() - && !ContextMenuSelected()) - { - ReverseHistory(); - } - else - { - SelectedResults.SelectPrevResult(); - } - } - [RelayCommand] private void LoadContextMenu() { From 3bcb5da99c7117241694ad1b742b3a62c20b39d0 Mon Sep 17 00:00:00 2001 From: Yusyuriv Date: Wed, 15 May 2024 22:56:58 +0600 Subject: [PATCH 041/141] Implement plugin store settings pane --- .../SettingsPanePluginStoreViewModel.cs | 37 ++++++++++ .../Views/SettingsPanePluginStore.xaml | 50 +++++++------ .../Views/SettingsPanePluginStore.xaml.cs | 70 ++++++++++++++----- .../ViewModel/PluginStoreItemViewModel.cs | 21 +++--- 4 files changed, 131 insertions(+), 47 deletions(-) create mode 100644 Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs new file mode 100644 index 000000000..e06931011 --- /dev/null +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPanePluginStoreViewModel.cs @@ -0,0 +1,37 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using CommunityToolkit.Mvvm.Input; +using Flow.Launcher.Core.ExternalPlugins; +using Flow.Launcher.Infrastructure; +using Flow.Launcher.Plugin; +using Flow.Launcher.ViewModel; + +namespace Flow.Launcher.SettingPages.ViewModels; + +public partial class SettingsPanePluginStoreViewModel : BaseModel +{ + public string FilterText { get; set; } = string.Empty; + + public IList ExternalPlugins => PluginsManifest.UserPlugins + .Select(p => new PluginStoreItemViewModel(p)) + .OrderByDescending(p => p.Category == PluginStoreItemViewModel.NewRelease) + .ThenByDescending(p => p.Category == PluginStoreItemViewModel.RecentlyUpdated) + .ThenByDescending(p => p.Category == PluginStoreItemViewModel.None) + .ThenByDescending(p => p.Category == PluginStoreItemViewModel.Installed) + .ToList(); + + [RelayCommand] + private async Task RefreshExternalPluginsAsync() + { + await PluginsManifest.UpdateManifestAsync(); + OnPropertyChanged(nameof(ExternalPlugins)); + } + + public bool SatisfiesFilter(PluginStoreItemViewModel plugin) + { + return string.IsNullOrEmpty(FilterText) || + StringMatcher.FuzzySearch(FilterText, plugin.Name).IsSearchPrecisionScoreMet() || + StringMatcher.FuzzySearch(FilterText, plugin.Description).IsSearchPrecisionScoreMet(); + } +} diff --git a/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml b/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml index bed68e86a..3b13f2e5a 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPanePluginStore.xaml @@ -1,25 +1,27 @@ - - - - - - - - - + + + + + + + @@ -38,7 +40,7 @@ FontSize="30" Style="{StaticResource PageTitle}" Text="{DynamicResource pluginStore}" - TextAlignment="left" /> + TextAlignment="Left" /> + VirtualizingPanel.ScrollUnit="Pixel"> - + @@ -273,7 +274,9 @@ HorizontalAlignment="Stretch" VerticalAlignment="Center" Content="{DynamicResource installbtn}" - Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter='!'}" /> + Visibility="{Binding LabelInstalled, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter='!'}" + Command="{Binding ShowCommandQueryCommand}" + CommandParameter="install" /> + - - - - - - - - - - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -180,7 +393,7 @@ Margin="0" Padding="0" HorizontalAlignment="Stretch" - BorderThickness="1,0,1,1" + BorderThickness="1 0 1 1" CornerRadius="0 0 5 5" Style="{DynamicResource SettingGroupBox}"> - + @@ -326,7 +539,7 @@ SelectedItem="{Binding SelectedResultFont}" /> @@ -346,7 +559,7 @@ - + - + + @@ -478,15 +691,15 @@ From d31c9a01190043258bd0b05c17075a8e377f4b5a Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 25 May 2024 11:05:58 +0900 Subject: [PATCH 104/141] Adjust Toggle Style --- .../Resources/CustomControlTemplate.xaml | 262 ++++++-- .../SettingPages/Views/SettingsPaneTheme.xaml | 585 +++++++++--------- 2 files changed, 505 insertions(+), 342 deletions(-) diff --git a/Flow.Launcher/Resources/CustomControlTemplate.xaml b/Flow.Launcher/Resources/CustomControlTemplate.xaml index cbb828582..a53e61f8c 100644 --- a/Flow.Launcher/Resources/CustomControlTemplate.xaml +++ b/Flow.Launcher/Resources/CustomControlTemplate.xaml @@ -45,7 +45,7 @@ - + + @@ -867,7 +1029,7 @@ Grid.Row="1" Grid.Column="0" Margin="{TemplateBinding Padding}" - Padding="0,0,32,0" + Padding="0 0 32 0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Foreground="{TemplateBinding ui:ControlHelper.PlaceholderForeground}" @@ -887,7 +1049,7 @@ Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" - Margin="0,0,0,0" + Margin="0 0 0 0" Padding="{DynamicResource ComboBoxEditableTextPadding}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" @@ -906,7 +1068,7 @@ Grid.Row="1" Grid.Column="1" Width="30" - Margin="0,1,1,1" + Margin="0 1 1 1" HorizontalAlignment="Right" Background="Transparent" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" @@ -917,7 +1079,7 @@ Grid.Row="1" Grid.Column="1" MinHeight="{DynamicResource ComboBoxMinHeight}" - Margin="0,0,10,0" + Margin="0 0 10 0" HorizontalAlignment="Right" VerticalAlignment="Center" Data="{StaticResource ChevronDown}" @@ -944,7 +1106,7 @@ - + @@ -1063,7 +1225,7 @@ - + @@ -1073,7 +1235,7 @@ - + @@ -1083,7 +1245,7 @@ - + @@ -1121,7 +1283,7 @@ x:Key="DataGridComboBoxStyle" BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="ComboBox"> - + @@ -1133,7 +1295,7 @@ x:Key="DataGridTextBlockComboBoxStyle" BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="ComboBox"> - + @@ -1362,7 +1524,7 @@ - + @@ -1394,7 +1556,7 @@ BasedOn="{StaticResource DefaultTextBoxStyle}" TargetType="TextBox"> - + @@ -1549,7 +1711,7 @@ x:Name="SwitchAreaGrid" Grid.RowSpan="3" Grid.ColumnSpan="3" - Margin="0,5" + Margin="0 5" HorizontalAlignment="Right" ui:FocusVisualHelper.IsTemplateFocusTarget="True" Background="{DynamicResource ToggleSwitchContainerBackground}" /> @@ -1902,7 +2064,7 @@ - + @@ -2673,7 +2835,7 @@ x:Name="UpSpinButton" Grid.Row="1" Grid.Column="1" - Margin="4,0,0,0" + Margin="4 0 0 0" ui:ControlHelper.CornerRadius="4" Content="{StaticResource ChevronUp}" FontSize="{TemplateBinding FontSize}" @@ -2807,7 +2969,7 @@ BorderThickness="{TemplateBinding BorderThickness}" /> @@ -2961,7 +3123,7 @@ - + @@ -3219,7 +3381,7 @@ SnapsToDevicePixels="True"> @@ -4099,7 +4261,7 @@ Grid.Column="1" Width="48" Height="16" - Margin="0,0,0,0" + Margin="0 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center"> - + - + @@ -4391,7 +4553,7 @@ @@ -4414,7 +4576,7 @@ x:Name="IconBox" Width="16" Height="16" - Margin="16,0,0,0" + Margin="16 0 0 0" HorizontalAlignment="Center" VerticalAlignment="Center"> @@ -4841,7 +5003,7 @@ + Margin="0 0 0 8"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + BorderThickness="1" + Style="{StaticResource SettingSeparatorStyle}" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Date: Sat, 25 May 2024 11:19:40 +0900 Subject: [PATCH 105/141] Change Edit Button to Icon --- .../SettingPages/Views/SettingsPaneTheme.xaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml index 1e0b032c9..14070cd2d 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml @@ -50,12 +50,18 @@ Orientation="Horizontal"> + ToolTip="Show details"> + + Date: Sat, 25 May 2024 11:49:29 +0800 Subject: [PATCH 106/141] Update wording --- Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index 52daf20fb..cd4a1dc84 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -31,8 +31,8 @@ Everything Setting Preview Panel Size - Creation date - Modification date + Date Created + Date Modified Display File Info Date and time format Sort Option: @@ -115,7 +115,8 @@ {0} free of {1} Open in Default File Manager - Use '>' to search in this directory, '*' to search for file extensions or '>*' to combine both searches. + Use '>' to search in this directory, '*' to search for file extensions or '>*' to combine both searches. + Failed to load Everything SDK From d7272d9deb14ca2fde8bee19d755996a6b2e88e9 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 25 May 2024 13:04:49 +0900 Subject: [PATCH 107/141] Fix Scroll for bottom margin in theme --- Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml index 14070cd2d..e8eb728b7 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml @@ -25,7 +25,7 @@ @@ -40,7 +40,7 @@ Visibility="Collapsed" /> - + Date: Sat, 25 May 2024 14:24:18 +0900 Subject: [PATCH 108/141] Add Strings --- Flow.Launcher/Languages/en.xaml | 8 +++++++- .../SettingPages/Views/SettingsPaneTheme.xaml | 17 ++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 633b84b19..07eccf238 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -142,8 +142,13 @@ Launch programs as admin or a different user ProcessKiller Terminate unwanted processes + Search Bar Height + Item Height Query Box Font - Result Item Font + Result Title Font + Result Subtitle Font + Reset + Customize Window Mode Opacity Theme {0} not exists, fallback to default theme @@ -170,6 +175,7 @@ Clock Date + Hotkey Hotkeys diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml index e8eb728b7..75853118f 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml @@ -56,7 +56,7 @@ HorizontalAlignment="Left" VerticalAlignment="Top" Style="{DynamicResource CustomToggleButtonStyle}" - ToolTip="Show details"> + ToolTip="{DynamicResource CustomizeToolTip}"> - Reset - + HorizontalAlignment="Center" + Content="{DynamicResource resetCustomize}" /> From 4acbb7aadd2171b4c6d51790c9bb6ee90e63c741 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 25 May 2024 14:28:37 +0900 Subject: [PATCH 109/141] Removed MaxResult/Width item in settings --- .../Views/SettingsPaneGeneral.xaml | 78 +++++++++---------- .../SettingPages/Views/SettingsPaneTheme.xaml | 25 ------ 2 files changed, 36 insertions(+), 67 deletions(-) diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml index 95505165d..c2b23a295 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml @@ -4,11 +4,11 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:ext="clr-namespace:Flow.Launcher.Resources.MarkupExtensions" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:settingsViewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels" xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure" - xmlns:ext="clr-namespace:Flow.Launcher.Resources.MarkupExtensions" Title="General" d:DataContext="{d:DesignInstance settingsViewModels:SettingsPaneGeneralViewModel}" d:DesignHeight="450" @@ -46,58 +46,62 @@ - + + SelectedValue="{Binding Settings.SearchWindowScreen}" + SelectedValuePath="Value" /> + Visibility="{ext:VisibleWhen {Binding Settings.SearchWindowScreen}, + IsEqualTo={x:Static userSettings:SearchWindowScreens.Custom}}" /> + Icon="" + Visibility="{ext:CollapsedWhen {Binding Settings.SearchWindowScreen}, + IsEqualTo={x:Static userSettings:SearchWindowScreens.RememberLastLaunchLocation}}"> + SelectedValue="{Binding Settings.SearchWindowAlign}" + SelectedValuePath="Value" /> - - - + Orientation="Horizontal" + Visibility="{ext:VisibleWhen {Binding Settings.SearchWindowAlign}, + IsEqualTo={x:Static userSettings:SearchWindowAligns.Custom}}"> + + + @@ -133,8 +137,7 @@ - + - - - - + SelectedValue="{Binding Settings.LastQueryMode}" + SelectedValuePath="Value" /> @@ -223,8 +218,7 @@ Title="{DynamicResource ShouldUsePinyin}" Icon="" Sub="{DynamicResource ShouldUsePinyinToolTip}"> - + - - - - - - - - Date: Sat, 25 May 2024 14:36:20 +0900 Subject: [PATCH 110/141] Adjust Quick Resize Logic --- Flow.Launcher/MainWindow.xaml | 12 ++++++------ Flow.Launcher/ViewModel/MainViewModel.cs | 12 ++---------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index 1180e966b..f80d927a5 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -269,7 +269,7 @@ @@ -328,7 +328,7 @@ x:Name="ProgressBar" Width="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}, Path=ActualWidth}" Height="2" - Margin="12,0,12,0" + Margin="12 0 12 0" HorizontalAlignment="Center" VerticalAlignment="Bottom" StrokeThickness="2" @@ -444,7 +444,7 @@ Style="{DynamicResource PreviewBorderStyle}" Visibility="{Binding ShowDefaultPreview}"> @@ -460,7 +460,7 @@ x:Name="PreviewGlyphIcon" Grid.Row="0" Height="Auto" - Margin="0,16,0,0" + Margin="0 16 0 0" FontFamily="{Binding Glyph.FontFamily}" Style="{DynamicResource PreviewGlyph}" Text="{Binding Glyph.Glyph}" @@ -469,7 +469,7 @@ x:Name="PreviewImageIcon" Grid.Row="0" MaxHeight="320" - Margin="0,16,0,0" + Margin="0 16 0 0" HorizontalAlignment="Center" Source="{Binding PreviewImage}" StretchDirection="DownOnly" @@ -488,7 +488,7 @@ 1920 || Settings.WindowSize == 1920) - { - Settings.WindowSize = 1920; - } - else - { - Settings.WindowSize += 100; - Settings.WindowLeft -= 50; - } - + Settings.WindowSize += 100; + Settings.WindowLeft -= 50; OnPropertyChanged(); } From 058158ee3274560c0bb9fe5f29df4efad865c293 Mon Sep 17 00:00:00 2001 From: Hongtao Zhang Date: Sat, 25 May 2024 00:36:54 -0500 Subject: [PATCH 111/141] try appending runtimeidentifier instead of removing unused runtimes --- ...low.Launcher.Plugin.BrowserBookmark.csproj | 39 +------------------ 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj index 234afe28a..2431d2a05 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj @@ -11,6 +11,7 @@ true false false + win true en @@ -36,44 +37,6 @@ false - - - - - - - - PreserveNewest From fa2df93dd7b23aa3be56da3da358854984c969e9 Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sat, 25 May 2024 14:03:14 +0800 Subject: [PATCH 112/141] Fix calculator decimal separator bug --- Flow.Launcher.Core/Resource/Internationalization.cs | 9 +++------ Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs | 2 +- .../ViewModels/SettingsPaneThemeViewModel.cs | 6 ++---- Flow.Launcher/ViewModel/MainViewModel.cs | 5 ++--- Plugins/Flow.Launcher.Plugin.Calculator/Main.cs | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/plugin.json | 2 +- 6 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Flow.Launcher.Core/Resource/Internationalization.cs b/Flow.Launcher.Core/Resource/Internationalization.cs index acc693ed5..06eb868b8 100644 --- a/Flow.Launcher.Core/Resource/Internationalization.cs +++ b/Flow.Launcher.Core/Resource/Internationalization.cs @@ -96,13 +96,10 @@ namespace Flow.Launcher.Core.Resource { LoadLanguage(language); } - // Culture of this thread - // Use CreateSpecificCulture to preserve possible user-override settings in Windows + // Culture of main thread + // Use CreateSpecificCulture to preserve possible user-override settings in Windows, if Flow's language culture is the same as Windows's CultureInfo.CurrentCulture = CultureInfo.CreateSpecificCulture(language.LanguageCode); CultureInfo.CurrentUICulture = CultureInfo.CurrentCulture; - // App domain - CultureInfo.DefaultThreadCurrentCulture = CultureInfo.CreateSpecificCulture(language.LanguageCode); - CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.DefaultThreadCurrentCulture; // Raise event after culture is set Settings.Language = language.LanguageCode; @@ -193,7 +190,7 @@ namespace Flow.Launcher.Core.Resource { p.Metadata.Name = pluginI18N.GetTranslatedPluginTitle(); p.Metadata.Description = pluginI18N.GetTranslatedPluginDescription(); - pluginI18N.OnCultureInfoChanged(CultureInfo.DefaultThreadCurrentCulture); + pluginI18N.OnCultureInfoChanged(CultureInfo.CurrentCulture); } catch (Exception e) { diff --git a/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs b/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs index fabd01a24..ed94771f0 100644 --- a/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs +++ b/Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs @@ -44,7 +44,7 @@ public class QuerySuggestionBoxConverter : IMultiValueConverter // Check if Text will be larger than our QueryTextBox Typeface typeface = new Typeface(queryTextBox.FontFamily, queryTextBox.FontStyle, queryTextBox.FontWeight, queryTextBox.FontStretch); // TODO: Obsolete warning? - var ft = new FormattedText(queryTextBox.Text, CultureInfo.DefaultThreadCurrentCulture, System.Windows.FlowDirection.LeftToRight, typeface, queryTextBox.FontSize, Brushes.Black); + var ft = new FormattedText(queryTextBox.Text, CultureInfo.CurrentCulture, System.Windows.FlowDirection.LeftToRight, typeface, queryTextBox.FontSize, Brushes.Black); var offset = queryTextBox.Padding.Right; diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs index bcdd94e1c..87c5b6aa8 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs @@ -21,8 +21,6 @@ namespace Flow.Launcher.SettingPages.ViewModels; public partial class SettingsPaneThemeViewModel : BaseModel { - private CultureInfo Culture => CultureInfo.DefaultThreadCurrentCulture; - public Settings Settings { get; } public static string LinkHowToCreateTheme => @"https://flowlauncher.com/docs/#/how-to-create-a-theme"; @@ -136,9 +134,9 @@ public partial class SettingsPaneThemeViewModel : BaseModel set => Settings.DateFormat = value; } - public string ClockText => DateTime.Now.ToString(TimeFormat, Culture); + public string ClockText => DateTime.Now.ToString(TimeFormat, CultureInfo.CurrentCulture); - public string DateText => DateTime.Now.ToString(DateFormat, Culture); + public string DateText => DateTime.Now.ToString(DateFormat, CultureInfo.CurrentCulture); public double WindowWidthSize { diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 01dc67b98..13d9d3bdf 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -485,7 +485,6 @@ namespace Flow.Launcher.ViewModel public Settings Settings { get; } public string ClockText { get; private set; } public string DateText { get; private set; } - public CultureInfo Culture => CultureInfo.DefaultThreadCurrentCulture; private async Task RegisterClockAndDateUpdateAsync() { @@ -494,9 +493,9 @@ namespace Flow.Launcher.ViewModel while (await timer.WaitForNextTickAsync().ConfigureAwait(false)) { if (Settings.UseClock) - ClockText = DateTime.Now.ToString(Settings.TimeFormat, Culture); + ClockText = DateTime.Now.ToString(Settings.TimeFormat, CultureInfo.CurrentCulture); if (Settings.UseDate) - DateText = DateTime.Now.ToString(Settings.DateFormat, Culture); + DateText = DateTime.Now.ToString(Settings.DateFormat, CultureInfo.CurrentCulture); } } diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index 338b5bcbe..ade684ca1 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -62,7 +62,7 @@ namespace Flow.Launcher.Plugin.Caculator switch (_settings.DecimalSeparator) { case DecimalSeparator.Comma: - case DecimalSeparator.UseSystemLocale when CultureInfo.DefaultThreadCurrentCulture.NumberFormat.NumberDecimalSeparator == ",": + case DecimalSeparator.UseSystemLocale when CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == ",": expression = query.Search.Replace(",", "."); break; default: @@ -158,7 +158,7 @@ namespace Flow.Launcher.Plugin.Caculator private string GetDecimalSeparator() { - string systemDecimalSeperator = CultureInfo.DefaultThreadCurrentCulture.NumberFormat.NumberDecimalSeparator; + string systemDecimalSeperator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator; switch (_settings.DecimalSeparator) { case DecimalSeparator.UseSystemLocale: return systemDecimalSeperator; diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json index a77475460..ac2ece7b5 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json @@ -4,7 +4,7 @@ "Name": "Calculator", "Description": "Provide mathematical calculations.(Try 5*3-2 in Flow Launcher)", "Author": "cxfksword", - "Version": "3.1.0", + "Version": "3.1.1", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", "ExecuteFileName": "Flow.Launcher.Plugin.Caculator.dll", From 27392a53c3618425d047edda1189117c1bf4cb0a Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sat, 25 May 2024 14:28:26 +0800 Subject: [PATCH 113/141] Fix output path --- .../Flow.Launcher.Plugin.Calculator.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj index 415f852f4..178485a8f 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj @@ -18,7 +18,7 @@ true portable false - ..\..\Output\Debug\Plugins\Flow.Launcher.Plugin.Caculator\ + ..\..\Output\Debug\Plugins\Flow.Launcher.Plugin.Calculator\ DEBUG;TRACE prompt 4 @@ -28,7 +28,7 @@ pdbonly true - ..\..\Output\Release\Plugins\Flow.Launcher.Plugin.Caculator\ + ..\..\Output\Release\Plugins\Flow.Launcher.Plugin.Calculator\ TRACE prompt 4 From e4621a5c878071861aa84eaef749f707b930c260 Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sat, 25 May 2024 14:35:14 +0800 Subject: [PATCH 114/141] Fix calculator typo --- Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs | 2 +- .../Flow.Launcher.Plugin.Calculator.csproj | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/Main.cs | 6 +++--- Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs | 2 +- Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs | 2 +- .../ViewModels/SettingsViewModel.cs | 2 +- .../Views/CalculatorSettings.xaml | 6 +++--- .../Views/CalculatorSettings.xaml.cs | 4 ++-- Plugins/Flow.Launcher.Plugin.Calculator/plugin.json | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs b/Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs index 27bdf94ee..81a68739b 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/DecimalSeparator.cs @@ -1,7 +1,7 @@ using System.ComponentModel; using Flow.Launcher.Core.Resource; -namespace Flow.Launcher.Plugin.Caculator +namespace Flow.Launcher.Plugin.Calculator { [TypeConverter(typeof(LocalizationConverter))] public enum DecimalSeparator diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj index 178485a8f..69c03b877 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj @@ -5,8 +5,8 @@ net7.0-windows {59BD9891-3837-438A-958D-ADC7F91F6F7E} Properties - Flow.Launcher.Plugin.Caculator - Flow.Launcher.Plugin.Caculator + Flow.Launcher.Plugin.Calculator + Flow.Launcher.Plugin.Calculator true true false diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs index ade684ca1..5077e6061 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Main.cs @@ -6,10 +6,10 @@ using System.Text.RegularExpressions; using System.Windows; using System.Windows.Controls; using Mages.Core; -using Flow.Launcher.Plugin.Caculator.ViewModels; -using Flow.Launcher.Plugin.Caculator.Views; +using Flow.Launcher.Plugin.Calculator.ViewModels; +using Flow.Launcher.Plugin.Calculator.Views; -namespace Flow.Launcher.Plugin.Caculator +namespace Flow.Launcher.Plugin.Calculator { public class Main : IPlugin, IPluginI18n, ISettingProvider { diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs b/Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs index ed4aed75b..4eacb9d34 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/NumberTranslator.cs @@ -2,7 +2,7 @@ using System.Text; using System.Text.RegularExpressions; -namespace Flow.Launcher.Plugin.Caculator +namespace Flow.Launcher.Plugin.Calculator { /// /// Tries to convert all numbers in a text from one culture format to another. diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs b/Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs index 615514873..8354863b8 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Settings.cs @@ -1,5 +1,5 @@  -namespace Flow.Launcher.Plugin.Caculator +namespace Flow.Launcher.Plugin.Calculator { public class Settings { diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Calculator/ViewModels/SettingsViewModel.cs index afe4d1c0c..09f745669 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Calculator/ViewModels/SettingsViewModel.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Linq; -namespace Flow.Launcher.Plugin.Caculator.ViewModels +namespace Flow.Launcher.Plugin.Calculator.ViewModels { public class SettingsViewModel : BaseModel { diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml index 9fd4bb17c..d6237c6da 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml @@ -1,13 +1,13 @@ /// Interaction logic for CalculatorSettings.xaml diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json index ac2ece7b5..6abc41668 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.Calculator/plugin.json @@ -7,6 +7,6 @@ "Version": "3.1.1", "Language": "csharp", "Website": "https://github.com/Flow-Launcher/Flow.Launcher", - "ExecuteFileName": "Flow.Launcher.Plugin.Caculator.dll", + "ExecuteFileName": "Flow.Launcher.Plugin.Calculator.dll", "IcoPath": "Images\\calculator.png" } \ No newline at end of file From 7b106c5cefac61f75d20ac8f141022aeb58f3f99 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 25 May 2024 15:40:21 +0900 Subject: [PATCH 115/141] Fix Sidebar Color --- Flow.Launcher/Resources/Dark.xaml | 3 ++- Flow.Launcher/Resources/Light.xaml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher/Resources/Dark.xaml b/Flow.Launcher/Resources/Dark.xaml index 5f6934f30..a910108e8 100644 --- a/Flow.Launcher/Resources/Dark.xaml +++ b/Flow.Launcher/Resources/Dark.xaml @@ -1033,7 +1033,8 @@ - + + diff --git a/Flow.Launcher/Resources/Light.xaml b/Flow.Launcher/Resources/Light.xaml index 6e06b99af..906430343 100644 --- a/Flow.Launcher/Resources/Light.xaml +++ b/Flow.Launcher/Resources/Light.xaml @@ -1030,7 +1030,8 @@ - + + From f98798066573dd9d61cf8b619aad78a2411c4a45 Mon Sep 17 00:00:00 2001 From: Yusyuriv Date: Sat, 25 May 2024 13:08:24 +0600 Subject: [PATCH 116/141] Revert "try appending runtimeidentifier instead of removing unused runtimes" This reverts commit 058158ee3274560c0bb9fe5f29df4efad865c293. --- ...low.Launcher.Plugin.BrowserBookmark.csproj | 39 ++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj index 2431d2a05..234afe28a 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Flow.Launcher.Plugin.BrowserBookmark.csproj @@ -11,7 +11,6 @@ true false false - win true en @@ -37,6 +36,44 @@ false + + + + + + + + PreserveNewest From cedf0c6c1ef6c03ca2feeb91d575d8aaaeffa764 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 25 May 2024 16:16:02 +0900 Subject: [PATCH 117/141] - Add Reset Button Function - Fix Conflict --- Flow.Launcher/MainWindow.xaml | 1 + .../ViewModels/SettingsPaneThemeViewModel.cs | 24 +++++++++++++++++++ .../SettingPages/Views/SettingsPaneTheme.xaml | 2 +- .../Views/SettingsPaneTheme.xaml.cs | 5 ++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index ade997e20..f0f6c981e 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -521,6 +521,7 @@ + diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs index bc96a86ff..2d04c49c3 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs @@ -470,4 +470,28 @@ public partial class SettingsPaneThemeViewModel : BaseModel { Settings = settings; } + + public void ResetCustomize() + { + Settings.QueryBoxFont = "Segoe UI"; + Settings.QueryBoxFontStyle = "Normal"; + Settings.QueryBoxFontWeight = "Normal"; + Settings.QueryBoxFontStretch = "Normal"; + Settings.QueryBoxFontSize = 20; + + Settings.ResultFont = "Segoe UI"; + Settings.ResultFontStyle = "Normal"; + Settings.ResultFontWeight = "Normal"; + Settings.ResultFontStretch = "Normal"; + Settings.ResultItemFontSize = 18; + + Settings.ResultSubFont = "Segoe UI"; + Settings.ResultSubFontStyle = "Normal"; + Settings.ResultSubFontWeight = "Normal"; + Settings.ResultSubFontStretch = "Normal"; + Settings.ResultSubItemFontSize = 14; + + Settings.ItemHeightSize = 52; + Settings.WindowHeightSize = 42; + } } diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml index c8425f822..8792a0e0a 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml @@ -255,7 +255,7 @@ Width="140" Margin="8" HorizontalAlignment="Center" - Content="{DynamicResource resetCustomize}" /> + Content="{DynamicResource resetCustomize}" Click="Reset_Click" /> diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml.cs b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml.cs index 93cf7ad18..6132c452d 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml.cs +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml.cs @@ -28,4 +28,9 @@ public partial class SettingsPaneTheme : Page { _viewModel.UpdateColorScheme(); } + + private void Reset_Click(object sender, System.Windows.RoutedEventArgs e) + { + _viewModel.ResetCustomize(); + } } From 5a0f4ac459476c685fc84128a65c24840e479f27 Mon Sep 17 00:00:00 2001 From: DB p Date: Sat, 25 May 2024 22:22:51 +0900 Subject: [PATCH 118/141] Adjust Default Value --- Flow.Launcher.Infrastructure/UserSettings/Settings.cs | 4 ++-- .../ViewModels/SettingsPaneThemeViewModel.cs | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 6a52b0a97..bf269ba12 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -58,9 +58,9 @@ namespace Flow.Launcher.Infrastructure.UserSettings public bool UseDropShadowEffect { get; set; } = false; /* Appearance Settings. It should be separated from the setting later.*/ - public double WindowHeightSize { get; set; } = 40; + public double WindowHeightSize { get; set; } = 42; public double ItemHeightSize { get; set; } = 58; - public double QueryBoxFontSize { get; set; } = 18; + public double QueryBoxFontSize { get; set; } = 20; public double ResultItemFontSize { get; set; } = 16; public double ResultSubItemFontSize { get; set; } = 13; public string QueryBoxFont { get; set; } = FontFamily.GenericSansSerif.Name; diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs index 2d04c49c3..260f1ea1f 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs @@ -1,9 +1,10 @@ using System; using System.Collections.Generic; +using System.Windows; +using System.Windows.Controls; using System.Globalization; using System.IO; using System.Linq; -using System.Windows; using System.Windows.Media; using System.Windows.Media.Imaging; using CommunityToolkit.Mvvm.Input; @@ -483,15 +484,15 @@ public partial class SettingsPaneThemeViewModel : BaseModel Settings.ResultFontStyle = "Normal"; Settings.ResultFontWeight = "Normal"; Settings.ResultFontStretch = "Normal"; - Settings.ResultItemFontSize = 18; + Settings.ResultItemFontSize = 16; Settings.ResultSubFont = "Segoe UI"; Settings.ResultSubFontStyle = "Normal"; Settings.ResultSubFontWeight = "Normal"; Settings.ResultSubFontStretch = "Normal"; - Settings.ResultSubItemFontSize = 14; + Settings.ResultSubItemFontSize = 13; - Settings.ItemHeightSize = 52; + Settings.ItemHeightSize = 58; Settings.WindowHeightSize = 42; } } From de94f3950f8d0c0805d58c7352ab9759345e3e43 Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sat, 25 May 2024 23:55:41 +0800 Subject: [PATCH 119/141] Fix window height reset issue --- Flow.Launcher/MainWindow.xaml.cs | 7 ++++--- .../SettingPages/ViewModels/SettingsPaneThemeViewModel.cs | 2 +- Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 53828c57f..c333b6b04 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -27,8 +27,6 @@ using DataObject = System.Windows.DataObject; using System.Windows.Media; using System.Windows.Interop; using System.Runtime.InteropServices; -using System.Diagnostics; -using System.Windows.Media.Media3D; namespace Flow.Launcher { @@ -108,10 +106,12 @@ namespace Flow.Launcher } return IntPtr.Zero; } + private void OnResizeBegin() { } + private void OnResizeEnd() { int shadowMargin = 0; @@ -131,7 +131,8 @@ namespace Flow.Launcher _settings.WindowSize = Width; FlowMainWindow.SizeToContent = SizeToContent.Height; } - private void OnCopy(object sender, ExecutedRoutedEventArgs e) + + private void OnCopy(object sender, ExecutedRoutedEventArgs e) { var result = _viewModel.Results.SelectedItem?.Result; if (QueryTextBox.SelectionLength == 0 && result != null) diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs index 260f1ea1f..c1becf4ba 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs @@ -493,6 +493,6 @@ public partial class SettingsPaneThemeViewModel : BaseModel Settings.ResultSubItemFontSize = 13; Settings.ItemHeightSize = 58; - Settings.WindowHeightSize = 42; + WindowHeightSize = 42; } } diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml index 8792a0e0a..1eb358a04 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml @@ -255,7 +255,8 @@ Width="140" Margin="8" HorizontalAlignment="Center" - Content="{DynamicResource resetCustomize}" Click="Reset_Click" /> + Click="Reset_Click" + Content="{DynamicResource resetCustomize}" /> @@ -286,8 +287,8 @@ Date: Sun, 26 May 2024 00:36:40 +0800 Subject: [PATCH 120/141] Fix binding problem --- .../ViewModels/SettingsPaneThemeViewModel.cs | 211 ++++++++++++++---- .../SettingPages/Views/SettingsPaneTheme.xaml | 16 +- 2 files changed, 181 insertions(+), 46 deletions(-) diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs index c1becf4ba..8290df79e 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs @@ -77,22 +77,6 @@ public partial class SettingsPaneThemeViewModel : BaseModel set => Settings.ItemHeightSize = value; } - public double queryBoxFontSize - { - get => Settings.QueryBoxFontSize; - set => Settings.QueryBoxFontSize = value; - } - public double resultItemFontSize - { - get => Settings.ResultItemFontSize; - set => Settings.ResultItemFontSize = value; - } - - public double resultSubItemFontSize - { - get => Settings.ResultSubItemFontSize; - set => Settings.ResultSubItemFontSize = value; - } public List Themes => ThemeManager.Instance.LoadAvailableThemes().Select(Path.GetFileNameWithoutExtension).ToList(); @@ -169,12 +153,6 @@ public partial class SettingsPaneThemeViewModel : BaseModel public string DateText => DateTime.Now.ToString(DateFormat, Culture); - public double WindowWidthSize - { - get => Settings.WindowSize; - set => Settings.WindowSize = value; - } - public bool UseGlyphIcons { get => Settings.UseGlyphIcons; @@ -210,6 +188,7 @@ public partial class SettingsPaneThemeViewModel : BaseModel return speeds; } } + public bool UseSound { get => Settings.UseSound; @@ -472,27 +451,183 @@ public partial class SettingsPaneThemeViewModel : BaseModel Settings = settings; } + public string QueryBoxFont + { + get => Settings.QueryBoxFont; + set + { + Settings.QueryBoxFont = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public string QueryBoxFontStyle + { + get => Settings.QueryBoxFontStyle; + set + { + Settings.QueryBoxFontStyle = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public string QueryBoxFontWeight + { + get => Settings.QueryBoxFontWeight; + set + { + Settings.QueryBoxFontWeight = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public string QueryBoxFontStretch + { + get => Settings.QueryBoxFontStretch; + set + { + Settings.QueryBoxFontStretch = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public double QueryBoxFontSize + { + get => Settings.QueryBoxFontSize; + set + { + Settings.QueryBoxFontSize = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public string ResultFont + { + get => Settings.ResultFont; + set + { + Settings.ResultFont = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public string ResultFontStyle + { + get => Settings.ResultFontStyle; + set + { + Settings.ResultFontStyle = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public string ResultFontWeight + { + get => Settings.ResultFontWeight; + set + { + Settings.ResultFontWeight = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public string ResultFontStretch + { + get => Settings.ResultFontStretch; + set + { + Settings.ResultFontStretch = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public double ResultItemFontSize + { + get => Settings.ResultItemFontSize; + set + { + Settings.ResultItemFontSize = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public string ResultSubFont + { + get => Settings.ResultSubFont; + set + { + Settings.ResultSubFont = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public string ResultSubFontStyle + { + get => Settings.ResultSubFontStyle; + set + { + Settings.ResultSubFontStyle = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public string ResultSubFontWeight + { + get => Settings.ResultSubFontWeight; + set + { + Settings.ResultSubFontWeight = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public string ResultSubFontStretch + { + get => Settings.ResultSubFontStretch; + set + { + Settings.ResultSubFontStretch = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public double ResultSubItemFontSize + { + get => Settings.ResultSubItemFontSize; + set + { + Settings.ResultSubItemFontSize = value; + ThemeManager.Instance.ChangeTheme(Settings.Theme); + } + } + + public int CustomAnimationLength + { + get => Settings.CustomAnimationLength; + set => Settings.CustomAnimationLength = value; + } + public void ResetCustomize() { - Settings.QueryBoxFont = "Segoe UI"; - Settings.QueryBoxFontStyle = "Normal"; - Settings.QueryBoxFontWeight = "Normal"; - Settings.QueryBoxFontStretch = "Normal"; - Settings.QueryBoxFontSize = 20; + QueryBoxFont = "Segoe UI"; + QueryBoxFontStyle = "Normal"; + QueryBoxFontWeight = "Normal"; + QueryBoxFontStretch = "Normal"; + QueryBoxFontSize = 20; - Settings.ResultFont = "Segoe UI"; - Settings.ResultFontStyle = "Normal"; - Settings.ResultFontWeight = "Normal"; - Settings.ResultFontStretch = "Normal"; - Settings.ResultItemFontSize = 16; + ResultFont = "Segoe UI"; + ResultFontStyle = "Normal"; + ResultFontWeight = "Normal"; + ResultFontStretch = "Normal"; + ResultItemFontSize = 16; - Settings.ResultSubFont = "Segoe UI"; - Settings.ResultSubFontStyle = "Normal"; - Settings.ResultSubFontWeight = "Normal"; - Settings.ResultSubFontStretch = "Normal"; - Settings.ResultSubItemFontSize = 13; + ResultSubFont = "Segoe UI"; + ResultSubFontStyle = "Normal"; + ResultSubFontWeight = "Normal"; + ResultSubFontStretch = "Normal"; + ResultSubItemFontSize = 13; - Settings.ItemHeightSize = 58; + ItemHeightSize = 58; WindowHeightSize = 42; } } diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml index 1eb358a04..f9758389f 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml @@ -114,7 +114,7 @@ Maximum="{Binding ElementName=WindowHeightValue, Path=Value, UpdateSourceTrigger=PropertyChanged}" Minimum="10" TickFrequency="1" - Value="{Binding queryBoxFontSize, Mode=TwoWay}" /> + Value="{Binding QueryBoxFontSize, Mode=TwoWay}" /> + Value="{Binding ResultItemFontSize, Mode=TwoWay}" /> + Value="{Binding ResultSubItemFontSize, Mode=TwoWay}" /> + Visibility="{Binding UseClock, Converter={StaticResource BoolToVisibilityConverter}}" /> + Visibility="{Binding UseDate, Converter={StaticResource BoolToVisibilityConverter}}" /> From 9a4d5dc8d61fc64a1343c515eae812848b5699d7 Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sun, 26 May 2024 10:56:21 +0800 Subject: [PATCH 121/141] Remove Vietnamese resource file --- Flow.Launcher/Properties/Resources.vi-VN.resx | 127 ------------------ 1 file changed, 127 deletions(-) delete mode 100644 Flow.Launcher/Properties/Resources.vi-VN.resx diff --git a/Flow.Launcher/Properties/Resources.vi-VN.resx b/Flow.Launcher/Properties/Resources.vi-VN.resx deleted file mode 100644 index b5e00e8a2..000000000 --- a/Flow.Launcher/Properties/Resources.vi-VN.resx +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\Resources\app.ico;System.Drawing.Icon, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Images\gamemode.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file From 4fd05f59f1a4375d51347172d684e39a1cb52f8b Mon Sep 17 00:00:00 2001 From: DB p Date: Sun, 26 May 2024 18:29:02 +0900 Subject: [PATCH 122/141] - RollBack reset logic and Adjust naming --- .../ViewModels/SettingsPaneThemeViewModel.cs | 202 ++---------------- .../SettingPages/Views/SettingsPaneTheme.xaml | 6 + .../Views/SettingsPaneTheme.xaml.cs | 26 ++- 3 files changed, 53 insertions(+), 181 deletions(-) diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs index 8290df79e..6d1f86a1f 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs @@ -77,6 +77,22 @@ public partial class SettingsPaneThemeViewModel : BaseModel set => Settings.ItemHeightSize = value; } + public double QueryBoxFontSize + { + get => Settings.QueryBoxFontSize; + set => Settings.QueryBoxFontSize = value; + } + public double ResultItemFontSize + { + get => Settings.ResultItemFontSize; + set => Settings.ResultItemFontSize = value; + } + + public double ResultSubItemFontSize + { + get => Settings.ResultSubItemFontSize; + set => Settings.ResultSubItemFontSize = value; + } public List Themes => ThemeManager.Instance.LoadAvailableThemes().Select(Path.GetFileNameWithoutExtension).ToList(); @@ -153,6 +169,12 @@ public partial class SettingsPaneThemeViewModel : BaseModel public string DateText => DateTime.Now.ToString(DateFormat, Culture); + public double WindowWidthSize + { + get => Settings.WindowSize; + set => Settings.WindowSize = value; + } + public bool UseGlyphIcons { get => Settings.UseGlyphIcons; @@ -188,7 +210,6 @@ public partial class SettingsPaneThemeViewModel : BaseModel return speeds; } } - public bool UseSound { get => Settings.UseSound; @@ -451,183 +472,4 @@ public partial class SettingsPaneThemeViewModel : BaseModel Settings = settings; } - public string QueryBoxFont - { - get => Settings.QueryBoxFont; - set - { - Settings.QueryBoxFont = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public string QueryBoxFontStyle - { - get => Settings.QueryBoxFontStyle; - set - { - Settings.QueryBoxFontStyle = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public string QueryBoxFontWeight - { - get => Settings.QueryBoxFontWeight; - set - { - Settings.QueryBoxFontWeight = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public string QueryBoxFontStretch - { - get => Settings.QueryBoxFontStretch; - set - { - Settings.QueryBoxFontStretch = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public double QueryBoxFontSize - { - get => Settings.QueryBoxFontSize; - set - { - Settings.QueryBoxFontSize = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public string ResultFont - { - get => Settings.ResultFont; - set - { - Settings.ResultFont = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public string ResultFontStyle - { - get => Settings.ResultFontStyle; - set - { - Settings.ResultFontStyle = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public string ResultFontWeight - { - get => Settings.ResultFontWeight; - set - { - Settings.ResultFontWeight = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public string ResultFontStretch - { - get => Settings.ResultFontStretch; - set - { - Settings.ResultFontStretch = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public double ResultItemFontSize - { - get => Settings.ResultItemFontSize; - set - { - Settings.ResultItemFontSize = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public string ResultSubFont - { - get => Settings.ResultSubFont; - set - { - Settings.ResultSubFont = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public string ResultSubFontStyle - { - get => Settings.ResultSubFontStyle; - set - { - Settings.ResultSubFontStyle = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public string ResultSubFontWeight - { - get => Settings.ResultSubFontWeight; - set - { - Settings.ResultSubFontWeight = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public string ResultSubFontStretch - { - get => Settings.ResultSubFontStretch; - set - { - Settings.ResultSubFontStretch = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public double ResultSubItemFontSize - { - get => Settings.ResultSubItemFontSize; - set - { - Settings.ResultSubItemFontSize = value; - ThemeManager.Instance.ChangeTheme(Settings.Theme); - } - } - - public int CustomAnimationLength - { - get => Settings.CustomAnimationLength; - set => Settings.CustomAnimationLength = value; - } - - public void ResetCustomize() - { - QueryBoxFont = "Segoe UI"; - QueryBoxFontStyle = "Normal"; - QueryBoxFontWeight = "Normal"; - QueryBoxFontStretch = "Normal"; - QueryBoxFontSize = 20; - - ResultFont = "Segoe UI"; - ResultFontStyle = "Normal"; - ResultFontWeight = "Normal"; - ResultFontStretch = "Normal"; - ResultItemFontSize = 16; - - ResultSubFont = "Segoe UI"; - ResultSubFontStyle = "Normal"; - ResultSubFontWeight = "Normal"; - ResultSubFontStretch = "Normal"; - ResultSubItemFontSize = 13; - - ItemHeightSize = 58; - WindowHeightSize = 42; - } } diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml index f9758389f..fd579ae17 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml @@ -116,6 +116,7 @@ TickFrequency="1" Value="{Binding QueryBoxFontSize, Mode=TwoWay}" /> Date: Sun, 26 May 2024 16:01:29 +0600 Subject: [PATCH 123/141] Add option to hide uninstallers from results --- .../Languages/en.xaml | 4 +++- Plugins/Flow.Launcher.Plugin.Program/Main.cs | 23 +++++++++++++++++++ .../Flow.Launcher.Plugin.Program/Settings.cs | 3 ++- .../Views/ProgramSetting.xaml | 5 ++++ .../Views/ProgramSetting.xaml.cs | 12 +++++++++- 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml index d7e87b50b..25ceac3bb 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml @@ -32,6 +32,8 @@ When enabled, Flow will load programs from the PATH environment variable Hide app path For executable files such as UWP or lnk, hide the file path from being visible + Hide uninstallers + Hides programs with common uninstaller names, such as unins000.exe Search in Program Description Flow will search program's description Suffixes @@ -92,4 +94,4 @@ This app is not intended to be run as administrator Unable to run {0} - \ No newline at end of file + diff --git a/Plugins/Flow.Launcher.Plugin.Program/Main.cs b/Plugins/Flow.Launcher.Plugin.Program/Main.cs index e0a7f23de..8bf1830e3 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Main.cs @@ -11,6 +11,7 @@ using Flow.Launcher.Plugin.Program.Programs; using Flow.Launcher.Plugin.Program.Views; using Flow.Launcher.Plugin.Program.Views.Models; using Microsoft.Extensions.Caching.Memory; +using Path = System.IO.Path; using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch; namespace Flow.Launcher.Plugin.Program @@ -33,6 +34,17 @@ namespace Flow.Launcher.Plugin.Program private static readonly MemoryCacheOptions cacheOptions = new() { SizeLimit = 1560 }; private static MemoryCache cache = new(cacheOptions); + private static readonly string[] commonUninstallerNames = + { + "uninst.exe", + "unins000.exe", + "uninst000.exe", + "uninstall.exe" + }; + // For cases when the uninstaller is named like "Uninstall Program Name.exe" + private const string CommonUninstallerPrefix = "uninstall"; + private const string CommonUninstallerSuffix = ".exe"; + static Main() { } @@ -52,6 +64,7 @@ namespace Flow.Launcher.Plugin.Program .Concat(_uwps) .AsParallel() .WithCancellation(token) + .Where(HideUninstallersFilter) .Where(p => p.Enabled) .Select(p => p.Result(query.Search, Context.API)) .Where(r => r?.Score > 0) @@ -68,6 +81,16 @@ namespace Flow.Launcher.Plugin.Program return result; } + private bool HideUninstallersFilter(IProgram program) + { + if (!_settings.HideUninstallers) return true; + if (program is not Win32 win32) return true; + var fileName = Path.GetFileName(win32.ExecutablePath); + return !commonUninstallerNames.Contains(fileName, StringComparer.OrdinalIgnoreCase) && + !(fileName.StartsWith(CommonUninstallerPrefix, StringComparison.OrdinalIgnoreCase) && + fileName.EndsWith(CommonUninstallerSuffix, StringComparison.OrdinalIgnoreCase)); + } + public async Task InitAsync(PluginInitContext context) { Context = context; diff --git a/Plugins/Flow.Launcher.Plugin.Program/Settings.cs b/Plugins/Flow.Launcher.Plugin.Program/Settings.cs index ca203f803..fb24f64d7 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Settings.cs @@ -102,7 +102,7 @@ namespace Flow.Launcher.Plugin.Program // CustomSuffixes no longer contains custom suffixes // users has tweaked the settings // or this function has been executed once - if (UseCustomSuffixes == true || ProgramSuffixes == null) + if (UseCustomSuffixes == true || ProgramSuffixes == null) return; var suffixes = ProgramSuffixes.ToList(); foreach(var item in BuiltinSuffixesStatus) @@ -117,6 +117,7 @@ namespace Flow.Launcher.Plugin.Program public bool EnableStartMenuSource { get; set; } = true; public bool EnableDescription { get; set; } = false; public bool HideAppsPath { get; set; } = true; + public bool HideUninstallers { get; set; } = false; public bool EnableRegistrySource { get; set; } = true; public bool EnablePathSource { get; set; } = false; public bool EnableUWP { get; set; } = true; diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml index fa97de4f2..e5ca6967e 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml @@ -85,6 +85,11 @@ Content="{DynamicResource flowlauncher_plugin_program_enable_hidelnkpath}" IsChecked="{Binding HideAppsPath}" ToolTip="{DynamicResource flowlauncher_plugin_program_enable_hidelnkpath_tooltip}" /> + ProgramSettingDisplayList { get; set; } public bool EnableDescription @@ -47,6 +47,16 @@ namespace Flow.Launcher.Plugin.Program.Views } } + public bool HideUninstallers + { + get => _settings.HideUninstallers; + set + { + Main.ResetCache(); + _settings.HideUninstallers = value; + } + } + public bool EnableRegistrySource { get => _settings.EnableRegistrySource; From 188c409eb4ad43d3e5ecdf838ed83fff464cedb2 Mon Sep 17 00:00:00 2001 From: DB p Date: Sun, 26 May 2024 19:08:09 +0900 Subject: [PATCH 124/141] Adjust Reset Logic --- .../SettingPages/Views/SettingsPaneTheme.xaml | 4 +- .../Views/SettingsPaneTheme.xaml.cs | 87 ++++++++++++++----- 2 files changed, 69 insertions(+), 22 deletions(-) diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml index fd579ae17..d0ef54a99 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml @@ -166,7 +166,7 @@ BorderThickness="1" Style="{StaticResource SettingSeparatorStyle}" /> Date: Sun, 26 May 2024 22:50:48 +0900 Subject: [PATCH 125/141] Add Keep Height (old behaiver) function --- .../UserSettings/Settings.cs | 1 + Flow.Launcher/Languages/en.xaml | 2 ++ Flow.Launcher/MainWindow.xaml.cs | 17 ++++++++++------- .../ViewModels/SettingsPaneGeneralViewModel.cs | 5 +++++ .../Views/SettingsPaneGeneral.xaml | 18 ++++++++++++++++++ 5 files changed, 36 insertions(+), 7 deletions(-) diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index bf269ba12..aeb492162 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -232,6 +232,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings /// public double CustomWindowTop { get; set; } = 0; + public bool KeepMaxResults { get; set; } = false; public int MaxResultsToShow { get; set; } = 5; public int ActivateTimes { get; set; } diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 8a3cf1e80..d1b342751 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -56,6 +56,8 @@ Preserve Last Query Select last Query Empty last Query + Keeping Window Max Height + Window height will keep to fit the maximum number of results Maximum results shown You can also quickly adjust this by using CTRL+Plus and CTRL+Minus. Ignore hotkeys in fullscreen mode diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index c333b6b04..7b497f394 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -120,14 +120,17 @@ namespace Flow.Launcher shadowMargin = 32; } - if (System.Convert.ToInt32((Height - (_settings.WindowHeightSize + 14) - shadowMargin) / _settings.ItemHeightSize) < 1) - { - _settings.MaxResultsToShow = 2; - } - else - { - _settings.MaxResultsToShow = System.Convert.ToInt32(Math.Truncate((Height - (_settings.WindowHeightSize + 14) - shadowMargin) / _settings.ItemHeightSize)); + if (!_settings.KeepMaxResults) { + if (System.Convert.ToInt32((Height - (_settings.WindowHeightSize + 14) - shadowMargin) / _settings.ItemHeightSize) < 1) + { + _settings.MaxResultsToShow = 2; + } + else + { + _settings.MaxResultsToShow = System.Convert.ToInt32(Math.Truncate((Height - (_settings.WindowHeightSize + 14) - shadowMargin) / _settings.ItemHeightSize)); + } } + _settings.WindowSize = Width; FlowMainWindow.SizeToContent = SizeToContent.Height; } diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs index a9718a0ac..cb231d4f5 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs @@ -151,6 +151,11 @@ public partial class SettingsPaneGeneralViewModel : BaseModel public List Languages => InternationalizationManager.Instance.LoadAvailableLanguages(); public IEnumerable MaxResultsRange => Enumerable.Range(2, 16); + public bool KeepMaxResults + { + get => Settings.KeepMaxResults; + set => Settings.KeepMaxResults = value; + } public string AlwaysPreviewToolTip => string.Format( InternationalizationManager.Instance.GetTranslation("AlwaysPreviewToolTip"), diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml index c2b23a295..e983e77db 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml @@ -153,6 +153,24 @@ + + + + + + + + + Date: Mon, 27 May 2024 05:44:16 +0900 Subject: [PATCH 126/141] Adjust Layout for Long Label (language) Adjust Item Position --- .../SettingPages/Views/SettingsPaneTheme.xaml | 526 +++++++++--------- 1 file changed, 252 insertions(+), 274 deletions(-) diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml index d0ef54a99..f3fbac4b8 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneTheme.xaml @@ -38,10 +38,248 @@ Text="{DynamicResource appearance}" TextAlignment="left" Visibility="Collapsed" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +