diff options
author | wolfsuit <wolfsuit> | 2004-11-10 17:29:44 (GMT) |
---|---|---|
committer | wolfsuit <wolfsuit> | 2004-11-10 17:29:44 (GMT) |
commit | f4d485d83668861b7724e5349c8b5c3d4f70e28c (patch) | |
tree | 71b04ce2160d21c55831a8924c860a476e630ee9 | |
parent | 4dfa2a7e6376de3e5ff062c9a0cde73050d7a9a1 (diff) | |
download | tk-f4d485d83668861b7724e5349c8b5c3d4f70e28c.zip tk-f4d485d83668861b7724e5349c8b5c3d4f70e28c.tar.gz tk-f4d485d83668861b7724e5349c8b5c3d4f70e28c.tar.bz2 |
Fix for 1055023 from mikek@muonics.com.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | macosx/tkMacOSXButton.c | 26 |
2 files changed, 23 insertions, 11 deletions
@@ -1,3 +1,11 @@ +2004-11-10 Jim Ingham <jingham@apple.com> + + From Michael Kirkham (mikek@muonics.com): + + * macosx/tkMacOSXButton.c (TkpDisplayButton): Don't set + the text if compound is NONE and we have and image. + [Bug 1055023] + 2004-10-29 Mo DeJong <mdejong@users.sourceforge.net> * tests/wm.test: Add Win32 test cases for attributes 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, |