summaryrefslogtreecommitdiffstats
path: root/win/tkWinButton.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2003-04-25 20:11:26 (GMT)
committerhobbs <hobbs>2003-04-25 20:11:26 (GMT)
commit165b227f9936ee73db655e68bb22b4ddf1ad3065 (patch)
tree933a5b180ed9483fb0a8edd6d90eead469be3e60 /win/tkWinButton.c
parenta46adb61bb407f5fc6a7ce81c4b7e2cfe2a2f96d (diff)
downloadtk-165b227f9936ee73db655e68bb22b4ddf1ad3065.zip
tk-165b227f9936ee73db655e68bb22b4ddf1ad3065.tar.gz
tk-165b227f9936ee73db655e68bb22b4ddf1ad3065.tar.bz2
* unix/tkUnixButton.c (TkpDisplayButton): Use the normalTextGc when
* win/tkWinButton.c (TkpDisplayButton): displaying disabled text that have images, as they get a gray50 stipple as well and the disabledGc is not set up correctly for font drawing. [Bug #477740]
Diffstat (limited to 'win/tkWinButton.c')
-rw-r--r--win/tkWinButton.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index 1f050aa..dc8ef12 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.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: tkWinButton.c,v 1.20 2002/09/03 01:05:11 hobbs Exp $
+ * RCS: @(#) $Id: tkWinButton.c,v 1.20.2.1 2003/04/25 20:11:31 hobbs Exp $
*/
#define OEMRESOURCE
@@ -461,10 +461,9 @@ TkpDisplayButton(clientData)
}
haveText = (butPtr->textWidth != 0 && butPtr->textHeight != 0);
-
+
if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
- int imageXOffset, imageYOffset, fullWidth,
- fullHeight;
+ int imageXOffset, imageYOffset, fullWidth, fullHeight;
imageXOffset = 0;
imageYOffset = 0;
fullWidth = 0;
@@ -542,10 +541,14 @@ TkpDisplayButton(clientData)
y + imageYOffset, 1);
XSetClipOrigin(butPtr->display, gc, 0, 0);
}
-
- Tk_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout,
- x + textXOffset, y + textYOffset, 0, -1);
- Tk_UnderlineTextLayout(butPtr->display, pixmap, gc,
+
+ /*
+ * Use normalTextGC in this case since we have both text and image,
+ * the whole button will later be stippled 50% grey.
+ */
+ Tk_DrawTextLayout(butPtr->display, pixmap, butPtr->normalTextGC,
+ butPtr->textLayout, x + textXOffset, y + textYOffset, 0, -1);
+ Tk_UnderlineTextLayout(butPtr->display, pixmap, butPtr->normalTextGC,
butPtr->textLayout, x + textXOffset, y + textYOffset,
butPtr->underline);
height = fullHeight;
@@ -643,7 +646,7 @@ TkpDisplayButton(clientData)
xSrc += tsdPtr->boxWidth*2;
}
ySrc = (butPtr->type == TYPE_RADIO_BUTTON) ? 0 : tsdPtr->boxHeight;
-
+
/*
* Update the palette in the boxes bitmap to reflect the current
* button colors. Note that this code relies on the layout of the