diff --git a/Flow.Launcher.Core/Plugin/JsonRPCConfigurationModel.cs b/Flow.Launcher.Core/Plugin/JsonRPCConfigurationModel.cs index 1f63f85a8..6dc4be881 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCConfigurationModel.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCConfigurationModel.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace Flow.Launcher.Core.Plugin { @@ -26,6 +27,8 @@ namespace Flow.Launcher.Core.Plugin public string Name { get; set; } public string Label { get; set; } public string Description { get; set; } + public string urlLabel { get; set; } + public Uri url { get; set; } public bool Validation { get; set; } public List Options { get; set; } public string DefaultValue { get; set; } @@ -40,4 +43,4 @@ namespace Flow.Launcher.Core.Plugin DefaultValue = this.DefaultValue; } } -} \ No newline at end of file +} diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs index e3efcd296..4df5037a5 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs @@ -22,6 +22,10 @@ using Control = System.Windows.Controls.Control; using Orientation = System.Windows.Controls.Orientation; using TextBox = System.Windows.Controls.TextBox; using UserControl = System.Windows.Controls.UserControl; +using System.Windows.Documents; +using static System.Windows.Forms.LinkLabel; +using Droplex; +using System.Windows.Forms; namespace Flow.Launcher.Core.Plugin { @@ -33,7 +37,6 @@ namespace Flow.Launcher.Core.Plugin { protected PluginInitContext context; public const string JsonRPC = "JsonRPC"; - /// /// The language this JsonRPCPlugin support /// @@ -340,9 +343,14 @@ namespace Flow.Launcher.Core.Plugin this.context = context; await InitSettingAsync(); } - private static readonly Thickness settingControlMargin = new(10, 4, 10, 4); - private static readonly Thickness settingPanelMargin = new(15, 20, 15, 20); - private static readonly Thickness settingTextBlockMargin = new(10, 4, 10, 4); + private static readonly Thickness settingControlMargin = new(0, 9, 18, 9); + private static readonly Thickness settingCheckboxMargin = new(0, 9, 9, 9); + private static readonly Thickness settingPanelMargin = new(0, 0, 0, 0); + private static readonly Thickness settingTextBlockMargin = new(70, 9, 18, 9); + private static readonly Thickness settingLabelPanelMargin = new(70, 9, 18, 9); + private static readonly Thickness settingLabelMargin = new(0, 0, 0, 0); + private static readonly Thickness settingDescMargin = new(0, 2, 0, 0); + private static readonly Thickness settingSepMargin = new(0, 0, 0, 2); private JsonRpcConfigurationModel _settingsTemplate; public Control CreateSettingPanel() @@ -350,26 +358,60 @@ namespace Flow.Launcher.Core.Plugin if (Settings == null) return new(); var settingWindow = new UserControl(); - var mainPanel = new StackPanel + var mainPanel = new Grid { - Margin = settingPanelMargin, Orientation = Orientation.Vertical + Margin = settingPanelMargin, VerticalAlignment = VerticalAlignment.Center }; - settingWindow.Content = mainPanel; + ColumnDefinition gridCol1 = new ColumnDefinition(); + ColumnDefinition gridCol2 = new ColumnDefinition(); + gridCol1.Width = new GridLength(70, GridUnitType.Star); + gridCol2.Width = new GridLength(30, GridUnitType.Star); + mainPanel.ColumnDefinitions.Add(gridCol1); + mainPanel.ColumnDefinitions.Add(gridCol2); + settingWindow.Content = mainPanel; + int rowCount = 0; foreach (var (type, attribute) in _settingsTemplate.Body) { + Separator sep = new Separator(); + sep.VerticalAlignment = VerticalAlignment.Top; + sep.Margin = settingSepMargin; + sep.SetResourceReference(Separator.BackgroundProperty, "Color03B"); /* for theme change */ var panel = new StackPanel { - Orientation = Orientation.Horizontal, Margin = settingControlMargin + Orientation = Orientation.Vertical, VerticalAlignment = VerticalAlignment.Center, + Margin = settingLabelPanelMargin }; + RowDefinition gridRow = new RowDefinition(); + mainPanel.RowDefinitions.Add(gridRow); var name = new TextBlock() { Text = attribute.Label, - Width = 120, VerticalAlignment = VerticalAlignment.Center, - Margin = settingControlMargin, + Margin = settingLabelMargin, TextWrapping = TextWrapping.WrapWithOverflow }; + var desc = new TextBlock() + { + Text = attribute.Description, FontSize = 12, + VerticalAlignment = VerticalAlignment.Center,Margin = settingDescMargin, + TextWrapping = TextWrapping.WrapWithOverflow + }; + desc.SetResourceReference(TextBlock.ForegroundProperty, "Color04B"); + + if (attribute.Description == null) /* if no description, hide */ + desc.Visibility = Visibility.Collapsed; + + + if (type != "textBlock") /* if textBlock, hide desc */ + { + panel.Children.Add(name); + panel.Children.Add(desc); + } + + + Grid.SetColumn(panel, 0); + Grid.SetRow(panel, rowCount); FrameworkElement contentControl; @@ -381,18 +423,28 @@ namespace Flow.Launcher.Core.Plugin { Text = attribute.Description.Replace("\\r\\n", "\r\n"), Margin = settingTextBlockMargin, - MaxWidth = 500, - TextWrapping = TextWrapping.WrapWithOverflow + Padding = new Thickness(0,0,0,0), + HorizontalAlignment = System.Windows.HorizontalAlignment.Left, + TextAlignment = TextAlignment.Left, + TextWrapping = TextWrapping.Wrap }; - break; + Grid.SetColumn(contentControl, 0); + Grid.SetColumnSpan(contentControl, 2); + Grid.SetRow(contentControl, rowCount); + if (rowCount != 0) + mainPanel.Children.Add(sep); + Grid.SetRow(sep, rowCount); + Grid.SetColumn(sep, 0); + Grid.SetColumnSpan(sep, 2); + break; } case "input": { var textBox = new TextBox() { - Width = 300, Text = Settings[attribute.Name] as string ?? string.Empty, Margin = settingControlMargin, + HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, ToolTip = attribute.Description }; textBox.TextChanged += (_, _) => @@ -400,17 +452,60 @@ namespace Flow.Launcher.Core.Plugin Settings[attribute.Name] = textBox.Text; }; contentControl = textBox; - break; + Grid.SetColumn(contentControl, 1); + Grid.SetRow(contentControl, rowCount); + if (rowCount != 0) + mainPanel.Children.Add(sep); + Grid.SetRow(sep, rowCount); + Grid.SetColumn(sep, 0); + Grid.SetColumnSpan(sep, 2); + break; } + case "inputWithFileBtn": + { + var textBox = new TextBox() + { + Margin = new Thickness(10, 0, 0, 0), + Text = Settings[attribute.Name] as string ?? string.Empty, + HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, + ToolTip = attribute.Description + }; + textBox.TextChanged += (_, _) => + { + Settings[attribute.Name] = textBox.Text; + }; + var Btn = new System.Windows.Controls.Button() + { + Margin = new Thickness(10,0,0,0), + Content = "Browse" + }; + var dockPanel = new DockPanel() + { + Margin = settingControlMargin + }; + DockPanel.SetDock(Btn, Dock.Right); + dockPanel.Children.Add(Btn); + dockPanel.Children.Add(textBox); + contentControl = dockPanel; + Grid.SetColumn(contentControl, 1); + Grid.SetRow(contentControl, rowCount); + if (rowCount != 0) + mainPanel.Children.Add(sep); + Grid.SetRow(sep, rowCount); + Grid.SetColumn(sep, 0); + Grid.SetColumnSpan(sep, 2); + break; + } case "textarea": { var textBox = new TextBox() { - Width = 300, Height = 120, Margin = settingControlMargin, + VerticalAlignment = VerticalAlignment.Center, TextWrapping = TextWrapping.WrapWithOverflow, AcceptsReturn = true, + HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, Text = Settings[attribute.Name] as string ?? string.Empty, ToolTip = attribute.Description }; @@ -419,16 +514,23 @@ namespace Flow.Launcher.Core.Plugin Settings[attribute.Name] = ((TextBox)sender).Text; }; contentControl = textBox; - break; + Grid.SetColumn(contentControl, 1); + Grid.SetRow(contentControl, rowCount); + if (rowCount != 0) + mainPanel.Children.Add(sep); + Grid.SetRow(sep, rowCount); + Grid.SetColumn(sep, 0); + Grid.SetColumnSpan(sep, 2); + break; } case "passwordBox": { var passwordBox = new PasswordBox() { - Width = 300, Margin = settingControlMargin, Password = Settings[attribute.Name] as string ?? string.Empty, PasswordChar = attribute.passwordChar == default ? '*' : attribute.passwordChar, + HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, ToolTip = attribute.Description }; passwordBox.PasswordChanged += (sender, _) => @@ -436,29 +538,45 @@ namespace Flow.Launcher.Core.Plugin Settings[attribute.Name] = ((PasswordBox)sender).Password; }; contentControl = passwordBox; - break; + Grid.SetColumn(contentControl, 1); + Grid.SetRow(contentControl, rowCount); + if (rowCount != 0) + mainPanel.Children.Add(sep); + Grid.SetRow(sep, rowCount); + Grid.SetColumn(sep, 0); + Grid.SetColumnSpan(sep, 2); + break; } case "dropdown": { - var comboBox = new ComboBox() + var comboBox = new System.Windows.Controls.ComboBox() { ItemsSource = attribute.Options, SelectedItem = Settings[attribute.Name], Margin = settingControlMargin, + HorizontalAlignment = System.Windows.HorizontalAlignment.Right, ToolTip = attribute.Description }; comboBox.SelectionChanged += (sender, _) => { - Settings[attribute.Name] = (string)((ComboBox)sender).SelectedItem; + Settings[attribute.Name] = (string)((System.Windows.Controls.ComboBox)sender).SelectedItem; }; contentControl = comboBox; - break; + Grid.SetColumn(contentControl, 1); + Grid.SetRow(contentControl, rowCount); + if (rowCount != 0) + mainPanel.Children.Add(sep); + Grid.SetRow(sep, rowCount); + Grid.SetColumn(sep, 0); + Grid.SetColumnSpan(sep, 2); + break; } case "checkbox": var checkBox = new CheckBox { IsChecked = Settings[attribute.Name] is bool isChecked ? isChecked : bool.Parse(attribute.DefaultValue), - Margin = settingControlMargin, + Margin = settingCheckboxMargin, + HorizontalAlignment = System.Windows.HorizontalAlignment.Right, ToolTip = attribute.Description }; checkBox.Click += (sender, _) => @@ -466,15 +584,45 @@ namespace Flow.Launcher.Core.Plugin Settings[attribute.Name] = ((CheckBox)sender).IsChecked; }; contentControl = checkBox; + Grid.SetColumn(contentControl, 1); + Grid.SetRow(contentControl, rowCount); + if (rowCount != 0) + mainPanel.Children.Add(sep); + Grid.SetRow(sep, rowCount); + Grid.SetColumn(sep, 0); + Grid.SetColumnSpan(sep, 2); + break; + case "hyperlink": + var hyperlink = new Hyperlink + { + ToolTip = attribute.Description, + NavigateUri = attribute.url + }; + var linkbtn = new System.Windows.Controls.Button + { + HorizontalAlignment = System.Windows.HorizontalAlignment.Right, + Margin = settingControlMargin + }; + linkbtn.Content = attribute.urlLabel; + + contentControl = linkbtn; + Grid.SetColumn(contentControl, 1); + Grid.SetRow(contentControl, rowCount); + if (rowCount != 0) + mainPanel.Children.Add(sep); + Grid.SetRow(sep, rowCount); + Grid.SetColumn(sep, 0); + Grid.SetColumnSpan(sep, 2); break; default: continue; } if (type != "textBlock") _settingControls[attribute.Name] = contentControl; - panel.Children.Add(name); - panel.Children.Add(contentControl); mainPanel.Children.Add(panel); + mainPanel.Children.Add(contentControl); + rowCount++; + } return settingWindow; } @@ -510,7 +658,7 @@ namespace Flow.Launcher.Core.Plugin case PasswordBox passwordBox: passwordBox.Dispatcher.Invoke(() => passwordBox.Password = value as string); break; - case ComboBox comboBox: + case System.Windows.Controls.ComboBox comboBox: comboBox.Dispatcher.Invoke(() => comboBox.SelectedItem = value); break; case CheckBox checkBox: diff --git a/Flow.Launcher/Images/Browser.png b/Flow.Launcher/Images/Browser.png index 5d475f82e..a5bc848c7 100644 Binary files a/Flow.Launcher/Images/Browser.png and b/Flow.Launcher/Images/Browser.png differ diff --git a/Flow.Launcher/Images/app_missing_img.png b/Flow.Launcher/Images/app_missing_img.png index 27e366bbc..0bb16e5d8 100644 Binary files a/Flow.Launcher/Images/app_missing_img.png and b/Flow.Launcher/Images/app_missing_img.png differ diff --git a/Flow.Launcher/Languages/da.xaml b/Flow.Launcher/Languages/da.xaml index f196412d3..5c6a74fe4 100644 --- a/Flow.Launcher/Languages/da.xaml +++ b/Flow.Launcher/Languages/da.xaml @@ -1,5 +1,8 @@ - - + + Kunne ikke registrere genvejstast: {0} Kunne ikke starte {0} @@ -87,7 +90,7 @@ af Initaliseringstid: Søgetid: - | Version + Version Website Uninstall diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index fe2e4a8e4..d0bdfee9b 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -91,7 +91,7 @@ by Init time: Query time: - | Version + Version Website Uninstall diff --git a/Flow.Launcher/Languages/es-419.xaml b/Flow.Launcher/Languages/es-419.xaml index c87841693..eae8f7c1f 100644 --- a/Flow.Launcher/Languages/es-419.xaml +++ b/Flow.Launcher/Languages/es-419.xaml @@ -1,5 +1,8 @@ - - + + Error al registrar la tecla de acceso directo: {0} No se pudo iniciar {0} @@ -87,7 +90,7 @@ por Tiempo de inicio: Tiempo de consulta: - | Versión + Versión Sitio web Uninstall diff --git a/Flow.Launcher/Languages/es.xaml b/Flow.Launcher/Languages/es.xaml index 537152663..a974172b8 100644 --- a/Flow.Launcher/Languages/es.xaml +++ b/Flow.Launcher/Languages/es.xaml @@ -1,5 +1,8 @@ - - + + No se ha podido registrar el atajo de teclado: {0} No se ha podido iniciar {0} @@ -87,7 +90,7 @@ por Tiempo de inicio: Tiempo de consulta: - | Versión + Versión Sitio web Desinstalar diff --git a/Flow.Launcher/Languages/fr.xaml b/Flow.Launcher/Languages/fr.xaml index 08ea382ae..efd1a9b13 100644 --- a/Flow.Launcher/Languages/fr.xaml +++ b/Flow.Launcher/Languages/fr.xaml @@ -1,5 +1,8 @@ - - + + Impossible d'enregistrer le raccourci clavier : {0} Impossible de lancer {0} @@ -87,7 +90,7 @@ by Chargement : Utilisation : - | Version + Version Website Désinstaller diff --git a/Flow.Launcher/Languages/it.xaml b/Flow.Launcher/Languages/it.xaml index 0518c0da3..7a8b174c3 100644 --- a/Flow.Launcher/Languages/it.xaml +++ b/Flow.Launcher/Languages/it.xaml @@ -1,5 +1,8 @@ - - + + Impossibile salvare il tasto di scelta rapida: {0} Avvio fallito {0} @@ -87,7 +90,7 @@ da Tempo di avvio: Tempo ricerca: - | Versione + Versione Sito Web Disinstalla @@ -200,8 +203,8 @@ Una nuova versione {0} è disponibile, riavvia Flow Launcher per favore. Ricerca aggiornamenti fallita, per favore controlla la tua connessione e le eventuali impostazioni proxy per api.github.com. - Download degli aggiornamenti fallito, per favore controlla la tua connessione ed eventuali impostazioni proxy per github-cloud.s3.amazonaws.com, - oppure vai su https://github.com/Flow-Launcher/Flow.Launcher/releases per scaricare gli aggiornamenti manualmente. + Download degli aggiornamenti fallito, per favore controlla la tua connessione ed eventuali impostazioni proxy per github-cloud.s3.amazonaws.com, + oppure vai su https://github.com/Flow-Launcher/Flow.Launcher/releases per scaricare gli aggiornamenti manualmente. Note di rilascio Usage Tips diff --git a/Flow.Launcher/Languages/ja.xaml b/Flow.Launcher/Languages/ja.xaml index a05d3681b..fcbf6e8e8 100644 --- a/Flow.Launcher/Languages/ja.xaml +++ b/Flow.Launcher/Languages/ja.xaml @@ -1,5 +1,8 @@ - - + + ホットキー「{0}」の登録に失敗しました {0}の起動に失敗しました @@ -87,7 +90,7 @@ by 初期化時間: クエリ時間: - | バージョン + バージョン ウェブサイト アンインストール @@ -250,7 +253,7 @@ アクションキーボードを指定しない場合、* を使用してください - + Press a custom hotkey to open Flow Laucher and input the specified query automatically. プレビュー ホットキーは使用できません。新しいホットキーを選択してください diff --git a/Flow.Launcher/Languages/ko.xaml b/Flow.Launcher/Languages/ko.xaml index 071a1fc44..21bf8f087 100644 --- a/Flow.Launcher/Languages/ko.xaml +++ b/Flow.Launcher/Languages/ko.xaml @@ -1,5 +1,8 @@ - - + + 단축키 등록 실패: {0} {0}을 실행할 수 없습니다. @@ -87,7 +90,7 @@ 제작자 초기화 시간: 쿼리 시간: - | 버전 + 버전 웹사이트 제거 diff --git a/Flow.Launcher/Languages/nb.xaml b/Flow.Launcher/Languages/nb.xaml index 0a45549eb..0c23baf7d 100644 --- a/Flow.Launcher/Languages/nb.xaml +++ b/Flow.Launcher/Languages/nb.xaml @@ -1,5 +1,8 @@ - - + + Failed to register hotkey: {0} Could not start {0} @@ -87,7 +90,7 @@ by Init time: Query time: - | Version + Version Website Uninstall diff --git a/Flow.Launcher/Languages/pl.xaml b/Flow.Launcher/Languages/pl.xaml index dc24b5fe1..0131873ff 100644 --- a/Flow.Launcher/Languages/pl.xaml +++ b/Flow.Launcher/Languages/pl.xaml @@ -1,5 +1,8 @@ - - + + Nie udało się ustawić skrótu klawiszowego: {0} Nie udało się uruchomić: {0} @@ -87,7 +90,7 @@ by Czas ładowania: Czas zapytania: - | Version + Version Website Odinstalowywanie diff --git a/Flow.Launcher/Languages/pt-br.xaml b/Flow.Launcher/Languages/pt-br.xaml index 1042b5d99..1dffe8918 100644 --- a/Flow.Launcher/Languages/pt-br.xaml +++ b/Flow.Launcher/Languages/pt-br.xaml @@ -1,5 +1,8 @@ - - + + Falha ao registrar atalho: {0} Não foi possível iniciar {0} @@ -87,7 +90,7 @@ by Tempo de inicialização: Tempo de consulta: - | Version + Version Website Desinstalar diff --git a/Flow.Launcher/Languages/ru.xaml b/Flow.Launcher/Languages/ru.xaml index fedf7e57a..0ba6345c9 100644 --- a/Flow.Launcher/Languages/ru.xaml +++ b/Flow.Launcher/Languages/ru.xaml @@ -1,5 +1,8 @@ - - + + Регистрация хоткея {0} не удалась Не удалось запустить {0} @@ -87,7 +90,7 @@ by Инициализация: Запрос: - | Version + Version Website Удалить diff --git a/Flow.Launcher/Languages/sk.xaml b/Flow.Launcher/Languages/sk.xaml index 1990c5ee2..211036ab3 100644 --- a/Flow.Launcher/Languages/sk.xaml +++ b/Flow.Launcher/Languages/sk.xaml @@ -1,5 +1,8 @@ - - + + Nepodarilo sa registrovať klávesovú skratku {0} Nepodarilo sa spustiť {0} @@ -87,7 +90,7 @@ od Inicializácia: Trvanie dopytu: - | Verzia + Verzia Webstránka Odinštalovať @@ -292,7 +295,7 @@ Aktualizuje sa... Flow Launcher nedokázal presunúť používateľské údaje do aktualizovanej verzie. - Prosím, presuňte profilový priečinok data z {0} do {1} + Prosím, presuňte profilový priečinok data z {0} do {1} Nová aktualizácia Je dostupná nová verzia Flow Launchera {0} diff --git a/Flow.Launcher/Languages/sr.xaml b/Flow.Launcher/Languages/sr.xaml index 471be8040..6626ac8fd 100644 --- a/Flow.Launcher/Languages/sr.xaml +++ b/Flow.Launcher/Languages/sr.xaml @@ -1,5 +1,8 @@ - - + + Neuspešno registrovana prečica: {0} Neuspešno pokretanje {0} @@ -87,7 +90,7 @@ by Vreme inicijalizacije: Vreme upita: - | Version + Version Website Uninstall @@ -200,7 +203,7 @@ Nove verzija {0} je dostupna, molim Vas ponovo pokrenite Flow Launcher. Neuspešna provera ažuriranja, molim Vas proverite vašu vezu i podešavanja za proksi prema api.github.com. - Neuspešno preuzimanje ažuriranja, molim Vas proverite vašu vezu i podešavanja za proksi prema github-cloud.s3.amazonaws.com, + Neuspešno preuzimanje ažuriranja, molim Vas proverite vašu vezu i podešavanja za proksi prema github-cloud.s3.amazonaws.com, ili posetite https://github.com/Flow-Launcher/Flow.Launcher/releases da preuzmete ažuriranja ručno. U novoj verziji diff --git a/Flow.Launcher/Languages/uk-UA.xaml b/Flow.Launcher/Languages/uk-UA.xaml index 366a7ccbc..2750df6f5 100644 --- a/Flow.Launcher/Languages/uk-UA.xaml +++ b/Flow.Launcher/Languages/uk-UA.xaml @@ -1,5 +1,8 @@ - - + + Реєстрація хоткея {0} не вдалася Не вдалося запустити {0} @@ -87,7 +90,7 @@ за Ініціалізація: Запит: - | Версія + Версія Сайт Uninstall diff --git a/Flow.Launcher/Languages/zh-cn.xaml b/Flow.Launcher/Languages/zh-cn.xaml index 0cf95ec4e..449be9919 100644 --- a/Flow.Launcher/Languages/zh-cn.xaml +++ b/Flow.Launcher/Languages/zh-cn.xaml @@ -1,5 +1,8 @@ - - + + 注册热键:{0} 失败 启动命令 {0} 失败 @@ -87,7 +90,7 @@ 出自 加载耗时: 查询耗时: - | 版本 + 版本 官方网站 卸载 @@ -200,7 +203,7 @@ 发现新版本 {0}, 请重启 Flow Launcher 下载更新失败,请检查您与 api.github.com 的连接状态或检查代理设置 - 下载更新失败,请检查您与 github-cloud.s3.amazonaws.com 的连接状态或检查代理设置, + 下载更新失败,请检查您与 github-cloud.s3.amazonaws.com 的连接状态或检查代理设置, 或访问 https://github.com/Flow-Launcher/Flow.Launcher/releases 手动下载更新 更新说明 diff --git a/Flow.Launcher/Languages/zh-tw.xaml b/Flow.Launcher/Languages/zh-tw.xaml index 7f4a40929..b9ea5605d 100644 --- a/Flow.Launcher/Languages/zh-tw.xaml +++ b/Flow.Launcher/Languages/zh-tw.xaml @@ -1,5 +1,8 @@ - - + + 登錄快捷鍵:{0} 失敗 啟動命令 {0} 失敗 @@ -87,7 +90,7 @@ 作者 載入耗時: 查詢耗時: - | 版本 + 版本 官方網站 解除安裝 diff --git a/Flow.Launcher/Resources/CustomControlTemplate.xaml b/Flow.Launcher/Resources/CustomControlTemplate.xaml index 07897361c..451dc5344 100644 --- a/Flow.Launcher/Resources/CustomControlTemplate.xaml +++ b/Flow.Launcher/Resources/CustomControlTemplate.xaml @@ -3230,4 +3230,26 @@ + + + diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 5f26a74cb..5c3c12710 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -1010,7 +1010,6 @@ TextAlignment="Left" /> - - - - - - - - - + FontSize="11" + Foreground="{DynamicResource PluginInfoColor}" + Text="|" /> + + + - + RequestNavigate="OnRequestNavigate" + Style="{DynamicResource HyperLinkBtnStyle}" + TextDecorations="None"> + - - + Style="{DynamicResource LinkBtnStyle}" + Text="" + ToolTip="{DynamicResource plugin_uninstall}" /> + Margin="10,0,5,0" + Style="{DynamicResource LinkBtnStyle}" + Text="" + ToolTip="{DynamicResource pluginDirectory}"> - + - - - - diff --git a/Flow.Launcher/ViewModel/PluginViewModel.cs b/Flow.Launcher/ViewModel/PluginViewModel.cs index f371f32d6..65ba657ba 100644 --- a/Flow.Launcher/ViewModel/PluginViewModel.cs +++ b/Flow.Launcher/ViewModel/PluginViewModel.cs @@ -1,4 +1,4 @@ -using System.Threading.Tasks; +using System.Threading.Tasks; using System.Windows; using System.Windows.Media; using Flow.Launcher.Plugin; @@ -6,6 +6,7 @@ using Flow.Launcher.Infrastructure.Image; using Flow.Launcher.Core.Plugin; using System.Windows.Controls; using CommunityToolkit.Mvvm.Input; +using Flow.Launcher.Core.Resource; namespace Flow.Launcher.ViewModel { @@ -74,6 +75,8 @@ namespace Flow.Launcher.ViewModel public Visibility ActionKeywordsVisibility => PluginPair.Metadata.ActionKeywords.Count == 1 ? Visibility.Visible : Visibility.Collapsed; public string InitilizaTime => PluginPair.Metadata.InitTime + "ms"; public string QueryTime => PluginPair.Metadata.AvgQueryTime + "ms"; + public string Version => InternationalizationManager.Instance.GetTranslation("plugin_query_version") + " " + PluginPair.Metadata.Version; + public string InitAndQueryTime => InternationalizationManager.Instance.GetTranslation("plugin_init_time") + " " + PluginPair.Metadata.InitTime + "ms, " + InternationalizationManager.Instance.GetTranslation("plugin_query_time") + " " + PluginPair.Metadata.AvgQueryTime + "ms"; public string ActionKeywordsText => string.Join(Query.ActionKeywordSeparator, PluginPair.Metadata.ActionKeywords); public int Priority => PluginPair.Metadata.Priority; diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Images/bookmark.png b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Images/bookmark.png index d68cecea1..ee2c7388f 100644 Binary files a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Images/bookmark.png and b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Images/bookmark.png differ diff --git a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs index f9127cd3c..d072a362d 100644 --- a/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs @@ -183,7 +183,8 @@ namespace Flow.Launcher.Plugin.BrowserBookmark return false; } }, - IcoPath = "Images\\copylink.png" + IcoPath = "Images\\copylink.png", + Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue8c8") } }; } @@ -200,4 +201,4 @@ namespace Flow.Launcher.Plugin.BrowserBookmark } } } -} \ No newline at end of file +} diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Images/calculator.png b/Plugins/Flow.Launcher.Plugin.Calculator/Images/calculator.png index 4bdade8b7..81697a8e8 100644 Binary files a/Plugins/Flow.Launcher.Plugin.Calculator/Images/calculator.png and b/Plugins/Flow.Launcher.Plugin.Calculator/Images/calculator.png differ diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index 1a6159073..522286524 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -57,7 +57,7 @@ namespace Flow.Launcher.Plugin.Explorer var icoPath = (record.Type == ResultType.File) ? Constants.FileImagePath : Constants.FolderImagePath; var fileOrFolder = (record.Type == ResultType.File) ? "file" : "folder"; - if (Settings.QuickAccessLinks.All(x => x.Path != record.FullPath)) + if (Settings.QuickAccessLinks.All(x => !x.Path.Equals(record.FullPath, StringComparison.OrdinalIgnoreCase))) { contextMenus.Add(new Result { @@ -82,7 +82,8 @@ namespace Flow.Launcher.Plugin.Explorer }, SubTitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_titletooltip"), TitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_titletooltip"), - IcoPath = Constants.QuickAccessImagePath + IcoPath = Constants.QuickAccessImagePath, + Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue718"), }); } else @@ -107,7 +108,8 @@ namespace Flow.Launcher.Plugin.Explorer }, SubTitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_remove_titletooltip"), TitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_remove_titletooltip"), - IcoPath = Constants.RemoveQuickAccessImagePath + IcoPath = Constants.RemoveQuickAccessImagePath, + Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\uecc9") }); } @@ -130,7 +132,8 @@ namespace Flow.Launcher.Plugin.Explorer return false; } }, - IcoPath = Constants.CopyImagePath + IcoPath = Constants.CopyImagePath, + Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue8c8") }); contextMenus.Add(new Result @@ -156,7 +159,8 @@ namespace Flow.Launcher.Plugin.Explorer } }, - IcoPath = icoPath + IcoPath = icoPath, + Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\uf12b") }); @@ -199,7 +203,8 @@ namespace Flow.Launcher.Plugin.Explorer return true; }, - IcoPath = Constants.DeleteFileFolderImagePath + IcoPath = Constants.DeleteFileFolderImagePath, + Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue74d") }); if (record.Type is not ResultType.Volume) @@ -297,7 +302,8 @@ namespace Flow.Launcher.Plugin.Explorer return true; }, - IcoPath = Constants.FolderImagePath + IcoPath = Constants.FolderImagePath, + Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue838") }; } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index 4ddc75cfe..88bfecc14 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -21,16 +21,15 @@ namespace Flow.Launcher.Plugin.Explorer.Search Settings = settings; } - private static string GetPathWithActionKeyword(string path, ResultType type) + private static string GetPathWithActionKeyword(string path, ResultType type, string actionKeyword) { - // one of it is enabled - var keyword = Settings.SearchActionKeywordEnabled ? Settings.SearchActionKeyword : Settings.PathSearchActionKeyword; - - keyword = keyword == Query.GlobalPluginWildcardSign ? string.Empty : keyword + " "; + // Query.ActionKeyword is string.Empty when Global Action Keyword ('*') is used + var keyword = actionKeyword != string.Empty ? actionKeyword + " " : string.Empty; var formatted_path = path; if (type == ResultType.Folder) + // the seperator is needed so when navigating the folder structure contents of the folder are listed formatted_path = path.EndsWith(Constants.DirectorySeperator) ? path : path + Constants.DirectorySeperator; return $"{keyword}{formatted_path}"; @@ -55,7 +54,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search Title = title, IcoPath = path, SubTitle = Path.GetDirectoryName(path), - AutoCompleteText = GetPathWithActionKeyword(path, ResultType.Folder), + AutoCompleteText = GetPathWithActionKeyword(path, ResultType.Folder, query.ActionKeyword), TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData, CopyText = path, Action = c => @@ -74,7 +73,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search } } - Context.API.ChangeQuery(GetPathWithActionKeyword(path, ResultType.Folder)); + Context.API.ChangeQuery(GetPathWithActionKeyword(path, ResultType.Folder, query.ActionKeyword)); return false; }, @@ -90,7 +89,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search }; } - internal static Result CreateDriveSpaceDisplayResult(string path, bool windowsIndexed = false) + internal static Result CreateDriveSpaceDisplayResult(string path, string actionKeyword, bool windowsIndexed = false) { var progressBarColor = "#26a0da"; var title = string.Empty; // hide title when use progress bar, @@ -109,7 +108,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search { Title = title, SubTitle = subtitle, - AutoCompleteText = GetPathWithActionKeyword(path, ResultType.Folder), + AutoCompleteText = GetPathWithActionKeyword(path, ResultType.Folder, actionKeyword), IcoPath = path, Score = 500, ProgressBar = progressValue, @@ -166,9 +165,13 @@ namespace Flow.Launcher.Plugin.Explorer.Search return returnStr; } - internal static Result CreateOpenCurrentFolderResult(string path, bool windowsIndexed = false) + internal static Result CreateOpenCurrentFolderResult(string path, string actionKeyword, bool windowsIndexed = false) { - var folderName = path.TrimEnd(Constants.DirectorySeperator).Split(new[] + // Path passed from PathSearchAsync ends with Constants.DirectorySeperator ('\'), need to remove the seperator + // so it's consistent with folder results returned by index search which does not end with one + var folderPath = path.TrimEnd(Constants.DirectorySeperator); + + var folderName = folderPath.TrimEnd(Constants.DirectorySeperator).Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.None).Last(); @@ -186,19 +189,19 @@ namespace Flow.Launcher.Plugin.Explorer.Search Title = title, SubTitle = $"Use > to search within {subtitleFolderName}, " + $"* to search for file extensions or >* to combine both searches.", - AutoCompleteText = GetPathWithActionKeyword(path, ResultType.Folder), - IcoPath = path, + AutoCompleteText = GetPathWithActionKeyword(folderPath, ResultType.Folder, actionKeyword), + IcoPath = folderPath, Score = 500, - CopyText = path, + CopyText = folderPath, Action = _ => { - Context.API.OpenDirectory(path); + Context.API.OpenDirectory(folderPath); return true; }, ContextData = new SearchResult { Type = ResultType.Folder, - FullPath = path, + FullPath = folderPath, WindowsIndexed = windowsIndexed } }; @@ -217,7 +220,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search SubTitle = Path.GetDirectoryName(filePath), IcoPath = filePath, Preview = preview, - AutoCompleteText = GetPathWithActionKeyword(filePath, ResultType.File), + AutoCompleteText = GetPathWithActionKeyword(filePath, ResultType.File, query.ActionKeyword), TitleHighlightData = StringMatcher.FuzzySearch(query.Search, Path.GetFileName(filePath)).MatchData, Score = score, CopyText = filePath, diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index 8d477d8e9..99a1a7110 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -176,8 +176,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search var retrievedDirectoryPath = FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath); results.Add(retrievedDirectoryPath.EndsWith(":\\") - ? ResultManager.CreateDriveSpaceDisplayResult(retrievedDirectoryPath, useIndexSearch) - : ResultManager.CreateOpenCurrentFolderResult(retrievedDirectoryPath, useIndexSearch)); + ? ResultManager.CreateDriveSpaceDisplayResult(retrievedDirectoryPath, query.ActionKeyword, useIndexSearch) + : ResultManager.CreateOpenCurrentFolderResult(retrievedDirectoryPath, query.ActionKeyword, useIndexSearch)); if (token.IsCancellationRequested) return new List(); diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Images/manifestsite.png b/Plugins/Flow.Launcher.Plugin.PluginsManager/Images/manifestsite.png index 54f3f62fc..59d362f02 100644 Binary files a/Plugins/Flow.Launcher.Plugin.PluginsManager/Images/manifestsite.png and b/Plugins/Flow.Launcher.Plugin.PluginsManager/Images/manifestsite.png differ diff --git a/Plugins/Flow.Launcher.Plugin.PluginsManager/Images/pluginsmanager.png b/Plugins/Flow.Launcher.Plugin.PluginsManager/Images/pluginsmanager.png index 91b3148c5..d81271d64 100644 Binary files a/Plugins/Flow.Launcher.Plugin.PluginsManager/Images/pluginsmanager.png and b/Plugins/Flow.Launcher.Plugin.PluginsManager/Images/pluginsmanager.png differ diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Images/app.png b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Images/app.png index 418086275..2d42920f9 100644 Binary files a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Images/app.png and b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Images/app.png differ diff --git a/Plugins/Flow.Launcher.Plugin.Program/AddProgramSource.xaml b/Plugins/Flow.Launcher.Plugin.Program/AddProgramSource.xaml index b1a8744fd..9ee97e3e9 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/AddProgramSource.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/AddProgramSource.xaml @@ -101,7 +101,7 @@ DockPanel.Dock="Right" /> diff --git a/Plugins/Flow.Launcher.Plugin.Program/Images/program.png b/Plugins/Flow.Launcher.Plugin.Program/Images/program.png index ecc91bdb3..d666362ce 100644 Binary files a/Plugins/Flow.Launcher.Plugin.Program/Images/program.png and b/Plugins/Flow.Launcher.Plugin.Program/Images/program.png differ diff --git a/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml index 700c37046..8d642b600 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml @@ -12,6 +12,9 @@ Enable Enabled Disable + Status + Enabled + Disabled Location All Programs File Type @@ -28,7 +31,7 @@ Hide app path For executable files such as UWP or lnk, hide the file path from being visible Search in Program Description - Disabling this will also stop Flow from searching via the program desciption + Flow will search program's description Suffixes Max Depth diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml index 798c0d911..ab32dade2 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml @@ -90,10 +90,9 @@ BorderBrush="{DynamicResource Color03B}" BorderThickness="1" />