klayout
klayout copied to clipboard
Use enhanced tab widget for file tabs to easily navigate through larg…
…e number of opened files.
Only missing piece is icon. Looks like KLayout is in the middle of refactoring icons handling, so I'll need guidance on that. Icon I have in mind: https://fonts.gstatic.com/s/i/short-term/release/materialsymbolsoutlined/menu/default/48px.svg.
Thanks a lot for this PR. I'll take a look.
You're right, there is refactoring going on with the goal to support High-DPI icons. I will produce SVG for the new icon as well.
Matthias
Thanks again for providing this PR. I really like this feature :)
However, after taking a look I have some modification proposals. Specifically, I'm slightly worried about the implications of switching to QTabWidget. I made an alternative proposal in this branch: enhanced-tab-widget
I cannot modify your PR, but maybe you want to take a look.
For the rationale see here: https://github.com/KLayout/klayout/commit/ab9fe57ec3363554c435163db7771ab00029e7a7
Best regards,
Matthias
Your branch looks OK for me. QTabBar/QTabWidget switch was not trivial because of life-time management, but somehow QTabWidget worked for me :-)
I noticed that you added context menu for tabs, so it may be useful also to add Close to the Left/Right like Visual Studio Code of Firefox. Clone command also seems to be good fit to context menu.
Makes sense, yes.
I have added these features (also for the macro editor tabs except for "clone") to the branch if you like to take a look.
Matthias
Just build and tested your branch. Looks OK for me, except there is different between KLayout and VS Code/Firefox how to treat context menu. In KLayout currently selected tab is base one, but in VS Code/Firefox base tab is where mouse was right-clicked (i.e. QTabBar::tabAt). Theoretically right click could be made outside bars, so -1 return value should be handled too (no menu displayed).
I see ... it's not trivial to detect the tab the mouse clicked appeared at, but I'll try.
I may be just change current tab on right-click?
That was easier than I thought. I have updated the branch accordingly. I cannot avoid however that the selected tab switches to the one the mouse points at. But I think that makes sense considering that otherwise the selected tab might become invisible.
I tried current version of branch and it works fine. Thank you!
Thanks! I merged this PR.
Thank you!