mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use property changed to change
This commit is contained in:
parent
a41356c845
commit
dc3f663947
4 changed files with 15 additions and 14 deletions
|
|
@ -275,7 +275,16 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
public bool LeaveCmdOpen { get; set; }
|
||||
public bool HideWhenDeactivated { get; set; } = true;
|
||||
|
||||
public bool SearchQueryResultsWithDelay { get; set; } = false;
|
||||
bool _searchQueryResultsWithDelay { get; set; }
|
||||
public bool SearchQueryResultsWithDelay
|
||||
{
|
||||
get => _searchQueryResultsWithDelay;
|
||||
set
|
||||
{
|
||||
_searchQueryResultsWithDelay = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
public int SearchInputDelay { get; set; } = 120;
|
||||
|
||||
[JsonConverter(typeof(JsonStringEnumConverter))]
|
||||
|
|
|
|||
|
|
@ -297,6 +297,9 @@ namespace Flow.Launcher
|
|||
case nameof(Settings.WindowTop):
|
||||
Top = _settings.WindowTop;
|
||||
break;
|
||||
case nameof(Settings.SearchQueryResultsWithDelay):
|
||||
SetupSearchTextBoxReactiveness(_settings.SearchQueryResultsWithDelay);
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -865,7 +868,7 @@ namespace Flow.Launcher
|
|||
|
||||
private IDisposable _reactiveSubscription;
|
||||
|
||||
public void SetupSearchTextBoxReactiveness(bool showResultsWithDelay)
|
||||
private void SetupSearchTextBoxReactiveness(bool showResultsWithDelay)
|
||||
{
|
||||
if (_reactiveSubscription != null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -139,17 +139,6 @@ 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
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@
|
|||
Icon=""
|
||||
Sub="{DynamicResource searchDelayToolTip}">
|
||||
<ui:ToggleSwitch
|
||||
IsOn="{Binding SearchQueryResultsWithDelay}"
|
||||
IsOn="{Binding Settings.SearchQueryResultsWithDelay}"
|
||||
OffContent="{DynamicResource disable}"
|
||||
OnContent="{DynamicResource enable}" />
|
||||
</cc:Card>
|
||||
|
|
|
|||
Loading…
Reference in a new issue