TabBar

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

Re: TabBar

Post by triplus »

pablogil wrote:Solved!
Good to hear that.
The default style works perfectly but on my styles (Dark and Light stylesheets) crops just 1 pixel, so I think it's solved.
Yes it turned out solution for this one isn't as straightforward as hoped. For now i did it like this and this will likely be default behaviour. But there will be a setting in preferences for user to be able to control this.

P.S. As for status update. I have finished prototypes therefore i guess i will start releasing some code again soon but this time it might take a bit longer as i have little free time at the moment and going beyond widget level nothing is as straightforward task as one would hope for. But we will get there eventually!
User avatar
pablogil
Posts: 882
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Post by pablogil »

triplus wrote: Yes it turned out solution for this one isn't as straightforward as hoped. For now i did it like this and this will likely be default behaviour. But there will be a setting in preferences for user to be able to control this.
Right now is almost perfect, I have again started to try it because changing workbenches with the toolbutton/macro option causes lots of FreeCAD crashes when switching... I don't know why. Your widget is perfect on that and doesn't generate crashes.
triplus wrote: P.S. As for status update. I have finished prototypes therefore i guess i will start releasing some code again soon but this time it might take a bit longer as i have little free time at the moment and going beyond widget level nothing is as straightforward task as one would hope for. But we will get there eventually!
We will wait relaxed for updates ;)
Cheers
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 »

Changelog:
  • Added selector button to toolbar preferences tab
  • Added workbench icons to autoload preferences tab
  • Detect selector action group
  • Small margin adjustment
  • Small code optimizations/improvements
  • Converted push buttons to tool buttons
SelectorPref.png
SelectorPref.png (76.94 KiB) Viewed 2627 times
User avatar
pablogil
Posts: 882
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Post by pablogil »

This new update made the TabBar QDockWidget totally empty... the widget itself loads but there's no button inside.


OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6641 (Git)
Build type: Release
Branch: (detached from 64de0b4)
Hash: 64de0b498b2fe38f9a1660ac992cf0d6507a4474
Python version: 2.7.11
Qt version: 4.8.7
Coin version: 3.1.3
OCC version: 6.8.0.oce-0.17
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 for reporting it. I will (temporarily) disable detection of selector action group and will look into this in the future. If i can reliably detect it that opens some new possibilities and optimizations. But it seems that workbench customization feature removes the action (NoneWorkbench) from the selector action group if user disables the None workbench and that is why the issue occurs. I will therefore need to take this into consideration when looking for potential solutions in the future.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

OK i just made the needed changes and temporarily disabled detect selector action group feature. Hopefully now things should be back to normal.

P.S. I already have some ideas on how to improve detection reliability and will do the tests over the weekend (and as this feature is needed for future released code no functionality available up to this point is lost).
User avatar
pablogil
Posts: 882
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: TabBar

Post by pablogil »

triplus wrote:OK i just made the needed changes and temporarily disabled detect selector action group feature. Hopefully now things should be back to normal.

P.S. I already have some ideas on how to improve detection reliability and will do the tests over the weekend (and as this feature is needed for future released code no functionality available up to this point is lost).
It's working again, 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 »

Small update:

I thought it would make sense to bring some TabBar functionality closer to FreeCAD and reuse what already exists instead of duplicating the effort. But it turned out workbench selector customization in its current form prevents that. Therefore i will probably need to revise features like "added selector button to toolbar preferences tab" for the next release as currently there is a chance small issues could occur.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

Added selector preferences tab
  • Detect selector action group (improved reliability)
  • Default FreeCAD workbench selector now changes TabBar tabs
  • Selector button now always lists all available workbenches (toolbar preferences)
  • Improved toolbar preferences toggle button behaviour (removed some flickering at preferences start)
  • Added selector preferences tab
  • Added checkable workbench list
  • Added support for default and custom mode
  • Default mode respects FreeCAD workbench customization settings
  • Added move up/down and reset buttons for custom mode
  • Added sidebar toggle button with setting persistence
  • Centralized logic to manage on selector events
  • Added selector menu button when workbench toolbar is detected (lists all available workbenches)
  • Added selector menu button when workbench toolbar is not detected (none and complete workbench)
  • Added additional none tab logic
  • Added before start logic
  • Adapted after start logic
  • Added support for dynamic and on-demand creation and removal of tabs
  • Various small changes, code restructuring and optimizations
SelectorMenu.png
SelectorMenu.png (50.87 KiB) Viewed 2473 times
SelectorTab.png
SelectorTab.png (56.96 KiB) Viewed 2473 times
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

And small update on the progress:

I didn't want to further delay release of code therefore i left this for the next release:
  • Qt sorts names differently. Therefore none workbench is by default listed on top (Selector Tab).
  • Currently if user disables Workbench toolbar in Toolbar preferences the selector menu is still available.
If no other issues will be detected i will focus on one of this areas for the next release: Style, TabBar mode as requested by @pablogil or TabBar mode as requested by @DeepSOIC. Work done up to this point was needed to improve TabBar and to prepare it for integration of prototypes made to support mentioned modes.
Post Reply