diff options
author | patthoyts <patthoyts@users.sourceforge.net> | 2009-10-05 15:08:07 (GMT) |
---|---|---|
committer | patthoyts <patthoyts@users.sourceforge.net> | 2009-10-05 15:08:07 (GMT) |
commit | 4612ca941982a992314e671c03ab0faa96bbadee (patch) | |
tree | 180d368c9f9519cf262c0dcadbc3371580fbaa9d | |
parent | 14767d92e8525b24e10d6c5de874a5cf92a02cba (diff) | |
download | tk-4612ca941982a992314e671c03ab0faa96bbadee.zip tk-4612ca941982a992314e671c03ab0faa96bbadee.tar.gz tk-4612ca941982a992314e671c03ab0faa96bbadee.tar.bz2 |
[Bug 2860827] Backported patch avoiding 3D effects with user-specified backgrounds
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | win/tkWinButton.c | 22 |
2 files changed, 18 insertions, 9 deletions
@@ -1,3 +1,8 @@ +2009-10-05 Pat Thoyts <patthoyts@users.sourceforge.net> + + * win/tkWinButton.c: Backported patch avoiding 3D effects with + user-specified background [Bug 2860827] + 2009-09-25 Donal K. Fellows <dkf@users.sf.net> * generic/tkImgPhoto.c (ImgGetPhoto): Correct generation of grayscale diff --git a/win/tkWinButton.c b/win/tkWinButton.c index 5a348b1..22142c7 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.34 2007/12/14 15:56:09 patthoyts Exp $ + * RCS: @(#) $Id: tkWinButton.c,v 1.34.2.1 2009/10/05 15:08:07 patthoyts Exp $ */ #define OEMRESOURCE @@ -552,15 +552,17 @@ TkpDisplayButton( (butPtr->disabledFg != NULL)) { COLORREF oldFgColor = gc->foreground; - gc->foreground = GetSysColor(COLOR_3DHILIGHT); - Tk_DrawTextLayout(butPtr->display, pixmap, gc, + if (gc->background == GetSysColor(COLOR_BTNFACE)) { + gc->foreground = GetSysColor(COLOR_3DHILIGHT); + Tk_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout, x + textXOffset + 1, y + textYOffset + 1, 0, -1); - Tk_UnderlineTextLayout(butPtr->display, pixmap, gc, + Tk_UnderlineTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout, x + textXOffset + 1, y + textYOffset + 1, butPtr->underline); - gc->foreground = oldFgColor; + gc->foreground = oldFgColor; + } } Tk_DrawTextLayout(butPtr->display, pixmap, gc, @@ -615,13 +617,15 @@ TkpDisplayButton( if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) { COLORREF oldFgColor = gc->foreground; - gc->foreground = GetSysColor(COLOR_3DHILIGHT); - Tk_DrawTextLayout(butPtr->display, pixmap, gc, + if (gc->background == GetSysColor(COLOR_BTNFACE)) { + gc->foreground = GetSysColor(COLOR_3DHILIGHT); + Tk_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout, x + 1, y + 1, 0, -1); - Tk_UnderlineTextLayout(butPtr->display, pixmap, gc, + Tk_UnderlineTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout, x + 1, y + 1, butPtr->underline); - gc->foreground = oldFgColor; + gc->foreground = oldFgColor; + } } Tk_DrawTextLayout(butPtr->display, pixmap, gc, butPtr->textLayout, x, y, 0, -1); |