summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXButton.c
diff options
context:
space:
mode:
authorpspjuth <peter.spjuth@gmail.com>2012-08-26 17:07:19 (GMT)
committerpspjuth <peter.spjuth@gmail.com>2012-08-26 17:07:19 (GMT)
commit2c2a2e6522dcfc11aaa8017b47bc14485313349b (patch)
treed0cf2a1e6e56525333957dd5fe2aab36bf174a4c /macosx/tkMacOSXButton.c
parentfc0e57edc8cb5ad99ea9540032237367f8b0a777 (diff)
parente4c7ef5bdf6375e1860418b1ec92c07f88660cc8 (diff)
downloadtk-pspjuth_canvas.zip
tk-pspjuth_canvas.tar.gz
tk-pspjuth_canvas.tar.bz2
merge trunkpspjuth_canvas
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-rw-r--r--macosx/tkMacOSXButton.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c
index a033990..036624d 100644
--- a/macosx/tkMacOSXButton.c
+++ b/macosx/tkMacOSXButton.c
@@ -10,8 +10,6 @@
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id: tkMacOSXButton.c,v 1.37 2010/02/18 22:31:31 nijtmans Exp $
*/
#include "tkMacOSXPrivate.h"
@@ -578,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];