Skip to content

Commit c6ed0bd

Browse files
committed
Adjust window border style for blur themes and update border brush resource
1 parent 8baf1d4 commit c6ed0bd

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,15 @@ private void SetBlurForWindow(string theme, BackdropTypes backdropType)
671671
windowBorderStyle.Setters.Remove(windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property.Name == "Background"));
672672
windowBorderStyle.Setters.Add(new Setter(Border.BackgroundProperty, new SolidColorBrush(Colors.Transparent)));
673673
}
674-
674+
675+
// For themes with blur enabled, the window border is rendered by the system, so it's treated as a simple rectangle regardless of thickness.
676+
//(This is to avoid issues when the window is forcibly changed to a rectangular shape during snap scenarios.)
677+
var cornerRadiusSetter = windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property == Border.CornerRadiusProperty);
678+
if (cornerRadiusSetter != null)
679+
cornerRadiusSetter.Value = new CornerRadius(0);
680+
else
681+
windowBorderStyle.Setters.Add(new Setter(Border.CornerRadiusProperty, new CornerRadius(0)));
682+
675683
// Apply the blur effect
676684
Win32Helper.DWMSetBackdropForWindow(mainWindow, backdropType);
677685
ColorizeWindow(theme, backdropType);

Flow.Launcher/Themes/Win11Light.xaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,8 @@
7373
BasedOn="{StaticResource BaseWindowBorderStyle}"
7474
TargetType="{x:Type Border}">
7575
<Setter Property="BorderThickness" Value="1" />
76-
<Setter Property="BorderBrush" Value="{m:DynamicColor SystemControlBackgroundChromeMediumBrush}" />
76+
<Setter Property="BorderBrush" Value="{DynamicResource SystemThemeBorder}" />
7777
<Setter Property="Background" Value="{DynamicResource Color01B}" />
78-
<Setter Property="CornerRadius" Value="8" />
7978
<Setter Property="UseLayoutRounding" Value="True" />
8079
</Style>
8180
<Style

0 commit comments

Comments
 (0)