mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Improve code quality
This commit is contained in:
parent
f7954a0272
commit
9741156509
1 changed files with 23 additions and 22 deletions
|
|
@ -49,6 +49,8 @@ namespace Flow.Launcher.ViewModel
|
|||
private ChannelWriter<ResultsForUpdate> _resultsUpdateChannelWriter;
|
||||
private Task _resultsViewUpdateTask;
|
||||
|
||||
private readonly IReadOnlyList<Result> _emptyResult = new List<Result>();
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructor
|
||||
|
|
@ -830,16 +832,18 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
#region Preview
|
||||
|
||||
private static readonly int ResultAreaColumnPreviewShown = 1;
|
||||
private static readonly int ResultAreaColumnPreviewHidden = 3;
|
||||
|
||||
private bool? _selectedItemFromQueryResults;
|
||||
|
||||
private ResultViewModel _selectedItem;
|
||||
|
||||
private ResultViewModel _previewSelectedItem;
|
||||
public ResultViewModel PreviewSelectedItem
|
||||
{
|
||||
get => _selectedItem;
|
||||
get => _previewSelectedItem;
|
||||
set
|
||||
{
|
||||
_selectedItem = value;
|
||||
_previewSelectedItem = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
|
|
@ -862,10 +866,6 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
private static readonly int ResultAreaColumnPreviewShown = 1;
|
||||
|
||||
private static readonly int ResultAreaColumnPreviewHidden = 3;
|
||||
|
||||
public int ResultAreaColumn { get; set; } = ResultAreaColumnPreviewShown;
|
||||
|
||||
// This is not a reliable indicator of whether external preview is visible due to the
|
||||
|
|
@ -1016,7 +1016,7 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
#region Query
|
||||
|
||||
public void Query(bool isReQuery = false)
|
||||
private void Query(bool isReQuery = false)
|
||||
{
|
||||
if (QueryResultsSelected())
|
||||
{
|
||||
|
|
@ -1121,8 +1121,6 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
private readonly IReadOnlyList<Result> _emptyResult = new List<Result>();
|
||||
|
||||
private async Task QueryResultsAsync(bool isReQuery = false, bool reSelect = true)
|
||||
{
|
||||
_updateSource?.Cancel();
|
||||
|
|
@ -1420,6 +1418,18 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks if Flow Launcher should ignore any hotkeys
|
||||
/// </summary>
|
||||
public bool ShouldIgnoreHotkeys()
|
||||
{
|
||||
return Settings.IgnoreHotkeysOnFullscreen && Win32Helper.IsForegroundWindowFullscreen() || GameModeStatus;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Show()
|
||||
{
|
||||
Application.Current.Dispatcher.Invoke(() =>
|
||||
|
|
@ -1505,7 +1515,7 @@ namespace Flow.Launcher.ViewModel
|
|||
// 📌 Apply DWM Cloak (Completely hide the window)
|
||||
Win32Helper.DWMSetCloakForWindow(mainWindow, true);
|
||||
}
|
||||
|
||||
|
||||
await Task.Delay(50);
|
||||
|
||||
// Update WPF properties
|
||||
|
|
@ -1518,17 +1528,8 @@ namespace Flow.Launcher.ViewModel
|
|||
#pragma warning restore VSTHRD100 // Avoid async void methods
|
||||
|
||||
/// <summary>
|
||||
/// Checks if Flow Launcher should ignore any hotkeys
|
||||
/// Save history, user selected records and top most records
|
||||
/// </summary>
|
||||
public bool ShouldIgnoreHotkeys()
|
||||
{
|
||||
return Settings.IgnoreHotkeysOnFullscreen && Win32Helper.IsForegroundWindowFullscreen() || GameModeStatus;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Public Methods
|
||||
|
||||
public void Save()
|
||||
{
|
||||
_historyItemsStorage.Save();
|
||||
|
|
|
|||
Loading…
Reference in a new issue