Tk Source Code

View Ticket
Login
Ticket UUID: 3089640
Title: Improve squeezing of notebook tabs
Type: Patch Version: None
Submitter: danckaert Created on: 2010-10-18 09:41:02
Subsystem: 88. Themed Tk Assigned To: fvogel
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2017-04-07 20:02:20
Resolution: Fixed Closed By: fvogel
    Closed on: 2017-04-07 20:02:20
Description:
The current squeezing algorithm for ttk::notebook tabs adjusts each tab by the same number of pixels. As a result, the smaller tabs disappear quickly, There is also a -mintabwidth style option, but this doesn't work well either: first all tabs are reduced to the minimum width, but if there is still not enough place, the rightmost tabs will disappear again.
The fact that tabs can disappear has been reported as a problem numerous times on comp.lang.tcl. An ideal solution would allow the tabs to be scrolled, but this seems to be quite hard. A different squeezing algorithm, which squeezes each tab relative to its width, can however also improve the current behavior.
Attached is a patch with this modified squeezing algorithm. Note that it ignores -mintabwidth completely, as this does not make much sense anymore in the new algorithm. (The mintabwidth did not work well anyway, because it was already ignored in TabRowSize().)
User Comments: fvogel added on 2017-04-07 20:02:20:
Merged to core-8-6-branch and trunk.

danckaert added on 2017-04-04 13:38:03:

Ok, this looks good. Thanks!


fvogel added on 2017-04-02 21:10:39:

Branch bug-308940fff now updated to support -mintabwidth when possible.

See [7ffb9e554c].


fvogel added on 2017-03-31 21:33:13:

Thanks for the patch!

It fixes an issue reported several times : [6020ee2d03], [e016579efb] and [6bf197edbf].

I do not see the fact that the style option -mintabwidth is now ignored in the squeezing algorithm as a problem. As you say it is also ignored in TabRowSize(). Moreover this style configuration option is undocumented and unused in the styles provided by Tk. Having a squeezing algorithm that prevents the tabs from shrinking up to disappearance is more important in my eyes.


danckaert added on 2010-10-18 16:41:02:

File Added - 390259: notebook.patch

Attachments: