Pie Menu

Need help, or want to share a macro? Post here!
pablogil
Posts: 794
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Pie Menu

Postby pablogil » Mon Jul 11, 2016 8:52 am

Anyone knows how to use "context"? I don't even know what is used for...

Thanks
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
efyx
Posts: 280
Joined: Fri Sep 26, 2014 7:36 pm

Re: Pie Menu

Postby efyx » Mon Jul 11, 2016 11:40 am

I have already checked Pie Menu and I have two questions:
1) shouldn't icons changed depending on which module I am?
2) isn't that a good idea to "close" Pie Menu also by clicking anywhere?
pablogil
Posts: 794
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Pie Menu

Postby pablogil » Mon Jul 11, 2016 12:17 pm

efyx wrote:I have already checked Pie Menu and I have two questions:
1) shouldn't icons changed depending on which module I am?
2) isn't that a good idea to "close" Pie Menu also by clicking anywhere?
It's just the first release, don't panic =)

1) for now it just works for one pie at a time: it's not possible to bind other keys nor it changes depending on which workbench you are
2) if you press again TAB it will close. It will also close if you click the center "X" button
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
triplus
Posts: 8839
Joined: Mon Dec 12, 2011 4:45 pm

Re: Pie Menu

Postby triplus » Mon Jul 11, 2016 3:46 pm

First of all thanks to all that expressed interest to test and use PieMenu and provided feedback. As for the questions:
flokart wrote:Unfortunatly the little arow to get acces to the edit features are not showing.
I will keep this in mind and if i will find suitable solution i will try to make close PieMenu and show QuickMenu operation more distinct and intuitive to use in the future.
flokart wrote:Is there a option to add new additional buttons(shortcut keys) for new created pies ?
Not yet. Currently you can change/set active PieMenu only by selecting it from QuickMenu.
pablogil wrote:I'm trying it out on OSX and it doesn't overlay the 3D View:

...

I guess is something related to how FreeCAD renders on OSX cause it happens the same when expanding a toolbar "show more" button:
I researched this a bit and if i remember correctly there is similar issue in drawing workbench? Currently QGLWidget is used to display "3D View" and after FreeCAD will gain Qt5 support things could improve. That is if transition from QGLWidget to QOpenGLWidget will be made. Once and if this happens i guess there is a good chance issues observed on macOS could be resolved. PieMenu buttons could probably use round corners as transparency wouldn't be a problem anymore... Anyway that i guess is distant future.

As for the PieMenu the only solution i can think of that might work on macOS:

Image

Is to try to use active MDI SubWindow area as bounding area on macOS for now. Out of interest try out this code snippet:

Code: Select all

from PySide import QtGui ,QtCore
app = QtGui.qApp
app.setAttribute(QtCore.Qt.AA_DontCreateNativeWidgetSiblings, True)
After close all documents (don't close FreeCAD) and create a few new ones. Do you notice anything behaving differently?
pablogil wrote:Anyone knows how to use "context"? I don't even know what is used for...
You can add context sensitivity to individual PieMenu by enabling the option in context tab. After you set condition for example:

Vertex >= 2
Edge == 0
Face == 0
Object == 0

When selection in 3D View will change and if the condition will be meet (2 or more vertexes selected) PieMenu will show.

Note: Global setting to enable or disable context sensitivity in QuickMenu must be enabled.
efyx wrote:I have already checked Pie Menu and I have two questions:
1) shouldn't icons changed depending on which module I am?
2) isn't that a good idea to "close" Pie Menu also by clicking anywhere?
In the future PieMenu selection management will improve. Some discussions were made in the past but nothing has been decided yet. Currently Tab key will show/hide PieMenu and pressing the center button will hide PieMenu as explained by @pablogil. As for adding the possibility to hide PieMenu by clicking anywhere i guess this could be evaluated in the future.
pablogil
Posts: 794
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Pie Menu

Postby pablogil » Tue Jul 12, 2016 6:57 am

Yes, I did also investigate it and I found the problem is that FreeCAD uses QT4 and while it doesn't move to QT5 these issues will persist.
Anyway, I found a way to use the pie:
  • pie radius = 70
  • icon size = 32
  • Trigger = hover
