summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorhobbs <hobbs>2003-02-25 01:39:56 (GMT)
committerhobbs <hobbs>2003-02-25 01:39:56 (GMT)
commitd975c9fe66d35596638bb116f1e25978fca775aa (patch)
tree4c002f4cc3ea18cc700eb27eda04aa292d125d7b /unix
parent3c23e5ef837e2ff11b184bb119102d5e7a5f7663 (diff)
downloadtk-d975c9fe66d35596638bb116f1e25978fca775aa.zip
tk-d975c9fe66d35596638bb116f1e25978fca775aa.tar.gz
tk-d975c9fe66d35596638bb116f1e25978fca775aa.tar.bz2
* unix/tkUnixButton.c (TkpDisplayButton): Correct visual display
of disabled check/radiobutton to be more distinctive on unix. * tests/unixButton.test: [Bug #669595] (hintermayer)
Diffstat (limited to 'unix')
-rw-r--r--unix/tkUnixButton.c46
1 files changed, 33 insertions, 13 deletions
diff --git a/unix/tkUnixButton.c b/unix/tkUnixButton.c
index 4a5887d..c9d8448 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.10 2002/08/28 01:08:06 drh Exp $
+ * RCS: @(#) $Id: tkUnixButton.c,v 1.11 2003/02/25 01:39:57 hobbs Exp $
*/
#include "tkButton.h"
@@ -349,15 +349,24 @@ TkpDisplayButton(clientData)
dim -= 2*butPtr->borderWidth;
if (butPtr->flags & SELECTED) {
GC gc;
- if (butPtr->state != STATE_DISABLED &&
- butPtr->selectBorder != NULL) {
- gc = Tk_3DBorderGC(tkwin, butPtr->selectBorder,
- TK_3D_FLAT_GC);
+ if (butPtr->state != STATE_DISABLED) {
+ if (butPtr->selectBorder != NULL) {
+ gc = Tk_3DBorderGC(tkwin, butPtr->selectBorder,
+ TK_3D_FLAT_GC);
+ } else {
+ gc = Tk_3DBorderGC(tkwin, butPtr->normalBorder,
+ TK_3D_FLAT_GC);
+ }
} else {
- gc = Tk_3DBorderGC(tkwin, butPtr->normalBorder,
- TK_3D_FLAT_GC);
+ if (butPtr->disabledFg != NULL) {
+ gc = butPtr->disabledGC;
+ } else {
+ gc = butPtr->normalTextGC;
+ XSetForeground(butPtr->display, butPtr->disabledGC,
+ Tk_3DBorderColor(butPtr->normalBorder)->pixel);
+ }
}
-
+
XFillRectangle(butPtr->display, pixmap, gc, x, y,
(unsigned int) dim, (unsigned int) dim);
} else {
@@ -381,13 +390,24 @@ TkpDisplayButton(clientData)
if (butPtr->flags & SELECTED) {
GC gc;
- if (butPtr->state != STATE_DISABLED &&
- butPtr->selectBorder != NULL) {
- gc = Tk_3DBorderGC(tkwin, butPtr->selectBorder, TK_3D_FLAT_GC);
+ if (butPtr->state != STATE_DISABLED) {
+ if (butPtr->selectBorder != NULL) {
+ gc = Tk_3DBorderGC(tkwin, butPtr->selectBorder,
+ TK_3D_FLAT_GC);
+ } else {
+ gc = Tk_3DBorderGC(tkwin, butPtr->normalBorder,
+ TK_3D_FLAT_GC);
+ }
} else {
- gc = Tk_3DBorderGC(tkwin, butPtr->normalBorder, TK_3D_FLAT_GC);
+ if (butPtr->disabledFg != NULL) {
+ gc = butPtr->disabledGC;
+ } else {
+ gc = butPtr->normalTextGC;
+ XSetForeground(butPtr->display, butPtr->disabledGC,
+ Tk_3DBorderColor(butPtr->normalBorder)->pixel);
+ }
}
-
+
XFillPolygon(butPtr->display, pixmap, gc, points, 4, Convex,
CoordModeOrigin);
} else {