mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Refactor AutoDropShadow logic for clarity and correctness
Simplified the AutoDropShadow method to avoid redundant operations and improve readability. Now, window corner preference and drop shadow effects are set based on blur and backdrop support, with clear comments explaining each case. Removed convoluted branching for more direct logic.
This commit is contained in:
parent
916b4ff091
commit
b5d372ed4b
1 changed files with 7 additions and 10 deletions
|
|
@ -706,30 +706,27 @@ namespace Flow.Launcher.Core.Resource
|
|||
|
||||
private void AutoDropShadow(bool useDropShadowEffect)
|
||||
{
|
||||
SetWindowCornerPreference("Default");
|
||||
RemoveDropShadowEffectFromCurrentTheme();
|
||||
if (useDropShadowEffect)
|
||||
{
|
||||
if (BlurEnabled && Win32Helper.IsBackdropSupported())
|
||||
{
|
||||
// For themes with blur enabled, the window border is rendered by the system,
|
||||
// so we set corner preference to round and remove drop shadow effect to avoid rendering issues.
|
||||
SetWindowCornerPreference("Round");
|
||||
RemoveDropShadowEffectFromCurrentTheme();
|
||||
}
|
||||
else
|
||||
{
|
||||
// For themes without blur, we set corner preference to default and add drop shadow effect.
|
||||
SetWindowCornerPreference("Default");
|
||||
AddDropShadowEffectToCurrentTheme();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (BlurEnabled && Win32Helper.IsBackdropSupported())
|
||||
{
|
||||
SetWindowCornerPreference("Default");
|
||||
}
|
||||
else
|
||||
{
|
||||
RemoveDropShadowEffectFromCurrentTheme();
|
||||
}
|
||||
// When drop shadow effect is disabled, we set corner preference to default and remove drop shadow effect.
|
||||
SetWindowCornerPreference("Default");
|
||||
RemoveDropShadowEffectFromCurrentTheme();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue