Skip to content
This repository was archived by the owner on Sep 25, 2024. It is now read-only.

Commit fe7ec6b

Browse files
author
Eric Maupin
committed
[mac] Fix sel/dark reordering
Hack fix, we should really see if there's a <Mojave way of tinting images reasonably.
1 parent 5429354 commit fe7ec6b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Xamarin.PropertyEditing.Mac/HostResourceProvider.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,17 @@ public virtual NSColor GetNamedColor (string name)
3131

3232
public virtual NSImage GetNamedImage (string name)
3333
{
34-
if ((CurrentAppearance ?? NSAppearance.CurrentAppearance).Name.ToLower ().Contains ("dark"))
34+
if ((CurrentAppearance ?? NSAppearance.CurrentAppearance).Name.ToLower ().Contains ("dark")) {
35+
bool sel = name.EndsWith ("~sel");
36+
if (sel)
37+
name = name.Substring (0, name.Length - 4);
38+
3539
name += "~dark";
3640

41+
if (sel)
42+
name += "~sel";
43+
}
44+
3745
return NSImage.ImageNamed (name);
3846
}
3947

0 commit comments

Comments
 (0)