summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXButton.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-rw-r--r--macosx/tkMacOSXButton.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index 8eb3a1f..036624d 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -576,6 +576,15 @@ ComputeNativeButtonGeometry(
[button setImagePosition:pos];
}
+ // if font is too tall, we can't use the fixed-height rounded bezel
+ if (!haveImage && haveText && style == NSRoundedBezelStyle) {
+ Tk_FontMetrics fm;
+ Tk_GetFontMetrics(butPtr->tkfont, &fm);
+ if (fm.linespace > 18) {
+ [button setBezelStyle:(style = NSShadowlessSquareBezelStyle)];
+ }
+ }
+
bounds.size = [cell cellSize];
if (haveText) {
titleRect = [cell titleRectForBounds:bounds];