diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 0c7de10fd..0bcc9368d 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -62,7 +62,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings public double ItemHeightSize { get; set; } = 58; public double QueryBoxFontSize { get; set; } = 20; public double ResultItemFontSize { get; set; } = 16; - public double ResultSubItemFontSize { get; set; } = 13; + public double ResultSubItemFontSize { get; set; } = 13; public string QueryBoxFont { get; set; } = FontFamily.GenericSansSerif.Name; public string QueryBoxFontStyle { get; set; } public string QueryBoxFontWeight { get; set; } @@ -187,7 +187,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings public bool ShouldUsePinyin { get; set; } = false; public bool AlwaysPreview { get; set; } = false; - + public bool AlwaysStartEn { get; set; } = false; private SearchPrecisionScore _querySearchPrecision = SearchPrecisionScore.Regular; @@ -370,7 +370,9 @@ namespace Flow.Launcher.Infrastructure.UserSettings { Selected, Empty, - Preserved + Preserved, + ActionKeywordPreserved, + ActionKeywordSelected } public enum ColorSchemes diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index ffb03b635..4c465d61f 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -67,6 +67,8 @@ Preserve Last Query Select last Query Empty last Query + Preserve Last Action Keyword + Select Last Action Keyword Fixed Window Height The window height is not adjustable by dragging. Maximum results shown diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 626495cb6..7260593dc 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -771,7 +771,7 @@ namespace Flow.Launcher.ViewModel public string Image => Constant.QueryTextBoxIconImagePath; public bool StartWithEnglishMode => Settings.AlwaysStartEn; - + #endregion #region Preview @@ -833,7 +833,7 @@ namespace Flow.Launcher.ViewModel } private void HidePreview() - { + { if (PluginManager.UseExternalPreview()) CloseExternalPreview(); @@ -912,7 +912,7 @@ namespace Flow.Launcher.ViewModel break; } } - + private void UpdatePreview() { switch (PluginManager.UseExternalPreview()) @@ -1401,6 +1401,16 @@ namespace Flow.Launcher.ViewModel await Task.Delay(100); LastQuerySelected = false; break; + case LastQueryMode.ActionKeywordPreserved or LastQueryMode.ActionKeywordSelected: + var newQuery = _lastQuery.ActionKeyword; + if (!string.IsNullOrEmpty(newQuery)) + newQuery += " "; + ChangeQueryText(newQuery); + if (Settings.UseAnimation) + await Task.Delay(100); + if (Settings.LastQueryMode == LastQueryMode.ActionKeywordSelected) + LastQuerySelected = false; + break; default: throw new ArgumentException($"wrong LastQueryMode: <{Settings.LastQueryMode}>"); }