TabBar

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Post by pablogil »

No problem, I'll stay tuned to changes and improvements

Thanks
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 »

Qt uses toolbar object name itself to identify toolbars. Therefore i probably won't change toolbar object name dynamically in TabBar. What i probably could do is to change tool buttons object name when toolbar changes orientation. Now as for that to make sense i guess there must be a good reason to do that. Note that selector menu button will use the same mode as quick menu button in the future. Therefore if you have problems only with styling selector menu button this will resolve itself in the future.

Or is there more to it?
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Post by pablogil »

The problem arises on how toolbar are named when horizontal and vertical... I don't know why but it don't fully works. Try this:

Code: Select all

QToolBar:horizontal#TabBar QToolButton {
    background-color: red;
}
QToolBar:vertical#TabBar QToolButton {
    background-color: blue;
}
You will see that it always apply the blue color but cannot make the button get the red color when horizontal and blue when vertical.
This is just a test of course, but it limits me to correctly style the 2 positions separately.
So I arrive to this:
Theoretical solution (horizontal, not working perfectly)
horizontal-vertical_style2.png
horizontal-vertical_style2.png (182.56 KiB) Viewed 3568 times
Theoretical solution (vertical, not working perfectly)
horizontal_style2.png
horizontal_style2.png (192.21 KiB) Viewed 3568 times
Desired solution (horizontal)
horizontal_style1.png
horizontal_style1.png (194.69 KiB) Viewed 3568 times
Desired solution (vertical)
horizontal-vertical_style1.png
horizontal-vertical_style1.png (191.41 KiB) Viewed 3568 times
Both "desired solutions" are different stylesheets so that's why I would like another way to style them separately so that I'm able to write an unique stylesheet.
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 »

I see. Well i will probably have some free time this weekend and i will try to implement support for mentioned use case.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

ToolBar mode style improvements

- Changed Compact Menu (Toolbar mode) default pop-up menu mode
- Ability to independently style horizontal/vertical ToolBar buttons (feature request by @pablogil)

Code: Select all

QToolButton[toolbar_orientation="horizontal"] {
    background-color: red;
}

QToolButton[toolbar_orientation="vertical"] {
    background-color: blue;
}
ToolBar_Orientation.png
ToolBar_Orientation.png (23.58 KiB) Viewed 3530 times
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Post by pablogil »

It works like a charm, thank you! I will release very soon the styles =)
One additional question: the toolbar compact menu button and the preferences menu button, what element they are? I have seen they don't get the styles and images I have designed on my regular stylesheets...

Thank you!
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:It works like a charm, thank you!
You're welcome.
One additional question: the toolbar compact menu button and the preferences menu button, what element they are? I have seen they don't get the styles and images I have designed on my regular stylesheets...
All the buttons on the toolbar are QToolButtons. Mentioned two have icon only (without text) tool button style applied (not by using stylesheet) and InstantPopup popup mode is set.
User avatar
pablogil
Posts: 881
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Post by pablogil »

@triplus
Have you checked that on FreeCAD 0.17 if you go into an sketch the TabBar toolbar goes empty?
empty.png
empty.png (134.09 KiB) Viewed 3448 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 »

pablogil wrote:@triplus
Have you checked that on FreeCAD 0.17 if you go into an sketch the TabBar toolbar goes empty?
No. As i don't use development release ATM. Thanks for the report and i will look into it.

P.S. Until i look into it in more detail you can use TabBar preferences -> Selector tab -> Custom mode to disable Sketcher Workbench. Instead of using Tools -> Customizing -> Workbenches.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

Improved workbench activation detection

- Improved workbench activation detection (issue reported by pablogil))
- Bar mode: option to enable/disable selector menu
- Bar mode: option to move selector menu to the end
- ToolBar mode: option to move selector menu to the end
- ToolBar mode: Quick Menu and Selector button now follow set style (Icon and text, Icon, Text)
- Don't set workbench QAction object name (avoid duplicates)
- Changed Toolbar preferences selector menu button default menu pop-up mode
Post Reply