Created attachment 128072 [details] window with multiple tabs open (thin window) SUMMARY While it totally makes sense that tabs with a lot of text get a lot of the space, there should be some limit, because the shorter the tab text, the more important each letter is for recognizing which folder that tab corresponds to. STEPS TO REPRODUCE 1. on command line: cd /tmp && mkdir test && cd test && mkdir "2019 - normal folder name" && mkdir "relatively short folder name" && mkdir "this is a very long folder name that dominates all other tabs which seems a bit suboptimal since the user probably would be okay with just the beginning" This is what the directory tree looks like: /tmp/test ├── 2019 - normal folder name ├── relatively short folder name └── this is a very long folder name that dominates all other tabs which seems a bit suboptimal since the user probably would be okay with just the beginning 2. Enter /tmp/test in Dolphin and open the tabs in Dolphin OBSERVED RESULT The tab for the folder with the very long name takes almost all the space of the tab bar. Resizing the window gives the tab that's already pretty long even more space. (See attachments.) EXPECTED RESULT For the tabs with little text to get enough space to make them (more) readable. I actually had the problem where a long folder name was making it hard to discern what the other tabs contain. I've attached a Python file to illustrate how that algorithm could work. (Basically it adds the length of each tab text to a list. Then it brings each length in that list nearer to the average of said list.) This is the output: # length name 25: 2019 - normal folder name 28: relatively short folder name 152: this is a very long folder name that dominates all other tabs which seems a bit suboptimal since the user probably would be okay with just the beginning average tab length: 68.33333333333333 43.78: 2019 - normal folder name 44.27: relatively short folder name 82.00: this is a very long folder name that dominates all other tabs which seems a bit suboptimal since the user probably would be okay with just the beginning Simulate tab bar (I know it's a lot more complex in reality) ------------------------------------------------------------ | 2019 - normal fold… | relatively short f… | this is a very long folder name t… | SOFTWARE/OS VERSIONS Linux/KDE Plasma: Kubuntu 18.04 KDE Plasma Version: 5.12.9 KDE Frameworks Version: 5.47.0 Qt Version: 5.9.5 It would be cool if someone could test if this is still an issue in the latest version. (following the above steps to reproduce). Thanks for KDE =)
Created attachment 128073 [details] window with multiple tabs open (wide window)
Created attachment 128074 [details] Python program to illustrate how the size could be calculated
Yeah I agree this could use a bit of polishing to make sure that tabs with long text can't infinitely expand. One solution could be to make all tabs auto-expand so they're all the same width. I'm sure there are other options.
Created attachment 128079 [details] Python program to illustrate how the size could be calculated (bug fixed) removed the default complex part that was actually buggy for very very long tab names. Now all it does is append 'current + (average - current)*0.65' to a list, and then use that list as weights for the tab size.
Thanks for the quick response Nate! Is this actually a general Plasma thing that could be addressed? (So that all KDE apps could benefit from such a change. If that would be reasonable..) I wondered about that after having written the bug report, but wasn't sure which project to choose besides Dolphin for the report.
Default tab widths for KDE applications are computed in QTabBar from QtWidgets library.
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/592
Git commit 1165a1bc52cdeb2f6538a47c74b34bf283543ba7 by Méven Car, on behalf of K. Cottonears. Committed on 17/08/2023 at 09:22. Pushed by meven into branch 'master'. Set Maximum Tab Width for folders to Tab bar There is no limit to the width of tabs with the tab bar of the main window. If the directory name is too long, tabs can take up a lot of space and can lead to inconsistent tab widths. To alleviate this, set a maximum tab bar text width of 40 characters for each folder. M +2 -1 src/dolphintabwidget.cpp https://invent.kde.org/system/dolphin/-/commit/1165a1bc52cdeb2f6538a47c74b34bf283543ba7