summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-14 20:20:39 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-14 20:20:39 (GMT)
commitb990e1db176a541b5095f23d0fec999c992afb58 (patch)
treec99403db7657941c9b8d9da39fec2e833b6d5371 /win
parent83514ebcf9336a0ee9330bdfa93a39de39ac6b54 (diff)
parent8a2f66101bb61555e247c13cd0e6717121c07c49 (diff)
downloadtk-b990e1db176a541b5095f23d0fec999c992afb58.zip
tk-b990e1db176a541b5095f23d0fec999c992afb58.tar.gz
tk-b990e1db176a541b5095f23d0fec999c992afb58.tar.bz2
Better fix for [4d0a6f32b7]: Unique behavior of some options in the message widget in 8.7/9.0. No longer cache PIXEL values in button's and message. With testcases
Diffstat (limited to 'win')
-rw-r--r--win/tkWinButton.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c
index 31789e1..e0998b5 100644
--- a/win/tkWinButton.c
+++ b/win/tkWinButton.c
@@ -565,6 +565,11 @@ TkpDisplayButton(
return;
}
+ Tk_GetPixelsFromObj(NULL, tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth);
+ Tk_GetPixelsFromObj(NULL, tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth);
+ Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padXPtr, &butPtr->padX);
+ Tk_GetPixelsFromObj(NULL, tkwin, butPtr->padYPtr, &butPtr->padY);
+
border = butPtr->normalBorder;
if ((butPtr->state == STATE_DISABLED) && (butPtr->disabledFg != NULL)) {
gc = butPtr->disabledGC;
@@ -924,8 +929,8 @@ TkpDisplayButton(
if (relief != TK_RELIEF_FLAT) {
Tk_Draw3DRectangle(tkwin, pixmap, border,
defaultWidth, defaultWidth,
- Tk_Width(tkwin) - 2*defaultWidth,
- Tk_Height(tkwin) - 2*defaultWidth,
+ Tk_Width(tkwin) - 2 * defaultWidth,
+ Tk_Height(tkwin) - 2 * defaultWidth,
butPtr->borderWidth, relief);
}
if (defaultWidth != 0) {
@@ -1000,9 +1005,9 @@ TkpComputeButtonGeometry(
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- if (butPtr->highlightWidth < 0) {
- butPtr->highlightWidth = 0;
- }
+ Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->highlightWidthPtr, &butPtr->highlightWidth);
+ Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->borderWidthPtr, &butPtr->borderWidth);
+
butPtr->inset = butPtr->highlightWidth + butPtr->borderWidth;
butPtr->indicatorSpace = 0;
@@ -1195,6 +1200,9 @@ TkpComputeButtonGeometry(
* because otherwise it is not really a compound button.
*/
+ Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padXPtr, &butPtr->padX);
+ Tk_GetPixelsFromObj(NULL, butPtr->tkwin, butPtr->padYPtr, &butPtr->padY);
+
if (butPtr->compound != COMPOUND_NONE && haveImage && haveText) {
switch ((enum compound) butPtr->compound) {
case COMPOUND_TOP:
@@ -1265,8 +1273,8 @@ TkpComputeButtonGeometry(
height = butPtr->height;
}
- width += 2*butPtr->padX;
- height += 2*butPtr->padY;
+ width += 2 * butPtr->padX;
+ height += 2 * butPtr->padY;
} else if (haveImage) {
if (butPtr->width > 0) {
width = butPtr->width;