TabBar

Need help, or want to share a macro? Post here!
pablogil
Posts: 505
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Postby pablogil » Mon May 16, 2016 9:06 pm

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
Posts: 4866
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Postby triplus » Fri May 20, 2016 12:13 am

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?
pablogil
Posts: 505
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Postby pablogil » Sat May 21, 2016 8:38 am

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 2174 times

Theoretical solution (vertical, not working perfectly)
horizontal_style2.png
horizontal_style2.png (192.21 KiB) Viewed 2174 times

Desired solution (horizontal)
horizontal_style1.png
horizontal_style1.png (194.69 KiB) Viewed 2174 times

Desired solution (vertical)
horizontal-vertical_style1.png
horizontal-vertical_style1.png (191.41 KiB) Viewed 2174 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
Posts: 4866
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Postby triplus » Sat May 21, 2016 4:05 pm

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

Re: TabBar

Postby triplus » Sat May 21, 2016 9:26 pm

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 2136 times
pablogil
Posts: 505
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Postby pablogil » Sun May 22, 2016 2:44 pm

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
Posts: 4866
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Postby triplus » Mon May 23, 2016 12:52 am

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.
pablogil
Posts: 505
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Postby pablogil » Wed May 25, 2016 6:08 pm

@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 2054 times
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
triplus
Posts: 4866
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Postby triplus » Fri May 27, 2016 7:34 am

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
Posts: 4866
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Postby triplus » Fri Jun 03, 2016 10:46 am

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