mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Add settings ui
This commit is contained in:
parent
b1a46817f0
commit
3abcebd02b
5 changed files with 44 additions and 2 deletions
|
|
@ -276,7 +276,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
public bool HideWhenDeactivated { get; set; } = true;
|
||||
|
||||
public bool SearchQueryResultsWithDelay { get; set; } = false;
|
||||
public int SearchInputDelay { get; set; } = 150;
|
||||
public int SearchInputDelay { get; set; } = 120;
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
public SearchWindowScreens SearchWindowScreen { get; set; } = SearchWindowScreens.Cursor;
|
||||
|
|
|
|||
|
|
@ -94,6 +94,10 @@
|
|||
<system:String x:Key="hideOnStartupToolTip">Flow Launcher search window is hidden in the tray after starting up.</system:String>
|
||||
<system:String x:Key="hideNotifyIcon">Hide tray icon</system:String>
|
||||
<system:String x:Key="hideNotifyIconToolTip">When the icon is hidden from the tray, the Settings menu can be opened by right-clicking on the search window.</system:String>
|
||||
<system:String x:Key="searchDelay">Search Delay</system:String>
|
||||
<system:String x:Key="searchDelayToolTip">Delay for a while to search when typing. This reduces interface jumpiness and result load.</system:String>
|
||||
<system:String x:Key="searchDelayTime">Search Delay Time</system:String>
|
||||
<system:String x:Key="searchDelayTimeToolTip">Delay time which search results appear when typing is stopped. Default is 120ms.</system:String>
|
||||
<system:String x:Key="querySearchPrecision">Query Search Precision</system:String>
|
||||
<system:String x:Key="querySearchPrecisionToolTip">Changes minimum match score required for results.</system:String>
|
||||
<system:String x:Key="SearchPrecisionNone">None</system:String>
|
||||
|
|
|
|||
|
|
@ -865,7 +865,7 @@ namespace Flow.Launcher
|
|||
|
||||
private IDisposable _reactiveSubscription;
|
||||
|
||||
private void SetupSearchTextBoxReactiveness(bool showResultsWithDelay)
|
||||
public void SetupSearchTextBoxReactiveness(bool showResultsWithDelay)
|
||||
{
|
||||
if (_reactiveSubscription != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -139,6 +139,22 @@ public partial class SettingsPaneGeneralViewModel : BaseModel
|
|||
}
|
||||
}
|
||||
|
||||
public bool SearchQueryResultsWithDelay
|
||||
{
|
||||
get => Settings.SearchQueryResultsWithDelay;
|
||||
set
|
||||
{
|
||||
Settings.SearchQueryResultsWithDelay = value;
|
||||
|
||||
((MainWindow)System.Windows.Application.Current.MainWindow).SetupSearchTextBoxReactiveness(value);
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<int> SearchInputDelayRange => new List<int>()
|
||||
{
|
||||
30, 60, 90, 120, 150, 180, 210, 240, 270, 300
|
||||
};
|
||||
|
||||
public List<LastQueryModeData> LastQueryModes { get; } =
|
||||
DropdownDataGeneric<LastQueryMode>.GetValues<LastQueryModeData>("LastQuery");
|
||||
|
||||
|
|
|
|||
|
|
@ -172,6 +172,28 @@
|
|||
OnContent="{DynamicResource enable}" />
|
||||
</cc:Card>
|
||||
|
||||
<cc:CardGroup Margin="0 14 0 0">
|
||||
<cc:Card
|
||||
Title="{DynamicResource searchDelay}"
|
||||
Icon=""
|
||||
Sub="{DynamicResource searchDelayToolTip}">
|
||||
<ui:ToggleSwitch
|
||||
IsOn="{Binding SearchQueryResultsWithDelay}"
|
||||
OffContent="{DynamicResource disable}"
|
||||
OnContent="{DynamicResource enable}" />
|
||||
</cc:Card>
|
||||
|
||||
<cc:Card
|
||||
Title="{DynamicResource searchDelayTime}"
|
||||
Icon=""
|
||||
Sub="{DynamicResource searchDelayTimeToolTip}">
|
||||
<ComboBox
|
||||
Width="100"
|
||||
ItemsSource="{Binding SearchInputDelayRange}"
|
||||
SelectedItem="{Binding Settings.SearchInputDelay}" />
|
||||
</cc:Card>
|
||||
</cc:CardGroup>
|
||||
|
||||
<cc:CardGroup Margin="0 14 0 0">
|
||||
<cc:Card Title="{DynamicResource querySearchPrecision}" Sub="{DynamicResource querySearchPrecisionToolTip}">
|
||||
<ComboBox
|
||||
|
|
|
|||
Loading…
Reference in a new issue