Skip to content

Commit 52fbebf

Browse files
committed
prompt user restart required when blur theme is selected first time
1 parent 6a6d6b2 commit 52fbebf

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ public class Theme
3030

3131
public bool BlurEnabled { get; set; }
3232

33+
// due to blur only enabled when main window is loaded for the first time, this is used to track the blur status
34+
// when the window is first loaded and prompt user that a restart is required for blur to take effect.
35+
public bool BlurEnabledOnloaded { get; set; }
36+
3337
public Theme()
3438
{
3539
_themeDirectories.Add(DirectoryPath);

Flow.Launcher/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
<system:String x:Key="querySearchPrecision">Query Search Precision</system:String>
4040
<system:String x:Key="ShouldUsePinyin">Should Use Pinyin</system:String>
4141
<system:String x:Key="ShouldUsePinyinToolTip">Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for transliterating Chinese</system:String>
42+
<system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String>
43+
<system:String x:Key="blurEffectRequireRestart">Current theme has blur effect enabled for the first time, a restart is required in order to take effect</system:String>
4244

4345
<!--Setting Plugin-->
4446
<system:String x:Key="plugin">Plugin</system:String>

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ private void OnLoaded(object sender, RoutedEventArgs _)
6464
// currently blur can only be called when loading main window.
6565
// is there a way to set blur only once?
6666
ThemeManager.Instance.SetBlurForWindow();
67+
ThemeManager.Instance.BlurEnabledOnloaded = ThemeManager.Instance.BlurEnabled;
68+
6769
WindowsInteropHelper.DisableControlBox(this);
6870
InitProgressbarAnimation();
6971
InitializePosition();

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,11 @@ public string SelectedTheme
275275
if (ThemeManager.Instance.BlurEnabled && Settings.UseDropShadowEffect)
276276
DropShadowEffect = false;
277277

278+
if (!ThemeManager.Instance.BlurEnabledOnloaded && ThemeManager.Instance.BlurEnabled)
279+
{
280+
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("blurEffectRequireRestart"));
281+
ThemeManager.Instance.BlurEnabledOnloaded = true;
282+
}
278283
}
279284
}
280285

@@ -288,7 +293,7 @@ public bool DropShadowEffect
288293
{
289294
if (ThemeManager.Instance.BlurEnabled && value)
290295
{
291-
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem"));
296+
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("shadowEffectNotAllowed"));
292297
return;
293298
}
294299

0 commit comments

Comments
 (0)