File tree Expand file tree Collapse file tree
Flow.Launcher.Core/Resource Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -798,7 +798,7 @@ private void ApplyPreviewBackground(Color? bgColor = null)
798798 Application . Current . Resources [ "WindowBorderStyle" ] is Style originalStyle )
799799 {
800800 // Copy the original style, including the base style if it exists
801- CopyStyle ( originalStyle , previewStyle ) ;
801+ ThemeHelper . CopyStyle ( originalStyle , previewStyle ) ;
802802 }
803803
804804 // Apply background color (remove transparency in color)
@@ -817,21 +817,6 @@ private void ApplyPreviewBackground(Color? bgColor = null)
817817 Application . Current . Resources [ "PreviewWindowBorderStyle" ] = previewStyle ;
818818 }
819819
820- private void CopyStyle ( Style originalStyle , Style targetStyle )
821- {
822- // If the style is based on another style, copy the base style first
823- if ( originalStyle . BasedOn != null )
824- {
825- CopyStyle ( originalStyle . BasedOn , targetStyle ) ;
826- }
827-
828- // Copy the setters from the original style
829- foreach ( var setter in originalStyle . Setters . OfType < Setter > ( ) )
830- {
831- targetStyle . Setters . Add ( new Setter ( setter . Property , setter . Value ) ) ;
832- }
833- }
834-
835820 private void ColorizeWindow ( string theme , BackdropTypes backdropType )
836821 {
837822 var dict = GetThemeResourceDictionary ( theme ) ;
Original file line number Diff line number Diff line change 1- using System . Windows . Media ;
1+ using System . Linq ;
2+ using System . Windows ;
3+ using System . Windows . Media ;
24
35namespace Flow . Launcher . Core . Resource ;
46
57public static class ThemeHelper
68{
9+ public static void CopyStyle ( Style originalStyle , Style targetStyle )
10+ {
11+ // If the style is based on another style, copy the base style first
12+ if ( originalStyle . BasedOn != null )
13+ {
14+ CopyStyle ( originalStyle . BasedOn , targetStyle ) ;
15+ }
16+
17+ // Copy the setters from the original style
18+ foreach ( var setter in originalStyle . Setters . OfType < Setter > ( ) )
19+ {
20+ targetStyle . Setters . Add ( new Setter ( setter . Property , setter . Value ) ) ;
21+ }
22+ }
23+
724 public static SolidColorBrush GetFreezeSolidColorBrush ( Color color )
825 {
926 var brush = new SolidColorBrush ( color ) ;
You can’t perform that action at this time.
0 commit comments