Skip to content

Commit aa34a02

Browse files
committed
set blur when theme change is called
1 parent 52fbebf commit aa34a02

File tree

4 files changed

+4
-16
lines changed

4 files changed

+4
-16
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ 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-
3733
public Theme()
3834
{
3935
_themeDirectories.Add(DirectoryPath);
@@ -98,6 +94,8 @@ public bool ChangeTheme(string theme)
9894

9995
if (Settings.UseDropShadowEffect && !BlurEnabled)
10096
AddDropShadowEffectToCurrentTheme();
97+
98+
SetBlurForWindow();
10199
}
102100
catch (DirectoryNotFoundException e)
103101
{
@@ -356,6 +354,8 @@ private bool IsBlurTheme()
356354
private void SetWindowAccent(Window w, AccentState state)
357355
{
358356
var windowHelper = new WindowInteropHelper(w);
357+
w.Width = 750;
358+
windowHelper.EnsureHandle();
359359
var accent = new AccentPolicy { AccentState = state };
360360
var accentStructSize = Marshal.SizeOf(accent);
361361

Flow.Launcher/Languages/en.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
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>
4242
<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>
4443

4544
<!--Setting Plugin-->
4645
<system:String x:Key="plugin">Plugin</system:String>

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ private void OnLoaded(object sender, RoutedEventArgs _)
6161
// show notify icon when flowlauncher is hidden
6262
InitializeNotifyIcon();
6363

64-
// currently blur can only be called when loading main window.
65-
// is there a way to set blur only once?
66-
ThemeManager.Instance.SetBlurForWindow();
67-
ThemeManager.Instance.BlurEnabledOnloaded = ThemeManager.Instance.BlurEnabled;
68-
6964
WindowsInteropHelper.DisableControlBox(this);
7065
InitProgressbarAnimation();
7166
InitializePosition();

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,12 +274,6 @@ public string SelectedTheme
274274

275275
if (ThemeManager.Instance.BlurEnabled && Settings.UseDropShadowEffect)
276276
DropShadowEffect = false;
277-
278-
if (!ThemeManager.Instance.BlurEnabledOnloaded && ThemeManager.Instance.BlurEnabled)
279-
{
280-
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("blurEffectRequireRestart"));
281-
ThemeManager.Instance.BlurEnabledOnloaded = true;
282-
}
283277
}
284278
}
285279

0 commit comments

Comments
 (0)