Menu System Enhancement

A forum for research and development of the user interface of FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Menu System Enhancement

Post by realthunder »

New image released with some further improvement on 'Pick geometry' and hierarchy menu.

You can now bring up hierarchy menu within 'Pick geometry' sub menu, by simply use right click, or use 'Shift + Right click' to bring object menu, or 'Shift + Left click' to edit the object.

Hierarchy menu can now expand children on document item, as well as document context menu just like ordinary object item.

I have also add the 'Std_TreeDrag' command to hierarchy menu. This is a command that I added quite a while back, but not many know this. You'll find it very useful once you get the hang of it, especially with asm3 workbench where there are a lot of operations are done by drag and drop. It allows to activate drag and drop without holding your mouse button.

The biggest problem with normal tree view item drag and drop is that you have to find the dragging object first, hold the button, and then moves the cursor to find the target item before dropping. With complex hierarchy, it becomes increasing difficult to find the target item without using mouse button. 'Std_TreeDrag' works like this. You select the dragging object first, find the target item, and then activate drag and drop using keyboard shortcut, 'T, D'. The key difference with normal drag and drop is that you find the target item first (which is easy with your mouse free), and then activate drag and drop.

With my latest release, 'Std_TreeDrag' works on hierarchy menu as well. I would say that the hierarchy menu can now do everything the tree view can. The screencast below shows how to use it. It also shows that Std_TreeDrag can be used to drag and drop between hierarchy menu and tree view.
tree-drag.gif
tree-drag.gif (435.64 KiB) Viewed 3481 times

OficineRobotica wrote: Sun Jul 19, 2020 9:18 am The pick geometry menu will pop up just under the mouse blocking allot of times the view of the geometry. It would be nice if initially the voices [Edge][Face][Shell][Solid][Wire] would pop up in the form of a pie thus clearing the view centered around the mouse. Also, the 5 voices should always be present. Edge and wire are not present if the mouse is not dead center over a edge.
That's a good idea. Pie menu is not really suitable for dynamic contents, such as the hierarchy menu, but it is a nice fit here for the initial geometry picking. I'll add that in the future.
In the screenshot below I would like to have an extra menu step after (example) [Face] with the name of the genitor body of the feature. In this example it would be nice to have the menu like [Face]->[UsbPort003]->[Chamfer002(Face3)] . Or better off replace the feature name with the name of the containing body like [Face]->[UsbPort003(Face3)].
That's not going to work, because the hierarchy menu is in the core, so it does not really know the special relationship between body and its children. Furthermore, I plan to add extra hierarchy inside body in the future. With my latest release, you can simply right click the geometry sub menu to get a better view of the hierarchy.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
paullee
Veteran
Posts: 5118
Joined: Wed May 04, 2016 3:58 pm

Re: Menu System Enhancement

Post by paullee »

Looks great !
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Menu System Enhancement

Post by realthunder »

New image released with support of Pie Menu.

By default 'Pick geometry', 'Command history', and user defined menus will be using the new pie menu style. Use mouse wheel to scroll if there are more than 8 items in the menu. The wheel scrolls in steps of 8, because I think it is easier to remember menu items by their position, and scrolls in step of 8 gives fixed item position. To scroll single items, use CTRL+Wheel, or just drag your mouse. The menu offset will be remembered. So the next time you bring up the the menu you'll see the offset.

You can opt to use traditional style menu by simply right click. Once you activated any item in traditional style, your choice will be remembered, and the next time you bring up the menu it will be in traditional style. To see pie menu again, simply select the 'Show pie menu' item in the menu.

You don't have to move your mouse all the way to the button to click. Just move to the corresponding direction, and once you see the blue highlight indicator, you can click to activate the item. For items with sub-menu, move to the range will automatically show the sub menu. You can configure the hover trigger radius. You can opt to activate non-sub-menu item by hovering. More customizations are available in the preference dialog
Screenshot from 2020-07-25 13-42-04.png
Screenshot from 2020-07-25 13-42-04.png (44.07 KiB) Viewed 3312 times

phpBB [video]
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
OficineRobotica
Posts: 433
Joined: Thu Feb 21, 2019 8:17 am
Contact:

Re: Menu System Enhancement

Post by OficineRobotica »

I never fired up the AppImage update tool so fast. That is so utterly cool visually and workflow wise. Thank you.
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
User avatar
pablogil
Posts: 882
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Menu System Enhancement

Post by pablogil »

WOW!!
Really impressed, I love the pie menu...

Will you eventually make the “toolbar menus” work with individual workbenches? That would be superhandy as you can assign the same key for some pies that correspond to different workbenches and view only the active one.

I haven’t tried yet but I would say that now you have added the menu and pie to the default “toolbar” I would suggest to include an option inside the editor to let the user easily set it to “toolbar, menu or pie”.

Thanks!!
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
User avatar
pablogil
Posts: 882
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Menu System Enhancement

Post by pablogil »

Hi again,

As expected the pie menus work like a charm :)

Some improvements:
  • The ones described in my previous post ;)
  • the fade out animation is great, it would be nice to have an option to set a fade in animation too
  • are the pies (and the "arrow" icon) somehow stylabe via stylesheets?
Thanks!
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Menu System Enhancement

Post by carlopav »

realthunder wrote: Sat Jul 25, 2020 5:56 am By default 'Pick geometry', 'Command history', and user defined menus will be using the new pie menu style. Use mouse wheel to scroll if there are more than 8 items in the menu. The wheel scrolls in steps of 8, because I think it is easier to remember menu items by their position, and scrolls in step of 8 gives fixed item position. To scroll single items, use CTRL+Wheel, or just drag your mouse. The menu offset will be remembered. So the next time you bring up the the menu you'll see the offset.
Wow, the "GG" pick subshape is just amazing. Expecially because it allows to precisely select the subshape with getSelectionEx.
This could be combined with https://github.com/FreeCAD/FreeCAD/pull/3716 to allow easy subshape modifications on the fly with draft subelement move! looking forward to experiment a bit with it.
follow my experiments on BIM modelling for architecture design
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Menu System Enhancement

Post by realthunder »

New image released.

Improved command (i.e. menu actions) loading, so that it can auto initialize the belonging workbench without activate it. For example, all Path workbench command used to be only available when you first activate the workbench. This can be done automatically now.

As suggested by pablogil, allow user defined workbench context menu, so that you can overload menu shortcut for different workbenches. You can either use 'Customize -> Toolbar' to do that, or use 'R, R' to bring up Std_CmdHistory and hold 'SHIFT' key before pressing 'Add toolbar or menu'.
Screenshot from 2020-07-29 21-15-41.png
Screenshot from 2020-07-29 21-15-41.png (23.77 KiB) Viewed 3013 times

Rename Pie Menu preference page to 'UI' with more options,
Screenshot from 2020-07-29 21-16-59.png
Screenshot from 2020-07-29 21-16-59.png (71.76 KiB) Viewed 3013 times
pablogil wrote: Sun Jul 26, 2020 10:20 pm I haven’t tried yet but I would say that now you have added the menu and pie to the default “toolbar” I would suggest to include an option inside the editor to let the user easily set it to “toolbar, menu or pie”.
Missed this. For now, you can switch between menu or pie with right click when pie menu is shown. Toolbar visibility can already be set independently with menu.

pablogil wrote: Tue Jul 28, 2020 3:25 pm the fade out animation is great, it would be nice to have an option to set a fade in animation too
In fact, I didn't add any fade out animation. It seems to be built-in for Popup style widget in Qt, which probably is also OS dependent. So I decide to not mess around with this to avoid conflict.

are the pies (and the "arrow" icon) somehow stylabe via stylesheets?
Not at the moment. Will probably add that in the future.
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
realthunder
Veteran
Posts: 2190
Joined: Tue Jan 03, 2017 10:55 am

Re: Menu System Enhancement

Post by realthunder »

New image released.

Pie menu enable/disable is now configurable through toolbar customize dialog.

Exposed draw style as individual command. It will appear in recent command list, or simply type keyword to search in toolbar customize. Also expose commands for each workbench, group under the name 'workbench'.

Screenshot from 2020-08-11 21-02-14.png
Screenshot from 2020-08-11 21-02-14.png (36.71 KiB) Viewed 2899 times
Try Assembly3 with my custom build of FreeCAD at here.
And if you'd like to show your support, you can donate through patreon, liberapay, or paypal
User avatar
OficineRobotica
Posts: 433
Joined: Thu Feb 21, 2019 8:17 am
Contact:

Re: Menu System Enhancement

Post by OficineRobotica »

I made a small video to show how much I like the pies :D
phpBB [video]
Check out my Youtube channel at: https://www.youtube.com/@OficineRobotica
Post Reply