diff options
author | hobbs <hobbs> | 2006-05-26 21:43:05 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2006-05-26 21:43:05 (GMT) |
commit | dea7c74c5219a838251282f482450b3d8b1a8353 (patch) | |
tree | a0bae8a3860118b10f4fa3d32c4a681d7db55399 /macosx | |
parent | f8e68aa986b2bdf31e31da488c707ae4a6a4b58b (diff) | |
download | tk-dea7c74c5219a838251282f482450b3d8b1a8353.zip tk-dea7c74c5219a838251282f482450b3d8b1a8353.tar.gz tk-dea7c74c5219a838251282f482450b3d8b1a8353.tar.bz2 |
* macosx/tkMacOSXButton.c (TkMacOSXDrawControl): correct redraw
for direct transition from disabled to active state. [Bug 706446]
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/tkMacOSXButton.c | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/macosx/tkMacOSXButton.c b/macosx/tkMacOSXButton.c index 78fc303..0878819 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.13 2006/03/28 02:44:12 das Exp $ + * RCS: @(#) $Id: tkMacOSXButton.c,v 1.2.2.14 2006/05/26 21:43:05 hobbs Exp $ */ #include "tkMacOSXInt.h" @@ -1009,33 +1009,39 @@ TkMacOSXDrawControl( } else { SetControlValue(mbPtr->control, 0); } - + if (!Tk_MacOSXIsAppInFront() || butPtr->state == STATE_DISABLED) { - HiliteControl(mbPtr->control, kControlInactivePart); - } else if (butPtr->state == STATE_ACTIVE) { - if (mbPtr->params.isBevel) { - HiliteControl(mbPtr->control, kControlButtonPart); - } else { - switch (butPtr->type) { - case TYPE_BUTTON: - HiliteControl(mbPtr->control, kControlButtonPart); - break; - case TYPE_RADIO_BUTTON: - HiliteControl(mbPtr->control, kControlRadioButtonPart); - break; - case TYPE_CHECK_BUTTON: - HiliteControl(mbPtr->control, kControlCheckBoxPart); - break; - } - } + HiliteControl(mbPtr->control, kControlInactivePart); } else { - HiliteControl(mbPtr->control, kControlNoPart); + /* + * Use NoPart for normal and to ensure correct direct transition from + * disabled to active -state. [Bug 706446] + */ + HiliteControl(mbPtr->control, kControlNoPart); + + if (butPtr->state == STATE_ACTIVE) { + if (mbPtr->params.isBevel) { + HiliteControl(mbPtr->control, kControlButtonPart); + } else { + switch (butPtr->type) { + case TYPE_BUTTON: + HiliteControl(mbPtr->control, kControlButtonPart); + break; + case TYPE_RADIO_BUTTON: + HiliteControl(mbPtr->control, kControlRadioButtonPart); + break; + case TYPE_CHECK_BUTTON: + HiliteControl(mbPtr->control, kControlCheckBoxPart); + break; + } + } + } } UpdateControlColors(mbPtr); - - if ((butPtr->type == TYPE_BUTTON) ) { + + if (butPtr->type == TYPE_BUTTON) { Boolean isDefault; - + if (butPtr->defaultState == STATE_ACTIVE) { isDefault = true; } else { @@ -1043,7 +1049,7 @@ TkMacOSXDrawControl( } if ((err=SetControlData(mbPtr->control, kControlNoPart, kControlPushButtonDefaultTag, - sizeof(isDefault), (Ptr) &isDefault)) != noErr ) { + sizeof(isDefault), (Ptr) &isDefault)) != noErr) { } } @@ -1055,10 +1061,10 @@ TkMacOSXDrawControl( SetControlVisibility(mbPtr->control, true, true); Draw1Control(mbPtr->userPane); } - + if (mbPtr->params.isBevel) { KillPicture(mbPtr->bevelButtonContent.u.picture); - } + } } /* |