prompt user restart required when blur theme is selected first time

This commit is contained in:
Jeremy 2021-06-27 22:13:58 +10:00
parent 6a6d6b22ee
commit 52fbebf2d6
4 changed files with 14 additions and 1 deletions

View file

@ -30,6 +30,10 @@ namespace Flow.Launcher.Core.Resource
public bool BlurEnabled { get; set; }
// due to blur only enabled when main window is loaded for the first time, this is used to track the blur status
// when the window is first loaded and prompt user that a restart is required for blur to take effect.
public bool BlurEnabledOnloaded { get; set; }
public Theme()
{
_themeDirectories.Add(DirectoryPath);

View file

@ -39,6 +39,8 @@
<system:String x:Key="querySearchPrecision">Query Search Precision</system:String>
<system:String x:Key="ShouldUsePinyin">Should Use Pinyin</system:String>
<system:String x:Key="ShouldUsePinyinToolTip">Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for transliterating Chinese</system:String>
<system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String>
<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>
<!--Setting Plugin-->
<system:String x:Key="plugin">Plugin</system:String>

View file

@ -64,6 +64,8 @@ namespace Flow.Launcher
// currently blur can only be called when loading main window.
// is there a way to set blur only once?
ThemeManager.Instance.SetBlurForWindow();
ThemeManager.Instance.BlurEnabledOnloaded = ThemeManager.Instance.BlurEnabled;
WindowsInteropHelper.DisableControlBox(this);
InitProgressbarAnimation();
InitializePosition();

View file

@ -275,6 +275,11 @@ namespace Flow.Launcher.ViewModel
if (ThemeManager.Instance.BlurEnabled && Settings.UseDropShadowEffect)
DropShadowEffect = false;
if (!ThemeManager.Instance.BlurEnabledOnloaded && ThemeManager.Instance.BlurEnabled)
{
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("blurEffectRequireRestart"));
ThemeManager.Instance.BlurEnabledOnloaded = true;
}
}
}
@ -288,7 +293,7 @@ namespace Flow.Launcher.ViewModel
{
if (ThemeManager.Instance.BlurEnabled && value)
{
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("pleaseSelectAnItem"));
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("shadowEffectNotAllowed"));
return;
}