Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,21 @@ public bool ShowAtTopmost
}
}

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;

Expand Down
2 changes: 2 additions & 0 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<system:String x:Key="restartToDisablePortableMode">Flow Launcher needs to restart to finish disabling portable mode, after the restart your portable data profile will be deleted and roaming data profile kept</system:String>
<system:String x:Key="restartToEnablePortableMode">Flow Launcher needs to restart to finish enabling portable mode, after the restart your roaming data profile will be deleted and portable data profile kept</system:String>
<system:String x:Key="moveToDifferentLocation">Flow Launcher has detected you enabled portable mode, would you like to move it to a different location?</system:String>
<system:String x:Key="shortcutsUninstallerCreated">Flow Launcher has detected you disabled portable mode, the relevant shortcuts and uninstaller entry have been created</system:String>

Check warning on line 25 in Flow.Launcher/Languages/en.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`uninstaller` is not a recognized word. (unrecognized-spelling)
<system:String x:Key="userDataDuplicated">Flow Launcher detected your user data exists both in {0} and {1}. {2}{2}Please delete {1} in order to proceed. No changes have occurred.</system:String>

<!-- Plugin Loader -->
Expand Down Expand Up @@ -177,6 +177,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>
Expand Down
14 changes: 14 additions & 0 deletions Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:converters="clr-namespace:Flow.Launcher.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ext="clr-namespace:Flow.Launcher.Resources.MarkupExtensions"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"

Check warning on line 9 in Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

View workflow job for this annotation

GitHub Actions / Check Spelling

`ikw` is not a recognized word. (unrecognized-spelling)
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:settingsViewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Expand Down Expand Up @@ -96,6 +96,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;" />
Expand Down
7 changes: 5 additions & 2 deletions Flow.Launcher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Storage;
using iNKORE.UI.WPF.Modern;

Check warning on line 27 in Flow.Launcher/ViewModel/MainViewModel.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`NKORE` is not a recognized word. (unrecognized-spelling)
using Microsoft.VisualStudio.Threading;

namespace Flow.Launcher.ViewModel
Expand Down Expand Up @@ -271,7 +271,7 @@
throw t.Exception;
#else
App.API.LogError(ClassName, $"Error happen in task dealing with viewupdate for results. {t.Exception}");
_resultsViewUpdateTask =

Check warning on line 274 in Flow.Launcher/ViewModel/MainViewModel.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`viewupdate` is not a recognized word. (unrecognized-spelling)
Task.Run(UpdateActionAsync).ContinueWith(continueAction, CancellationToken.None, TaskContinuationOptions.OnlyOnFaulted, TaskScheduler.Default);
#endif
}
Expand Down Expand Up @@ -468,7 +468,7 @@
{
//var defaultSuggestion = SelectedResults.SelectedItem.QuerySuggestionText;
//// check if result.actionkeywordassigned is empty
//if (!string.IsNullOrEmpty(result.ActionKeywordAssigned))

Check warning on line 471 in Flow.Launcher/ViewModel/MainViewModel.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`actionkeywordassigned` is not a recognized word. (unrecognized-spelling)
//{
// autoCompleteText = $"{result.ActionKeywordAssigned} {defaultSuggestion}";
//}
Expand Down Expand Up @@ -533,12 +533,14 @@

// 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)
Expand Down Expand Up @@ -2122,6 +2124,7 @@
{
Win32Helper.SwitchToEnglishKeyboardLayout(true);
}

}

public async void Hide(bool reset = true)
Expand Down
Loading