Add preserve last action keyword options

This commit is contained in:
Yusyuriv 2024-12-09 02:33:19 +06:00
parent 1f81ea09f1
commit 824befdef6
No known key found for this signature in database
GPG key ID: A91C52E6F73148E0
3 changed files with 20 additions and 6 deletions

View file

@ -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

View file

@ -67,6 +67,8 @@
<system:String x:Key="LastQueryPreserved">Preserve Last Query</system:String>
<system:String x:Key="LastQuerySelected">Select last Query</system:String>
<system:String x:Key="LastQueryEmpty">Empty last Query</system:String>
<system:String x:Key="LastQueryActionKeywordPreserved">Preserve Last Action Keyword</system:String>
<system:String x:Key="LastQueryActionKeywordSelected">Select Last Action Keyword</system:String>
<system:String x:Key="KeepMaxResults">Fixed Window Height</system:String>
<system:String x:Key="KeepMaxResultsToolTip">The window height is not adjustable by dragging.</system:String>
<system:String x:Key="maxShowResults">Maximum results shown</system:String>

View file

@ -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}>");
}