TabBar

Need help, or want to share a macro? Post here!
triplus
Posts: 4993
Joined: Mon Dec 12, 2011 4:45 pm

TabBar

Postby triplus » Sat Nov 28, 2015 2:46 pm

TabBar.png
TabBar.png (60.98 KiB) Viewed 3495 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
Posts: 4993
Joined: Mon Dec 12, 2011 4:45 pm

Re: TabBar

Postby triplus » Sun Nov 29, 2015 4:30 pm

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.
DeepSOIC
Posts: 4679
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: TabBar

Postby DeepSOIC » Sun Nov 29, 2015 4:35 pm

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

Re: TabBar

Postby triplus » Tue Dec 01, 2015 6:57 pm

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

Re: TabBar

Postby triplus » Sun Dec 06, 2015 11:55 am

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

Re: TabBar

Postby triplus » Sun Dec 13, 2015 1:42 pm

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.
DeepSOIC
Posts: 4679
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: TabBar

Postby DeepSOIC » Sun Dec 13, 2015 6:24 pm

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

Re: TabBar

Postby triplus » Sun Dec 20, 2015 10:56 pm

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

Re: TabBar

Postby triplus » Sun Dec 27, 2015 11:40 pm

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

Re: TabBar

Postby triplus » Sun Jan 03, 2016 6:23 pm

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.