mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Adjust window border style for blur themes and update border brush resource
This commit is contained in:
parent
8baf1d437e
commit
c6ed0bdc2a
2 changed files with 10 additions and 3 deletions
|
|
@ -671,7 +671,15 @@ namespace Flow.Launcher.Core.Resource
|
||||||
windowBorderStyle.Setters.Remove(windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property.Name == "Background"));
|
windowBorderStyle.Setters.Remove(windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property.Name == "Background"));
|
||||||
windowBorderStyle.Setters.Add(new Setter(Border.BackgroundProperty, new SolidColorBrush(Colors.Transparent)));
|
windowBorderStyle.Setters.Add(new Setter(Border.BackgroundProperty, new SolidColorBrush(Colors.Transparent)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For themes with blur enabled, the window border is rendered by the system, so it's treated as a simple rectangle regardless of thickness.
|
||||||
|
//(This is to avoid issues when the window is forcibly changed to a rectangular shape during snap scenarios.)
|
||||||
|
var cornerRadiusSetter = windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property == Border.CornerRadiusProperty);
|
||||||
|
if (cornerRadiusSetter != null)
|
||||||
|
cornerRadiusSetter.Value = new CornerRadius(0);
|
||||||
|
else
|
||||||
|
windowBorderStyle.Setters.Add(new Setter(Border.CornerRadiusProperty, new CornerRadius(0)));
|
||||||
|
|
||||||
// Apply the blur effect
|
// Apply the blur effect
|
||||||
Win32Helper.DWMSetBackdropForWindow(mainWindow, backdropType);
|
Win32Helper.DWMSetBackdropForWindow(mainWindow, backdropType);
|
||||||
ColorizeWindow(theme, backdropType);
|
ColorizeWindow(theme, backdropType);
|
||||||
|
|
|
||||||
|
|
@ -73,9 +73,8 @@
|
||||||
BasedOn="{StaticResource BaseWindowBorderStyle}"
|
BasedOn="{StaticResource BaseWindowBorderStyle}"
|
||||||
TargetType="{x:Type Border}">
|
TargetType="{x:Type Border}">
|
||||||
<Setter Property="BorderThickness" Value="1" />
|
<Setter Property="BorderThickness" Value="1" />
|
||||||
<Setter Property="BorderBrush" Value="{m:DynamicColor SystemControlBackgroundChromeMediumBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource SystemThemeBorder}" />
|
||||||
<Setter Property="Background" Value="{DynamicResource Color01B}" />
|
<Setter Property="Background" Value="{DynamicResource Color01B}" />
|
||||||
<Setter Property="CornerRadius" Value="8" />
|
|
||||||
<Setter Property="UseLayoutRounding" Value="True" />
|
<Setter Property="UseLayoutRounding" Value="True" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style
|
<Style
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue