Skip to content

Support Showing Search Window at Topmost #3541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from
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
39 changes: 31 additions & 8 deletions Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,19 @@ public string Language
get => _language;
set
{
_language = value;
OnPropertyChanged();
if (_language != value)
{
_language = value;
OnPropertyChanged();
}
}
}
public string Theme
{
get => _theme;
set
{
if (value != _theme)
if (_theme != value)
{
_theme = value;
OnPropertyChanged();
Expand Down Expand Up @@ -283,9 +286,12 @@ public SearchPrecisionScore QuerySearchPrecision
get => _querySearchPrecision;
set
{
_querySearchPrecision = value;
if (_stringMatcher != null)
_stringMatcher.UserSettingSearchPrecision = value;
if (_querySearchPrecision != value)
{
_querySearchPrecision = value;
if (_stringMatcher != null)
_stringMatcher.UserSettingSearchPrecision = value;
}
}
}

Expand Down Expand Up @@ -348,13 +354,30 @@ public bool HideNotifyIcon
get => _hideNotifyIcon;
set
{
_hideNotifyIcon = value;
OnPropertyChanged();
if (_hideNotifyIcon != value)
{
_hideNotifyIcon = value;
OnPropertyChanged();
}
}
}
public bool LeaveCmdOpen { get; set; }
public bool HideWhenDeactivated { get; set; } = true;

private bool _showAtTopmost = true;
public bool ShowAtTopmost
{
get => _showAtTopmost;
set
{
if (_showAtTopmost != value)
{
_showAtTopmost = 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 @@ -131,6 +131,8 @@
<system:String x:Key="historyResultsForHomePage">Show History Results in Home Page</system:String>
<system:String x:Key="historyResultsCountForHomePage">Maximum History Results Shown in Home Page</system:String>
<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 Topmost</system:String>
<system:String x:Key="showAtTopmostToolTip">Show search window above other windows</system:String>

<!-- Setting Plugin -->
<system:String x:Key="searchplugin">Search Plugin</system:String>
Expand Down
5 changes: 5 additions & 0 deletions Flow.Launcher/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ public MainWindow()
_viewModel = Ioc.Default.GetRequiredService<MainViewModel>();
DataContext = _viewModel;

Topmost = _settings.ShowAtTopmost;

InitializeComponent();
UpdatePosition();

Expand Down Expand Up @@ -283,6 +285,9 @@ private async void OnLoaded(object sender, RoutedEventArgs _)
_viewModel.QueryResults();
}
break;
case nameof(Settings.ShowAtTopmost):
Topmost = _settings.ShowAtTopmost;
break;
}
};

Expand Down
11 changes: 11 additions & 0 deletions Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@
OnContent="{DynamicResource enable}" />
</cc:Card>

<cc:Card
Title="{DynamicResource showAtTopmost}"
Margin="0 14 0 0"
Icon="&#xE923;"
Sub="{DynamicResource showAtTopmostToolTip}">
<ui:ToggleSwitch
IsOn="{Binding Settings.ShowAtTopmost}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:Card>

<cc:CardGroup Margin="0 14 0 0">
<cc:Card Title="{DynamicResource SearchWindowPosition}" Icon="&#xe7f4;">
<StackPanel Orientation="Horizontal">
Expand Down
Loading