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

TabBar

Post by triplus »

TabBar.png
TabBar.png (60.98 KiB) Viewed 6521 times
Objective: Provide TabBar functionality for FreeCAD (as macro/module).

Code repository:

https://github.com/triplus/TabBar
Last edited by triplus on Sat Jan 09, 2016 7:15 pm, edited 1 time in total.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

OK this weekend i mostly focused on establishing the strategy. Based on the investigation on what "might" work the current plan is:
  1. Create TabBar on the fly by extracting needed information from FreeCAD
  2. Add tools to appropriate tabs
  3. Control Panel
  4. Save/Restore settings
I made big progress on 1 and partial progress on 2. I feel in the end investigating and hopefully implementing the initial solutions for each of this area will take me at least a week for each.

As for point 1:
  • None WB has no icon.
  • Inspection WB doesn't use the icon from resources (therefore has no icon).
  • Ship and Plot WB icon defined in InitGui.py isn't used in Workbench Switcher. Correct path isn’t set in InitGui.py and the icon doesn’t get copied to resources folder.
I guess i could do a pull request and for now resolve this issues by providing XPM icons (i am not sure about that yet).

As for point 4 work done by @PrzemoF will probably resolve part of this task.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: TabBar

Post by DeepSOIC »

triplus wrote:None WB has no icon.
No icon is the right icon for None workbench, isn't it? ;)
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

DeepSOIC wrote:
triplus wrote:None WB has no icon.
No icon is the right icon for None workbench, isn't it? ;)
Well in the end it has an icon (FreeCAD logo for example). ;)

P.S. Anyway this is not all that important for now i just shared some info i discovered.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

This week(end) i mostly focused on first 3 points.
  • Point 1 is almost done.
  • Point 2 is around 2/3 done. Draft Snap toolbar looks like will need some special attention. Buttons with menu need more work. And there are some special buttons i didn't investigate yet.
  • Point 3 is progressing nicely. I am not sure of the behaviour of QMenu on Mac.
  • Point 4 no work done on this yet.
If i will be able to invest the same amount of time over the next week(end) i feel next weekend i will able to start sharing some code for testers and feedback.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

I invested the same amount of time in TabBar this week(end) and i worked on first 3 points. I am not sure sharing the work makes much sense ATM as i feel a bit more work needs to be done first before testing will be needed. In the following week i will have less time to work on TabBar therefore i feel next week(end) won't be as productive regarding TabBar as previous two.

P.S. Anyway it's slowly taking shape and i like what i see.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: TabBar

Post by DeepSOIC »

I really look forward to it! I'm switching workbenches a lot, and it's not fun now. Keep up!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

This week(end) a bit more work was done than i anticipated last week. Time was limited but i managed to dedicate some time for TabBar.

Point 1: Almost ready for initial release, testing and feedback.

Point 2: This will be on the list next week(end). I will try to find a solution for buttons with menu. There are some special toolbars/buttons that probably won't be supported in initial release. I feel solving that might not be as straightforward task and workarounds might be needed instead. I won't focus on that for now. Out of 34 modules installed we are talking about 4 toolbars and small number of buttons in different workbenches.

Draft Snap toolbar persistence

Good news is i have access to toolbar list now and hopefully it will be available on all platforms (Mac behaviour regarding QMenu):

Workbench specific toolbar list

Point 3: Almost ready for initial release, testing and feedback. After new settings can be added to it when needed.

Point 4: This is almost ready for initial release, testing and feedback as i can save/restore TabBar settings:

Add sub-group for parameters

And if i run TabBar as module user set TabBar position persist in next FreeCAD session:

Potential Feature Request: FreeCAD Init Startup files
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

I would say all 4 points are now finished. That is all the concepts/features i planed for initial release are done. Some of the work i have done this week(end) include implementing support for buttons with menu. It looks like this is the way to go:

Drop-down button in python workbenches

Some (i would guess older) buttons with menu like Draw style and Drawing Workbench drawing/template insert button do work but have issues with updating the icon to appropriate one. I feel this could be discussed after the initial release as i decided i won't implement or search for any workarounds for a few toolbars/buttons/widgets that do things a bit different for now. Changing icon size in preferences should be reflected... Features implemented in the past like:

expose Command::doCommand() to python

Are useful as now user can change workbench with TabBar and macro recording should pick that up. I struggled a bit on installing event filter for one use case but in the end it got sorted out. Therefore as the initial plan was done the new plan is:
  • Clean up the code and release it for testing. This will probably be done in steps.
  • As TabBar needs more work i will probably release the code on GitHub as attaching the code and future updates in this thread would be hard to manage over time.
  • Gather impression and input from testers.
  • Make a list of bugs/features in need to be addressed.
P.S. That is it for this week(end)! I am not sure how much time i will have next week(end) as i guess 2016 is knocking on the door!
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Post by triplus »

This week(end) a bit less work was done. Cleaning up the code was the main objective but i guess i underestimated the amount of work needed for this task. Therefore i rather focused on code cleaning instead of trying to release a part of the TabBar work done until now. Next week(end) should mark the start of releasing part of the TabBar code done until now.
Post Reply