mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Renamed the method GetFreezeSolidColorBrush to GetFrozenSolidColorBrush in ThemeHelper.cs for improved naming consistency. Updated all references in Theme.cs accordingly. No changes to functionality.
30 lines
836 B
C#
30 lines
836 B
C#
using System.Linq;
|
|
using System.Windows;
|
|
using System.Windows.Media;
|
|
|
|
namespace Flow.Launcher.Core.Resource;
|
|
|
|
public static class ThemeHelper
|
|
{
|
|
public static void CopyStyle(Style originalStyle, Style targetStyle)
|
|
{
|
|
// If the style is based on another style, copy the base style first
|
|
if (originalStyle.BasedOn != null)
|
|
{
|
|
CopyStyle(originalStyle.BasedOn, targetStyle);
|
|
}
|
|
|
|
// Copy the setters from the original style
|
|
foreach (var setter in originalStyle.Setters.OfType<Setter>())
|
|
{
|
|
targetStyle.Setters.Add(new Setter(setter.Property, setter.Value));
|
|
}
|
|
}
|
|
|
|
public static SolidColorBrush GetFrozenSolidColorBrush(Color color)
|
|
{
|
|
var brush = new SolidColorBrush(color);
|
|
brush.Freeze();
|
|
return brush;
|
|
}
|
|
}
|