diff options
author | wolfsuit <wolfsuit> | 2004-11-10 17:29:44 (GMT) |
---|---|---|
committer | wolfsuit <wolfsuit> | 2004-11-10 17:29:44 (GMT) |
commit | dd3ae1c93777f68752484a357b4b4d72355b270b (patch) | |
tree | 71b04ce2160d21c55831a8924c860a476e630ee9 /macosx | |
parent | 61f52dff82288d00ed9154cec7e4078d071a2706 (diff) | |
download | tk-dd3ae1c93777f68752484a357b4b4d72355b270b.zip tk-dd3ae1c93777f68752484a357b4b4d72355b270b.tar.gz tk-dd3ae1c93777f68752484a357b4b4d72355b270b.tar.bz2 |
Fix for 1055023 from mikek@muonics.com.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXButton.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 9cd2994..b3935a1 100644 --- a/macosx/tkMacOSXButton.c +++ b/macosx/tkMacOSXButton.c @@ -10,7 +10,7 @@ * 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.2.2.5 2004/02/16 00:42:34 wolfsuit Exp $ + * RCS: @(#) $Id: tkMacOSXButton.c,v 1.2.2.6 2004/11/10 17:29:45 wolfsuit Exp $ */ #include "tkButton.h" @@ -309,7 +309,7 @@ TkpDisplayButton( fullWidth = 0; fullHeight = 0; - switch ((enum compound) butPtr->compound) { + switch ((enum compound) butPtr->compound) case COMPOUND_TOP: case COMPOUND_BOTTOM: { /* Image is above or below text */ @@ -324,9 +324,8 @@ TkpDisplayButton( textXOffset = (fullWidth - butPtr->textWidth)/2; imageXOffset = (fullWidth - width)/2; break; - } case COMPOUND_LEFT: - case COMPOUND_RIGHT: { + case COMPOUND_RIGHT: /* * Image is left or right of text */ @@ -342,8 +341,7 @@ TkpDisplayButton( textYOffset = (fullHeight - butPtr->textHeight)/2; imageYOffset = (fullHeight - height)/2; break; - } - case COMPOUND_CENTER: { + case COMPOUND_CENTER: /* * Image and text are superimposed */ @@ -357,8 +355,8 @@ TkpDisplayButton( textYOffset = (fullHeight - butPtr->textHeight)/2; imageYOffset = (fullHeight - height)/2; break; - } - case COMPOUND_NONE: {break;} + case COMPOUND_NONE: + break; } TkComputeAnchor(butPtr->anchor, tkwin, butPtr->padX, butPtr->padY, @@ -967,9 +965,15 @@ TkMacOSXDrawControl( Tk_Font font; int len; - len = TkFontGetFirstTextLayout(butPtr->textLayout, - &font, controlTitle); - controlTitle[len] = 0; + if (((mbPtr->info.image == NULL) && (mbPtr->info.bitmap == None)) + || (mbPtr->info.compound != COMPOUND_NONE)) { + len = TkFontGetFirstTextLayout(butPtr->textLayout, + &font, controlTitle); + controlTitle[len] = 0; + } else { + len = 0; + controlTitle[0] = 0; + } if (bcmp(mbPtr->controlTitle, controlTitle, len+1)) { CFStringRef cf; cf = CFStringCreateWithCString(NULL, |