TabBar

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

I would love to have the option to place it above the toolbar (or have the general Preferences option to use the "default toolbuttons + workbench selector" or your new TabBar system...
If you turn off all toolbars in for example Part Design workbench and set TabBar to top position and lock it. This is basically the end result you are after? I know not all tool buttons are supported ATM and some toolbars produce issues. But still from the concept point of view that is basically it?

Anyway it turned out tabs on main window level are not as straightforward task as one would expect. Majority of things i tried out didn't work good enough. There are basically two approaches left that have potential but i can't be sure before investing substantial amount of time in it if it will work out. As for workbench buttons on TabBar widget level that i guess is possible but investing substantial amount of time will be needed to make it manageable.

Anyway current plan still is to support both use cases. Therefore what will happen next is i will build up code base by adding mentioned features to it and some other features i plan to do. After turn that in release material and release it in pieces as the code is cleaned up. I have done it like that with the current released code base and the procedure worked out good.
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Post by pablogil »

Hello,
Comment out mentioned line and restart FreeCAD
Didn't work:
default.png
default.png (157.52 KiB) Viewed 1647 times
Try out system default style
Neither worked:
stylesheet.png
stylesheet.png (154.37 KiB) Viewed 1647 times
As you can see in the screenshot, the QTabBar placed in your widget is shifted to the top, compare it with the Combo View one.

This weekend I have played with the solution you explain on your last post. It works and it's a pretty good layout but it looses the option to rearrange the buttons... (see previous pics :) )

One question, why don't embe the tabs into a QToolBar? it would be really easy to move wherever you want, even above the rest of the toolbars.
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Post by pablogil »

As an update, I have just tested it on Windows and it works, I mean, there is not any "negative margin" applied to the QTabBar... it remains to test it under Linux but is kind of weird that it only happens on Mac and only in your widget, not in the "Combo Panel"...
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

pablogil wrote:As you can see in the screenshot, the QTabBar placed in your widget is shifted to the top, compare it with the Combo View one.
Yes i see the difference. Will investigate this but it might take some time before the solution will be available.
This weekend I have played with the solution you explain on your last post. It works and it's a pretty good layout but it looses the option to rearrange the buttons... (see previous pics :) )
Some questions:

On this images Lock option from quick menu isn't enabled? As for not having the option to rearrange buttons:

Image

Have you tried out Toolbar options found in Preferences? As for icon size that you will probably want to change next you can change the general Icon size toolbar preference for FreeCAD and after that is done just change the tab and changes should be reflected.
One question, why don't embe the tabs into a QToolBar? it would be really easy to move wherever you want, even above the rest of the toolbars.
It will probably be possible to move Tabs "above" "soon". Once that will be possible we can re-evaluate additional options. As for Toolbar with WB buttons i already investigated that but it's not a straightforward task ATM to add such toolbars to FreeCAD. But this also will be investigated as additional option but this one will be moved to the time after the next release phase is finished.
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Post by pablogil »

Yes, you are right, it is possible to rearrange buttons, I have tweaked them before but I explained myself incorrectly: I meant that with TabBar is not possible to rearrange QToolBars to the row you want, they are always ordered following the line till they find the window right border and then they continue in the next row. The original toolbar allows that, and for instance, I usually rearranged them on different rows depending on their importance (1: file/view, 2:main tools, 3: secondary tools):
toolbar.png
toolbar.png (214.71 KiB) Viewed 1589 times
And for the rest, we will waiting hungrily your updates =)
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

Yes. That is correct.

But i will leave the final decision up to the individual user. Therefore to use one or another or combination. That is why i choose design like this. To allow current work flow or to add small additions with TabBar or to only use TabBar. Whatever works best for individual user. For example i have 2 displays with different aspect ratios and on one TabBar makes sense on the top and on another as sidebar. The ability to change this with one mouse move therefore is welcomed. As for using default set of toolbars in standard location that i guess in the end will be possible and to only use TabBar as WB switcher.

P.S. And i distant future i will probably add one more mode on the widget level just for fun. ;)
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Post by pablogil »

Great! any improvement will be welcomed :D
It will probably be possible to move Tabs "above" "soon". Once that will be possible we can re-evaluate additional options
Actually, now that I think about it, if you finally are able to move TabBar above regular QToolBar it would be just perfect because it's already possible to disable TabBar buttons and use QToolBar ones if they are placed below TabBar...
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

Yes that is the plan.

But it turned out tabs (QTabWidget) aren't by design and concept suited for such tasks. It seemed obvious on the first look as FreeCAD has workbenches and why not change them with tabs. On TabBar widget level this works out but on main window level it can't as by switching tab you switch "tab content" and that is FreeCAD main window. In reality you don't want to do that... as that produces all sort of issues.

But i think i found a way for main window to allow me to add tabs to it and when switching tabs to not actually move main window between tabs (move content).

Anyway no rush but as you use Mac i am wondering how do tabs look like on Mac when in Default/Icon mode when using default style.
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Post by pablogil »

Perfect, we will wait without any rush ;)

Following is the Mac default mode with TabBar (no lock option):
default_nolock.png
default_nolock.png (245.37 KiB) Viewed 1564 times
Following is the Mac default mode with TabBar (lock option):
default_lock.png
default_lock.png (241.07 KiB) Viewed 1564 times
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

Thanks. This time i was mainly interested in default padding levels applied around workbench icons.

Anyway much work to be done now and will report back after a while when some of it gets done.
Post Reply