summaryrefslogtreecommitdiffstats
path: root/win/tkWinButton.c
diff options
context:
space:
mode:
authorculler <culler>2019-04-24 17:35:36 (GMT)
committerculler <culler>2019-04-24 17:35:36 (GMT)
commit9a2648b9e8ec3d6a0b61cc184f2906cc0c3c79ab (patch)
treeebadc5ea4889e2748cbd3b8a16596609346507d2 /win/tkWinButton.c
parentf161a25c50e2b39ffc3e6e8dbacdf89b18f44629 (diff)
parentbf19ff82cc3fb7362d1b9f268e090b7668d65239 (diff)
downloadtk-9a2648b9e8ec3d6a0b61cc184f2906cc0c3c79ab.zip
tk-9a2648b9e8ec3d6a0b61cc184f2906cc0c3c79ab.tar.gz
tk-9a2648b9e8ec3d6a0b61cc184f2906cc0c3c79ab.tar.bz2
Fix bug [1001070]: make labels use -highlightbackground
Diffstat (limited to 'win/tkWinButton.c')
-rw-r--r--win/tkWinButton.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index f4039cf..0b71327 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.c
@@ -405,7 +405,10 @@ TkpDisplayButton(
* Compute width of default ring and offset for pushed buttons.
*/
- if (butPtr->type == TYPE_BUTTON) {
+ if (butPtr->type == TYPE_LABEL) {
+ defaultWidth = butPtr->highlightWidth;
+ offset = 0;
+ } else if (butPtr->type == TYPE_BUTTON) {
defaultWidth = ((butPtr->defaultState == DEFAULT_ACTIVE)
? butPtr->highlightWidth : 0);
offset = 1;
@@ -759,17 +762,24 @@ TkpDisplayButton(
butPtr->borderWidth, relief);
}
if (defaultWidth != 0) {
+ int highlightColor;
+
dc = TkWinGetDrawableDC(butPtr->display, pixmap, &state);
+ if (butPtr->type == TYPE_LABEL) {
+ highlightColor = (int) Tk_3DBorderColor(butPtr->highlightBorder)->pixel;
+ } else {
+ highlightColor = (int) butPtr->highlightColorPtr->pixel;
+ }
TkWinFillRect(dc, 0, 0, Tk_Width(tkwin), defaultWidth,
- (int) butPtr->highlightColorPtr->pixel);
+ highlightColor);
TkWinFillRect(dc, 0, 0, defaultWidth, Tk_Height(tkwin),
- (int) butPtr->highlightColorPtr->pixel);
+ highlightColor);
TkWinFillRect(dc, 0, Tk_Height(tkwin) - defaultWidth,
Tk_Width(tkwin), defaultWidth,
- (int) butPtr->highlightColorPtr->pixel);
+ highlightColor);
TkWinFillRect(dc, Tk_Width(tkwin) - defaultWidth, 0,
defaultWidth, Tk_Height(tkwin),
- (int) butPtr->highlightColorPtr->pixel);
+ highlightColor);
TkWinReleaseDrawableDC(pixmap, dc, &state);
}