diff options
author | ericm <ericm> | 2000-07-29 01:08:54 (GMT) |
---|---|---|
committer | ericm <ericm> | 2000-07-29 01:08:54 (GMT) |
commit | 8635c0d7f9be9de36520f329efdcd09c3c61d47e (patch) | |
tree | d73e8112794686e6024f95a8c2c9767f28160867 /unix | |
parent | e16ace7494c18ca956b24fad670adf43fb0feba3 (diff) | |
download | tk-8635c0d7f9be9de36520f329efdcd09c3c61d47e.zip tk-8635c0d7f9be9de36520f329efdcd09c3c61d47e.tar.gz tk-8635c0d7f9be9de36520f329efdcd09c3c61d47e.tar.bz2 |
* unix/tkUnixButton.c (TkpDisplayButton): Added bits to change
the indicator color when radio-/check-buttons are disabled. This
reduces the visual incongruity when a group of these controls are
disabled together.
Diffstat (limited to 'unix')
-rw-r--r-- | unix/tkUnixButton.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c index bad8d8a..92dc8ea 100644 --- a/unix/tkUnixButton.c +++ b/unix/tkUnixButton.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixButton.c,v 1.6 2000/05/17 21:17:22 ericm Exp $ + * RCS: @(#) $Id: tkUnixButton.c,v 1.7 2000/07/29 01:08:54 ericm Exp $ */ #include "tkButton.h" @@ -323,10 +323,15 @@ TkpDisplayButton(clientData) dim -= 2*butPtr->borderWidth; if (butPtr->flags & SELECTED) { GC gc; - - gc = Tk_3DBorderGC(tkwin, (butPtr->selectBorder != NULL) - ? butPtr->selectBorder : butPtr->normalBorder, - TK_3D_FLAT_GC); + if (butPtr->state != STATE_DISABLED && + butPtr->selectBorder != NULL) { + gc = Tk_3DBorderGC(tkwin, butPtr->selectBorder, + TK_3D_FLAT_GC); + } else { + gc = Tk_3DBorderGC(tkwin, butPtr->normalBorder, + TK_3D_FLAT_GC); + } + XFillRectangle(butPtr->display, pixmap, gc, x, y, (unsigned int) dim, (unsigned int) dim); } else { @@ -350,9 +355,13 @@ TkpDisplayButton(clientData) if (butPtr->flags & SELECTED) { GC gc; - gc = Tk_3DBorderGC(tkwin, (butPtr->selectBorder != NULL) - ? butPtr->selectBorder : butPtr->normalBorder, - TK_3D_FLAT_GC); + if (butPtr->state != STATE_DISABLED && + butPtr->selectBorder != NULL) { + gc = Tk_3DBorderGC(tkwin, butPtr->selectBorder, TK_3D_FLAT_GC); + } else { + gc = Tk_3DBorderGC(tkwin, butPtr->normalBorder, TK_3D_FLAT_GC); + } + XFillPolygon(butPtr->display, pixmap, gc, points, 4, Convex, CoordModeOrigin); } else { |