diff options
author | Kevin Walzer <kw@codebykevin.com> | 2012-01-29 16:36:28 (GMT) |
---|---|---|
committer | Kevin Walzer <kw@codebykevin.com> | 2012-01-29 16:36:28 (GMT) |
commit | a88132bace0dc4479f570f046c2be6c5e1c2d51d (patch) | |
tree | 0928dd1c5453cdab0439e19104a4b93f54e59d57 /macosx/tkMacOSXButton.c | |
parent | 04de281557e8c7d14e3de9477c208f495a331132 (diff) | |
download | tk-a88132bace0dc4479f570f046c2be6c5e1c2d51d.zip tk-a88132bace0dc4479f570f046c2be6c5e1c2d51d.tar.gz tk-a88132bace0dc4479f570f046c2be6c5e1c2d51d.tar.bz2 |
Fix for serious bugs with input methods, and for display of certain fonts in buttons; thanks to Adrian Robert for extensive patches
Diffstat (limited to 'macosx/tkMacOSXButton.c')
-rw-r--r-- | macosx/tkMacOSXButton.c | 9 |
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]; |