Skip to content

Commit 9510a07

Browse files
committed
Add Mica Background option
1 parent 7e622b7 commit 9510a07

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ public void SetBlurForWindow()
259259
windowBorderStyle.Setters.Remove(windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property.Name == "Background"));
260260
windowBorderStyle.Setters.Add(new Setter(Border.BackgroundProperty, new SolidColorBrush(Colors.Transparent)));
261261
// SetWindowCornerPreference("Round");
262+
ThemeModeColor(BlurMode());
262263
}
263264
else
264265
{
@@ -269,7 +270,6 @@ public void SetBlurForWindow()
269270
// }
270271
Methods.SetWindowAttribute(new WindowInteropHelper(mainWindow).Handle, DWMWINDOWATTRIBUTE.DWMWA_SYSTEMBACKDROP_TYPE, 1);
271272
}
272-
ThemeModeColor(BlurMode());
273273
UpdateResourceDictionary(dict);
274274
}
275275

@@ -344,12 +344,22 @@ public void ThemeModeColor(string Mode)
344344
darkBG = lightBG; // if not darkBG, use lightBG
345345
}
346346

347+
// ✅ 백드롭 타입 확인 (Mica 또는 MicaAlt인 경우 배경을 투명으로 설정)
348+
bool isMica = _settings.BackdropType == BackdropTypes.Mica || _settings.BackdropType == BackdropTypes.MicaAlt;
349+
350+
if (isMica)
351+
{
352+
// ✅ 드래그 가능한 반투명 배경 적용
353+
mainWindow.Background = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0));
354+
return;
355+
}
347356

348357
if (Mode == "Auto")
349358
{
350359
int themeValue = (int)Registry.GetValue(@"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize", "AppsUseLightTheme", 1);
351360
string colorScheme = _settings.ColorScheme;
352361
bool isDarkMode = themeValue == 0; // 0 is dark mode.
362+
353363
if (colorScheme == "System")
354364
{
355365
if (isDarkMode)
@@ -399,6 +409,7 @@ public void ThemeModeColor(string Mode)
399409
}
400410
}
401411

412+
402413
public bool IsBlurTheme()
403414
{
404415
if (Environment.OSVersion.Version >= new Version(6, 2))

0 commit comments

Comments
 (0)