This commit is contained in:
Diego Henrique 2026-03-10 14:06:39 +08:00 committed by GitHub
commit 11cf63363d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 2 deletions

View file

@ -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;

View file

@ -179,6 +179,8 @@
<system:String x:Key="homeToggleBoxToolTip">This can only be edited if plugin supports Home feature and Home Page is enabled.</system:String>
<system:String x:Key="showAtTopmost">Show Search Window at Foremost</system:String>
<system:String x:Key="showAtTopmostToolTip">Overrides other programs' 'Always on Top' setting and displays Flow in the foremost position.</system:String>
<system:String x:Key="autoTopmostLastOpenedResult">Auto Topmost Results</system:String>
<system:String x:Key="autoTopmostLastOpenedResultToolTip">Automatically mark selected results as topmost in their queries for faster access in future searches.</system:String>
<system:String x:Key="autoRestartAfterChanging">Restart after modifying plugin via Plugin Store</system:String>
<system:String x:Key="autoRestartAfterChangingToolTip">Restart Flow Launcher automatically after installing/uninstalling/updating plugin via Plugin Store</system:String>
<system:String x:Key="showUnknownSourceWarning">Show unknown source warning</system:String>

View file

@ -106,6 +106,20 @@
OnContent="{DynamicResource enable}" />
</ui:SettingsCard>
<ui:SettingsCard
Margin="0 4 0 0"
Description="{DynamicResource autoTopmostLastOpenedResultToolTip}"
Header="{DynamicResource autoTopmostLastOpenedResult}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xf5ed;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch
IsOn="{Binding Settings.AutoTopmostLastOpenedResult}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</ui:SettingsCard>
<ui:SettingsCard Margin="0 4 0 0" Header="{DynamicResource SearchWindowPosition}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xe7f4;" />

View file

@ -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<Result> DeepCloneResults(IReadOnlyList<Result> results, bool isDialogJump, CancellationToken token = default)