diff options
author | Alex Corrado <alexc@xamarin.com> | 2013-10-24 00:20:46 +0400 |
---|---|---|
committer | Alex Corrado <alexc@xamarin.com> | 2013-10-24 00:20:46 +0400 |
commit | bdb1e9aab9e08cdef6d13673948debcf4716e590 (patch) | |
tree | 89204d880301abbc779fd81a5ade069a5b08dcc5 /Xwt.Mac | |
parent | 8252ecc5a34cb4868c30831564668d976b99fa2c (diff) |
[Mac] Don't display text over disclosure buttons
Cocoa will display the text even when the bezel style makes it look weird.
Behave the same way as the Gtk backend and don't display the label when
the button type is disclosure.
Diffstat (limited to 'Xwt.Mac')
-rw-r--r-- | Xwt.Mac/Xwt.Mac/ButtonBackend.cs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Xwt.Mac/Xwt.Mac/ButtonBackend.cs b/Xwt.Mac/Xwt.Mac/ButtonBackend.cs index 2c4f39be..0fc6bbea 100644 --- a/Xwt.Mac/Xwt.Mac/ButtonBackend.cs +++ b/Xwt.Mac/Xwt.Mac/ButtonBackend.cs @@ -58,10 +58,13 @@ namespace Xwt.Mac public void SetContent (string label, bool useMnemonic, ImageDescription image, ContentPosition imagePosition) { + switch (((Button)Frontend).Type) { + case ButtonType.Help: + case ButtonType.Disclosure: + return; + } if (useMnemonic) label = label.RemoveMnemonic (); - if (((Button)Frontend).Type == ButtonType.Help) - return; Widget.Title = label ?? ""; if (string.IsNullOrEmpty (label)) imagePosition = ContentPosition.Center; @@ -103,6 +106,7 @@ namespace Xwt.Mac switch (type) { case ButtonType.Disclosure: Widget.BezelStyle = NSBezelStyle.Disclosure; + Widget.Title = ""; break; case ButtonType.Help: Widget.BezelStyle = NSBezelStyle.HelpButton; |