| Ticket UUID: | 2912962 | |||
| Title: | Notebook does not set TTK_STATE_USER1 | |||
| Type: | Bug | Version: | None | |
| Submitter: | decosterjos | Created on: | 2009-12-11 22:08:19 | |
| Subsystem: | 88. Themed Tk | Assigned To: | fvogel | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2017-04-07 20:08:22 | |
| Resolution: | Fixed | Closed By: | fvogel | |
| Closed on: | 2017-04-07 20:08:22 | |||
| Description: |
The TabState function in ttkNotebook.c is not setting the TTK_STATE_USER1 flag correctly. This happend when tabs added to the notebook before the tab currently visible in first position was added, are now hidden. The TabState function check 'index == 0' but this is not working correctly when tab are hidden. Looking for the first visible tab should skip hidden tabs. The attached script triggers this problem with the tileqt theme. The attached C file has a patched TabState function. | |||
| User Comments: |
fvogel added on 2017-04-07 20:08:22:
Merged to core-8-6-branch and trunk. fvogel added on 2017-04-03 20:35:17: Tweaking the clam theme the following way, jsut for the purpose of testing this fix:
Index: generic/ttk/ttkClamTheme.c
==================================================================
--- generic/ttk/ttkClamTheme.c
+++ generic/ttk/ttkClamTheme.c
@@ -830,10 +830,17 @@
}
if (state & TTK_STATE_USER2) { /* Rightmost tab */
--b.width;
}
+
+ if (state & TTK_STATE_USER1) { /* Leftmost visible tab */
+ b.width += 30;
+ }
+ if (state & TTK_STATE_USER2) { /* Rightmost visible tab */
+ b.width += 60;
+ }
Tk_Fill3DRectangle(tkwin, d, border,
b.x+2, b.y+2, b.width-1, b.height-2+dh, borderWidth, TK_RELIEF_FLAT);
x1 = b.x, x2 = b.x + b.width;
the following script allows to demonstrate the issue and the fact the fix works:
package require Tk
ttk::notebook .n -width 640 -height 400
foreach w { a b c d e f g } {
.n add [frame .n.$w] -text "$w"
}
pack .n -fill both -expand 1
ttk::style theme use clam ; # initial state
.n hide 1 ; # "a" still large width, "g" still extremely large width
.n hide 0 ; # "c" becomes large width
.n hide 6 ; # "f" becomes extremely large width
.n hide 2
.n hide 3
.n hide 4 ; # "f" is the last visible tab,
; # it now cumulates large and extremely large widths
fvogel added on 2017-04-03 14:47:03: TTK_STATE_USER2 state now fixed as well. I could not get my hands on the tileqt theme (project seems to be abandoned?). Who can exhibit any script easily showing the issue (and that the fix works)? fvogel added on 2017-04-03 06:32:53: Thanks for the report and patch. Looks OK to me. I have committed the patch in branch bug-2912962fff. Don't we have the same issue with TTK_STATE_USER2? Currently this flag is set on the last tab, whether it's visible or hidden. decosterjos added on 2009-12-12 05:09:49: File Added - 354872: TabState.c decosterjos added on 2009-12-12 05:08:20: File Added - 354871: qt.tcl | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki