mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Refresh interface when Home Page is changed
This commit is contained in:
parent
f2f4ebf0ac
commit
96bb62af27
4 changed files with 34 additions and 7 deletions
|
|
@ -159,7 +159,20 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
}
|
||||
}
|
||||
|
||||
public bool ShowHomePage { get; set; } = true;
|
||||
private bool _showHomePage { get; set; } = true;
|
||||
public bool ShowHomePage
|
||||
{
|
||||
get => _showHomePage;
|
||||
set
|
||||
{
|
||||
if (_showHomePage != value)
|
||||
{
|
||||
_showHomePage = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool ShowHistoryResultsForHomePage { get; set; } = false;
|
||||
public int MaxHistoryResultsToShowForHomePage { get; set; } = 5;
|
||||
|
||||
|
|
|
|||
|
|
@ -277,6 +277,17 @@ namespace Flow.Launcher
|
|||
case nameof(Settings.SettingWindowFont):
|
||||
InitializeContextMenu();
|
||||
break;
|
||||
case nameof(Settings.ShowHomePage):
|
||||
// We should refresh results when these two settings are changed but we cannot do that
|
||||
// Because the order of the results will change, making the interface look weird
|
||||
// So we would better refresh results when query text is changed next time
|
||||
/*case nameof(Settings.ShowHistoryResultsForHomePage):
|
||||
case nameof(Settings.MaxHistoryResultsToShowForHomePage):*/
|
||||
if (string.IsNullOrEmpty(_viewModel.QueryText))
|
||||
{
|
||||
_viewModel.QueryResults();
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -294,7 +305,10 @@ namespace Flow.Launcher
|
|||
.AddValueChanged(History, (s, e) => UpdateClockPanelVisibility());
|
||||
|
||||
// Initialize query state
|
||||
_viewModel.InitializeQuery();
|
||||
if (_settings.ShowHomePage && string.IsNullOrEmpty(_viewModel.QueryText))
|
||||
{
|
||||
_viewModel.QueryResults();
|
||||
}
|
||||
}
|
||||
|
||||
private async void OnClosing(object sender, CancelEventArgs e)
|
||||
|
|
|
|||
|
|
@ -1080,12 +1080,9 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
#region Query
|
||||
|
||||
public void InitializeQuery()
|
||||
public void QueryResults()
|
||||
{
|
||||
if (Settings.ShowHomePage)
|
||||
{
|
||||
_ = QueryResultsAsync(false);
|
||||
}
|
||||
_ = QueryResultsAsync(false);
|
||||
}
|
||||
|
||||
public void Query(bool searchDelay, bool isReQuery = false)
|
||||
|
|
|
|||
|
|
@ -82,6 +82,9 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
PluginPair.Metadata.HomeDisabled = !value;
|
||||
PluginSettingsObject.HomeDiabled = !value;
|
||||
// We should refresh results when these two settings are changed but we cannot do that
|
||||
// Because the order of the results will change, making the interface look weird
|
||||
// So we would better refresh results when query text is changed next time
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue