Skip to content

Commit c4402c6

Browse files
authored
Merge pull request #3541 from Flow-Launcher/topmost
Support Showing Search Window At Topmost
2 parents ba28621 + 2c40d2f commit c4402c6

File tree

4 files changed

+49
-8
lines changed

4 files changed

+49
-8
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,11 @@ public string Language
5959
get => _language;
6060
set
6161
{
62-
_language = value;
63-
OnPropertyChanged();
62+
if (_language != value)
63+
{
64+
_language = value;
65+
OnPropertyChanged();
66+
}
6467
}
6568
}
6669
private string _theme = Constant.DefaultTheme;
@@ -69,7 +72,7 @@ public string Theme
6972
get => _theme;
7073
set
7174
{
72-
if (value != _theme)
75+
if (_theme != value)
7376
{
7477
_theme = value;
7578
OnPropertyChanged();
@@ -298,9 +301,12 @@ public SearchPrecisionScore QuerySearchPrecision
298301
get => _querySearchPrecision;
299302
set
300303
{
301-
_querySearchPrecision = value;
302-
if (_stringMatcher != null)
303-
_stringMatcher.UserSettingSearchPrecision = value;
304+
if (_querySearchPrecision != value)
305+
{
306+
_querySearchPrecision = value;
307+
if (_stringMatcher != null)
308+
_stringMatcher.UserSettingSearchPrecision = value;
309+
}
304310
}
305311
}
306312

@@ -367,13 +373,30 @@ public bool HideNotifyIcon
367373
get => _hideNotifyIcon;
368374
set
369375
{
370-
_hideNotifyIcon = value;
371-
OnPropertyChanged();
376+
if (_hideNotifyIcon != value)
377+
{
378+
_hideNotifyIcon = value;
379+
OnPropertyChanged();
380+
}
372381
}
373382
}
374383
public bool LeaveCmdOpen { get; set; }
375384
public bool HideWhenDeactivated { get; set; } = true;
376385

386+
private bool _showAtTopmost = true;
387+
public bool ShowAtTopmost
388+
{
389+
get => _showAtTopmost;
390+
set
391+
{
392+
if (_showAtTopmost != value)
393+
{
394+
_showAtTopmost = value;
395+
OnPropertyChanged();
396+
}
397+
}
398+
}
399+
377400
public bool SearchQueryResultsWithDelay { get; set; }
378401
public int SearchDelayTime { get; set; } = 150;
379402

Flow.Launcher/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@
131131
<system:String x:Key="historyResultsForHomePage">Show History Results in Home Page</system:String>
132132
<system:String x:Key="historyResultsCountForHomePage">Maximum History Results Shown in Home Page</system:String>
133133
<system:String x:Key="homeToggleBoxToolTip">This can only be edited if plugin supports Home feature and Home Page is enabled.</system:String>
134+
<system:String x:Key="showAtTopmost">Show Search Window at Topmost</system:String>
135+
<system:String x:Key="showAtTopmostToolTip">Show search window above other windows</system:String>
134136

135137
<!-- Setting Plugin -->
136138
<system:String x:Key="searchplugin">Search Plugin</system:String>

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ public MainWindow()
8484
_viewModel = Ioc.Default.GetRequiredService<MainViewModel>();
8585
DataContext = _viewModel;
8686

87+
Topmost = _settings.ShowAtTopmost;
88+
8789
InitializeComponent();
8890
UpdatePosition();
8991

@@ -311,6 +313,9 @@ private void OnLoaded(object sender, RoutedEventArgs _)
311313
_viewModel.QueryResults();
312314
}
313315
break;
316+
case nameof(Settings.ShowAtTopmost):
317+
Topmost = _settings.ShowAtTopmost;
318+
break;
314319
}
315320
};
316321

Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,17 @@
7777
OnContent="{DynamicResource enable}" />
7878
</cc:Card>
7979

80+
<cc:Card
81+
Title="{DynamicResource showAtTopmost}"
82+
Margin="0 14 0 0"
83+
Icon="&#xE923;"
84+
Sub="{DynamicResource showAtTopmostToolTip}">
85+
<ui:ToggleSwitch
86+
IsOn="{Binding Settings.ShowAtTopmost}"
87+
OffContent="{DynamicResource disable}"
88+
OnContent="{DynamicResource enable}" />
89+
</cc:Card>
90+
8091
<cc:CardGroup Margin="0 14 0 0">
8192
<cc:Card Title="{DynamicResource SearchWindowPosition}" Icon="&#xe7f4;">
8293
<StackPanel Orientation="Horizontal">

0 commit comments

Comments
 (0)