diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 7524d6c1a..67bb851e8 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -497,6 +497,21 @@ namespace Flow.Launcher.Infrastructure.UserSettings } } + private bool _autoTopmostLastOpenedResults = false; + public bool AutoTopmostLastOpenedResult + { + get => _autoTopmostLastOpenedResults; + set + { + if (_autoTopmostLastOpenedResults != value) + { + _autoTopmostLastOpenedResults = value; + OnPropertyChanged(); + } + } + } + + public bool SearchQueryResultsWithDelay { get; set; } public int SearchDelayTime { get; set; } = 150; diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 1b2b01ef8..6a1ac179d 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -179,6 +179,8 @@ This can only be edited if plugin supports Home feature and Home Page is enabled. Show Search Window at Foremost Overrides other programs' 'Always on Top' setting and displays Flow in the foremost position. + Auto Topmost Results + Automatically mark selected results as topmost in their queries for faster access in future searches. Restart after modifying plugin via Plugin Store Restart Flow Launcher automatically after installing/uninstalling/updating plugin via Plugin Store Show unknown source warning diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml index b4c94cb35..7049b5304 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml @@ -106,6 +106,20 @@ OnContent="{DynamicResource enable}" /> + + + + + + + + diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index 333ac3652..719570805 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -545,12 +545,14 @@ namespace Flow.Launcher.ViewModel // Record user selected result for result ranking _userSelectedRecord.Add(result); - // Add item to history only if it is from results but not context menu or history + // Add item to history and topmost only if it is from results but not context menu or history if (queryResultsSelected) { _history.Add(result); lastHistoryIndex = 1; - } + if (Settings.AutoTopmostLastOpenedResult) + _topMostRecord.AddOrUpdate(result); + } } private static IReadOnlyList DeepCloneResults(IReadOnlyList results, bool isDialogJump, CancellationToken token = default)