| Ticket UUID: | 126d0714086a9a5e30309e6653409e8546bab1da | |||
| Title: | Bug in the ttk::scale widget of the "default" theme | |||
| Type: | Bug | Version: | 8.7b1 and 9 | |
| Submitter: | nemethi | Created on: | 2025-01-09 19:35:35 | |
| Subsystem: | 88. Themed Tk | Assigned To: | nobody | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2025-01-14 20:44:37 | |
| Resolution: | Fixed | Closed By: | nemethi | |
| Closed on: | 2025-01-14 20:44:37 | |||
| Description: |
I have found a bug in my own code that draws the ttk::setTheme default ttk::style configure TScale -padding 9p ttk::scale .scl -from 0 -to 10 -value 5 pack .scl -padx 15p -pady 15p focus .scl This code produces the artifact shown in the attached screenshot (magnified by a factor of 2), in which part of the trough following the slider is unexpectedly rendered in a different color. Here is the patch that fixes the bug:
Index: generic/ttk/ttkElements.c
==================================================================
--- generic/ttk/ttkElements.c
+++ generic/ttk/ttkElements.c
@@ -1443,16 +1443,18 @@
Ttk_GetOrientFromObj(NULL, slider->orientObj, &orient);
switch (orient) {
case TTK_ORIENT_HORIZONTAL:
XFillRectangle(disp, d, gc,
mainInfoPtr->troughInnerX, mainInfoPtr->troughInnerY,
- b.x + dim/2 - 1, mainInfoPtr->troughInnerHeight);
+ b.x + dim/2 - mainInfoPtr->troughInnerX,
+ mainInfoPtr->troughInnerHeight);
break;
case TTK_ORIENT_VERTICAL:
XFillRectangle(disp, d, gc,
mainInfoPtr->troughInnerX, mainInfoPtr->troughInnerY,
- mainInfoPtr->troughInnerWidth, b.y + dim/2 - 1);
+ mainInfoPtr->troughInnerWidth,
+ b.y + dim/2 - mainInfoPtr->troughInnerY);
break;
}
}
/*
| |||
| User Comments: |
nemethi (claiming to be Csaba Nemethi) added on 2025-01-14 20:44:37:
Fixed with commits [83839103] and [45af413e]. Closing the ticket. nemethi added on 2025-01-10 10:15:51: The fix is now in branch "bug-126d071408". | |||
Attachments:
- scaleBug.png [download] added by nemethi on 2025-01-09 19:36:02. [details]
