This repository was archived by the owner on Sep 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Xamarin.PropertyEditing.Mac.Standalone
Xamarin.PropertyEditing.Mac Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,9 @@ partial void OnThemeChanged (NSObject sender)
9393 appearance = NSAppearance . NameVibrantDark ;
9494 }
9595
96- View . Appearance = NSAppearance . GetAppearance ( appearance ) ;
96+ var realAppearance = NSAppearance . GetAppearance ( appearance ) ;
97+ ( ( HostResourceProvider ) PropertyPanel . HostResourceProvider ) . CurrentAppearance = realAppearance ;
98+ View . Appearance = realAppearance ;
9799 }
98100 }
99101}
Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ namespace Xamarin.PropertyEditing.Mac
77 public class HostResourceProvider
88 : IHostResourceProvider
99 {
10+ public NSAppearance CurrentAppearance
11+ {
12+ get ;
13+ set ;
14+ }
15+
1016 public virtual NSAppearance GetVibrantAppearance ( NSAppearance appearance )
1117 {
1218 if ( appearance == null )
@@ -25,6 +31,9 @@ public virtual NSColor GetNamedColor (string name)
2531
2632 public virtual NSImage GetNamedImage ( string name )
2733 {
34+ if ( ( CurrentAppearance ?? NSAppearance . CurrentAppearance ) . Name . ToLower ( ) . Contains ( "dark" ) )
35+ name += "~dark" ;
36+
2837 return NSImage . ImageNamed ( name ) ;
2938 }
3039
You can’t perform that action at this time.
0 commit comments