in macOS it doesn't show at all ever the 3D view but it works, that is, I'm able to launch it pressing TAB and move the mouse along the direction I want and when it hovers the button the command is run ;) So, the only things to have in mind are that you might have to create pies with 8 buttons max (so that you can remember directions: N, NE, E, SE, S, SW, W, NW) and remember the position of each command.
I also have changed the global shortcut from TAB to Q because when editing parameters and such I often press TAB button to swap to next one it it's more comfortable for me to launch it with Q.
By the way, I have created my first real pie and I'm using it with a really, really workflow speedup... pies are awesome!

Obviously they have to improve and I have lot's of comments but I'll wait eagerly for:
  • option to bind a pie to a custom keyboard stroke (so that multiple pies are available)
  • option to "bind" a pie to a workbench, similar to context (so that you can bind two pies to the same keyboard stroke but it only opens one depending on the active workbench)
Cheers!
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
triplus
Posts: 8839
Joined: Mon Dec 12, 2011 4:45 pm

Re: Pie Menu

Postby triplus » Tue Jul 12, 2016 9:18 am

As for adding the possibility to hide PieMenu by clicking anywhere i guess this could be evaluated in the future.
I evaluated this and for now i won't implement it. I feel both keyboard key combination and mouse click use case are supported. Introducing another way to hide PieMenu could interfere with Context sensitivity or could make implementing features in the future harder.
pablogil wrote:Yes, I did also investigate it and I found the problem is that FreeCAD uses QT4 and while it doesn't move to QT5 these issues will persist.
Based on my research it won’t be as simple as that. Qt5 by itself wont resolve the mentioned issues. Only after migration to QOpenGLWidget or some other approach will be used we can expect the mentioned issues to be resolved.
Anyway, I found a way to use the pie:
  • pie radius = 70
  • icon size = 32
  • Trigger = hover
in macOS it doesn't show at all ever the 3D view but it works, that is, I'm able to launch it pressing TAB and move the mouse along the direction I want and when it hovers the button the command is run ;)
Over the weekend i will likely have more time and i will add the needed changes to alter behaviour on macOS. That should improve the situation.

As for default shortcut key this can change in the future. As for PieMenu selection management it will take a while to get there. I will evaluate all opinions and ideas once i start working or it (or if somebody else wants to tackle it go ahead).
triplus
Posts: 8839
Joined: Mon Dec 12, 2011 4:45 pm

Re: Pie Menu

Postby triplus » Tue Jul 12, 2016 12:00 pm

@pablogil

Start FreeCAD on macOS and open new document. After run this code snippet and don't forget to press enter after last line:

Code: Select all

from PySide import QtGui

btn0 = QtGui.QToolButton()
btn0.setGeometry(0, 0, 48, 48)
btn1 = QtGui.QToolButton()
btn1.setGeometry(52, 0, 48, 48)

mw = FreeCADGui.getMainWindow()
mdi = mw.findChild(QtGui.QMdiArea)
sw = mdi.currentSubWindow().widget()


btn0.setParent(mdi)
btn1.setParent(sw)
btn0.show()
btn1.show()
Do you see one or two or no buttons on the screen?
pablogil
Posts: 794
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Pie Menu

Postby pablogil » Tue Jul 12, 2016 12:39 pm

triplus wrote:@pablogil

Do you see one or two or no buttons on the screen?
No buttons... :cry:
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here
triplus
Posts: 8839
Joined: Mon Dec 12, 2011 4:45 pm

Re: Pie Menu

Postby triplus » Tue Jul 12, 2016 4:49 pm

I see. Therefore i don't yet know how i will approach this. The main problem is i don't have access to macOS to test things out.

Will try to think of something in the following days.
pablogil
Posts: 794
Joined: Wed Nov 26, 2014 3:19 pm
Location: Badajoz (Spain)
Contact:

Re: Pie Menu

Postby pablogil » Tue Jul 12, 2016 5:19 pm

triplus wrote:I see. Therefore i don't yet know how i will approach this. The main problem is i don't have access to macOS to test things out.

Will try to think of something in the following days.
From our researches, I think the problem is almost unreachable from our side. I mean, it should be solved at FreeCAD rendering system level and probably we cannot access that...

Anyway, as I told you, even without seeing the buttons themselves they are usable on macOS so I would suggest you to focus your efforts on improving Pie Menu globally and let others solve this viewing glitches...
What do you think?

Thank you
Dark and Light stylesheets v2.0 to theme your FreeCAD UI, more information here