mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge 9abf136ea2 into dda900041a
This commit is contained in:
commit
277fdf9977
1 changed files with 17 additions and 7 deletions
|
|
@ -673,13 +673,17 @@ namespace Flow.Launcher.Core.Resource
|
||||||
// If the BackdropType is Mica or MicaAlt, set the windowborderstyle's background to transparent
|
// If the BackdropType is Mica or MicaAlt, set the windowborderstyle's background to transparent
|
||||||
if (backdropType == BackdropTypes.Mica || backdropType == BackdropTypes.MicaAlt)
|
if (backdropType == BackdropTypes.Mica || backdropType == BackdropTypes.MicaAlt)
|
||||||
{
|
{
|
||||||
windowBorderStyle.Setters.Remove(windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property.Name == "Background"));
|
windowBorderStyle.Setters.Remove(windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property == Control.BackgroundProperty));
|
||||||
windowBorderStyle.Setters.Add(new Setter(Border.BackgroundProperty, new SolidColorBrush(Color.FromArgb(1, 0, 0, 0))));
|
var brush = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0));
|
||||||
|
brush.Freeze();
|
||||||
|
windowBorderStyle.Setters.Add(new Setter(Border.BackgroundProperty, brush));
|
||||||
}
|
}
|
||||||
else if (backdropType == BackdropTypes.Acrylic)
|
else if (backdropType == BackdropTypes.Acrylic)
|
||||||
{
|
{
|
||||||
windowBorderStyle.Setters.Remove(windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property.Name == "Background"));
|
windowBorderStyle.Setters.Remove(windowBorderStyle.Setters.OfType<Setter>().FirstOrDefault(x => x.Property == Control.BackgroundProperty));
|
||||||
windowBorderStyle.Setters.Add(new Setter(Border.BackgroundProperty, new SolidColorBrush(Colors.Transparent)));
|
var brush = new SolidColorBrush(Colors.Transparent);
|
||||||
|
brush.Freeze();
|
||||||
|
windowBorderStyle.Setters.Add(new Setter(Border.BackgroundProperty, brush));
|
||||||
}
|
}
|
||||||
|
|
||||||
// For themes with blur enabled, the window border is rendered by the system, so it's treated as a simple rectangle regardless of thickness.
|
// For themes with blur enabled, the window border is rendered by the system, so it's treated as a simple rectangle regardless of thickness.
|
||||||
|
|
@ -803,7 +807,9 @@ namespace Flow.Launcher.Core.Resource
|
||||||
|
|
||||||
// Apply background color (remove transparency in color)
|
// Apply background color (remove transparency in color)
|
||||||
Color backgroundColor = Color.FromRgb(bgColor.Value.R, bgColor.Value.G, bgColor.Value.B);
|
Color backgroundColor = Color.FromRgb(bgColor.Value.R, bgColor.Value.G, bgColor.Value.B);
|
||||||
previewStyle.Setters.Add(new Setter(Border.BackgroundProperty, new SolidColorBrush(backgroundColor)));
|
var brush = new SolidColorBrush(backgroundColor);
|
||||||
|
brush.Freeze();
|
||||||
|
previewStyle.Setters.Add(new Setter(Border.BackgroundProperty, brush));
|
||||||
|
|
||||||
// The blur theme keeps the corner round fixed (applying DWM code to modify it causes rendering issues).
|
// The blur theme keeps the corner round fixed (applying DWM code to modify it causes rendering issues).
|
||||||
// The non-blur theme retains the previously set WindowBorderStyle.
|
// The non-blur theme retains the previously set WindowBorderStyle.
|
||||||
|
|
@ -917,11 +923,15 @@ namespace Flow.Launcher.Core.Resource
|
||||||
// Only set the background to transparent if the theme supports blur
|
// Only set the background to transparent if the theme supports blur
|
||||||
if (backdropType == BackdropTypes.Mica || backdropType == BackdropTypes.MicaAlt)
|
if (backdropType == BackdropTypes.Mica || backdropType == BackdropTypes.MicaAlt)
|
||||||
{
|
{
|
||||||
mainWindow.Background = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0));
|
var backgroundBrush = new SolidColorBrush(Color.FromArgb(1, 0, 0, 0));
|
||||||
|
backgroundBrush.Freeze();
|
||||||
|
mainWindow.Background = backgroundBrush;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mainWindow.Background = new SolidColorBrush(selectedBG);
|
var backgroundBrush = new SolidColorBrush(selectedBG);
|
||||||
|
backgroundBrush.Freeze();
|
||||||
|
mainWindow.Background = backgroundBrush;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue