Pie Menu

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

Re: Pie Menu

Postby triplus » Fri Jul 29, 2016 2:02 am

OK i think i figured it out. Module developer and custom user PieMenus should be separated. Therefore user will be able to do the same with PieMenus as it can be done now. As for the module developer and module specific default set of PieMenus. User will have no control over them and likely they will get overwritten at each module start to reflect potential changes and updates made by the module developer. Something like this will be used (done by module developer in InitGui.py):

Code: Select all

paramGet = App.ParamGet("User parameter:BaseApp/PieMenu")

# FreeCADGui.activeWorkbench().MenuText
active = MenuText

paramGet.RemGroup(active)
group = paramGet.GetGroup(active)

# PieMenu data ...

This will therefore be the place only the module developer will write the data. Indexes can be added manually and everything can be hard-coded. PieMenu if running will pick it up. There i guess will be the possibility for the user to turn default set of PieMenus to Off/On.
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Pie Menu

Postby microelly2 » Fri Jul 29, 2016 12:27 pm

@triplus

yes, this sounds good.
i think there should be a python api for developers which wrapps the logic of storing piemenu configuration into the user configruation BasApp/Piemenu subtree.
this api also can control name conflicts.

The context switch is exactly the functionality I looked for. Great.
User avatar
pablogil
Posts: 845
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Pie Menu

Postby pablogil » Fri Jul 29, 2016 1:45 pm

Yes, I also agree that's probably the best approach
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Pie Menu

Postby triplus » Fri Jul 29, 2016 9:49 pm

The context switch is exactly the functionality I looked for. Great.
I had a hard time to believe Context sensitivity would represent such a struggle to grasp by the PieMenu users. Based on the feedback i feel that indeed general Context switch found in QuickMenu probably has something to do with it. Therefore in the future removing it or enabling by default will be the first step when trying to improve the current situation. If anybody wants to make a pull request fixing this go ahead (but it likely won't be merged in the next week).

Anyway it will be an interesting task to sort out the user interface in the next development phase. As developers adding unmodifiable PieMenus to their modules will add another layer of complexity users will need to understand. I guess we will manage somehow. ;)

Therefore as for your suggestions/prototypes:
  • Configurable shortcut for PieMenu
  • Ability for the module developer to add and configure PieMenus
This will likely be part of the next development phase.

Button supporting up to 3 commands (hover, trigger, leave) likely won't be part of the next development phase. For now i feel one tool button equals one command makes the most sense.

Adding support for Macro_WorkFeatures isn't planed. Macro_WorkFeatures would need to add support for PieMenu instead. That is move the commands to have underlying QActions associated with them.

But feel free to explore this areas further. As for the general list of planed features for the next development phase i will try to finish one this weekend.
User avatar
microelly2
Posts: 4690
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: Pie Menu

Postby microelly2 » Sat Jul 30, 2016 10:04 am

triplus wrote:
  • Configurable shortcut for PieMenu
I made it simple this way

Code: Select all

        actionKey = QtGui.QAction(mw)
        actionKey.setObjectName("PieMenuShortCut")

        paramGet = App.ParamGet("User parameter:BaseApp/PieMenu")
        key = paramGet.GetString("KeySequence","TAB")

        actionKey.setShortcut(QtGui.QKeySequence(key))
[*]Ability for the module developer to add and configure PieMenus[/list]
+
Button supporting up to 3 commands (hover, trigger, leave) likely won't be part of the next development phase. For now i feel one tool button equals one command makes the most sense.
Yes, it's a complex behaviour and need not be supported by default. I will follow for my nurbs editor this way .
And when it is finshed we can see whether is is reusable somewhere else.
Adding support for Macro_WorkFeatures isn't planed. Macro_WorkFeatures would need to add support for PieMenu instead. .
Yes, I will make make some changes to workfeature macro that it supports the piemenu like the first steps in my video but using the context feature.
there is only some stupid diligence necessary to create all the actions and their contexts.
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Pie Menu

Postby triplus » Sat Jul 30, 2016 11:48 am

microelly2 wrote:I made it simple this way
This is the way i would do it. Best to make pull request and once i start development process again it can be reviewed, tested and merged. As there will be GUI counterpart i feel that behaviour based on input character (set) will need to be think about.
Yes, I will make make some changes to workfeature macro that it supports the piemenu like the first steps in my video but using the context feature.
there is only some stupid diligence necessary to create all the actions and their contexts.
From currently planed PieMenu features point of view:

1.) Adding underlying QActions enables the PieMenu user to set PieMenus by using tools from Macro_WorkFeatures. Context sensitivity rules can be set. When the Macro is not running empty buttons will be the result.

2.) Point 1 + using the approach like TabBar would add additional WorkFeatures Panel when FreeCAD starts. Tools would likely always be available to PieMenu.

3.) Creating standard WorkFeatures workbench. This would enable all of the above + possibility for WorkFeatures workbench to define and configure default set of PieMenus related to WorkFeatures workbench.
User avatar
r-frank
Posts: 2181
Joined: Thu Jan 24, 2013 6:26 pm
Location: Möckmühl, Germany
Contact:

Re: Pie Menu

Postby r-frank » Sun Jul 31, 2016 1:15 pm

Hello.

I am mising a "Done" button in the preferences window.

At least on windows hitting the "x" in the corner of a popup menu says only "exit".
But we need to have a "save and exit" - way ...

Roland
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english

Native german speaker - so apologies for my english, no offense intended :)
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Pie Menu

Postby triplus » Sun Jul 31, 2016 1:23 pm

Technically it is not needed as changes are saved as they are made. If users would like to have something like that i guess additional "navigation bar" could be added (above or below) with Close button on it.
triplus
Posts: 9475
Joined: Mon Dec 12, 2011 4:45 pm

Re: Pie Menu

Postby triplus » Sun Jul 31, 2016 7:38 pm

PieMenu (v2.0) development plan:
  • Button placeholder (empty button)
  • Subsequential PieMenu button
  • Subsequential PieMenu button icon support
  • Subsequential PieMenu button color support
  • Style Subsequential PieMenu button to differentiate it
  • Tools from toolbar button with menu should be added to Subsequential PieMenu
  • Support for defining module related PieMenus by module developer
  • Try to make module related PieMenus configurable by the PieMenu user
  • Configurable PieMenu invoke key
  • Set sensible default PieMenu invoke key
  • Shortcut key support for tool buttons
  • Provide visual feedback when the tool button key is set
  • Hide PieMenu when pressing the invoke key if the PieMenu is already visible
  • PieMenu invoke key + additional custom key to invoke different PieMenu
  • Limit module related PieMenu shortcut key combinations to work only in appropriate workbench
  • Investigate support to invoke PieMenu by mouse
  • Enable global context switch by default
  • Improve QComboBox style in context tab
  • Change location of the context related settings when that makes sense
  • Ability to create workbench specific PieMenu context conditions
  • Solver to provide the feedback when conflicts between set conditions are detected
  • Evolve the default PieMenu style in small steps and based on sensible feedback and suggestions
  • Rethink control panel to accommodate to plethora of planed features
  • Add close button to preferences dialog
  • Improve default stylesheet support (ID Selectors)
  • Outset border color should better align with white background
  • More predictable QuickMenu and Close button icon on all platforms
  • Global PieMenu reset button
  • Proximity hover trigger mode
  • Possibility to define and change default PieMenu for each workbench
  • Configurable radius for toolbar based PieMenu
  • Configurable button size for toolbar based PieMenu
  • Basic documentation
User avatar
pablogil
Posts: 845
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Pie Menu

Postby pablogil » Mon Aug 01, 2016 10:17 pm

Wow, great list and so much work to do... cheers!

PieMenu 2 is going to rock :D
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here