diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index d055bee60..cfa3e7397 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -49,6 +49,8 @@ namespace Flow.Launcher.ViewModel private ChannelWriter _resultsUpdateChannelWriter; private Task _resultsViewUpdateTask; + private readonly IReadOnlyList _emptyResult = new List(); + #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 _emptyResult = new List(); - private async Task QueryResultsAsync(bool isReQuery = false, bool reSelect = true) { _updateSource?.Cancel(); @@ -1420,6 +1418,18 @@ namespace Flow.Launcher.ViewModel } } + /// + /// Checks if Flow Launcher should ignore any hotkeys + /// + 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 /// - /// Checks if Flow Launcher should ignore any hotkeys + /// Save history, user selected records and top most records /// - public bool ShouldIgnoreHotkeys() - { - return Settings.IgnoreHotkeysOnFullscreen && Win32Helper.IsForegroundWindowFullscreen() || GameModeStatus; - } - - #endregion - - #region Public Methods - public void Save() { _historyItemsStorage.Save();