diff options
author | Eric Maupin <ermaup@microsoft.com> | 2019-01-26 00:40:49 +0300 |
---|---|---|
committer | Eric Maupin <ermaup@microsoft.com> | 2019-01-26 00:40:49 +0300 |
commit | 488124c7dd20b85c7b65dcd8f70852c3d32aaeda (patch) | |
tree | e5c57196a73ca5a290532b20dab77d84934378aa /Xamarin.PropertyEditing.Mac | |
parent | 81e19296f6232b9b3793ce5c2b1399861fa2e325 (diff) |
[mac] Manual theme image handling
Diffstat (limited to 'Xamarin.PropertyEditing.Mac')
-rw-r--r-- | Xamarin.PropertyEditing.Mac/HostResourceProvider.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs b/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs index 591c46d..09a8390 100644 --- a/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs +++ b/Xamarin.PropertyEditing.Mac/HostResourceProvider.cs @@ -7,6 +7,12 @@ namespace Xamarin.PropertyEditing.Mac public class HostResourceProvider : IHostResourceProvider { + public NSAppearance CurrentAppearance + { + get; + set; + } + public virtual NSAppearance GetVibrantAppearance (NSAppearance appearance) { if (appearance == null) @@ -25,6 +31,9 @@ namespace Xamarin.PropertyEditing.Mac public virtual NSImage GetNamedImage (string name) { + if ((CurrentAppearance ?? NSAppearance.CurrentAppearance).Name.ToLower ().Contains ("dark")) + name += "~dark"; + return NSImage.ImageNamed (name); } |