Draft Snap toolbar persistence
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
Draft Snap toolbar persistence
I noticed this in the past as if i remember correctly Draft Snap toolbar showed up in Lattice WB. At that time i didn’t pay much attention to this but during my work on TabBar i noticed the following behaviour:
Draft WB -> Draft Snap toolbar disabled in View -> Toolbars menu. If i click on any tool on Draft creation tools Draft Snap toolbar is enabled automatically.
Question. Would any functionality be lost if Draft Snap toolbar would respect the setting in View -> Toolbars menu instead?
Draft WB -> Draft Snap toolbar disabled in View -> Toolbars menu. If i click on any tool on Draft creation tools Draft Snap toolbar is enabled automatically.
Question. Would any functionality be lost if Draft Snap toolbar would respect the setting in View -> Toolbars menu instead?
Re: Draft Snap toolbar persistence
No, you just could not modify the draft snaps...triplus wrote:Question. Would any functionality be lost if Draft Snap toolbar would respect the setting in View -> Toolbars menu instead?
Re: Draft Snap toolbar persistence
I looked in the Draft Settings and i see there actually is a setting that controls this behaviour. I unchecked the Show Draft Snap toolbar setting and set View -> Toolbars -> Draft Snap to off. After i could use the tool from Draft creation tools toolbar and Draft Snap toolbar was not enabled automatically anymore!yorik wrote:No, you just could not modify the draft snaps...triplus wrote:Question. Would any functionality be lost if Draft Snap toolbar would respect the setting in View -> Toolbars menu instead?
That is good news but there is one more issue involved. After i switch to another workbench and back Snap Draft toolbar is enabled again and it doesn't persist in off state. Therefore i guess this could count as a bug? I didn't investigate the code but probably the logic implemented to determine what toolbars belong to the workbench and the way you turn on/off the setting for the toolbar are in slight conflict. That is probably the reason i found Draft Snap toolbar in Lattice WB.
And there is one more question i have why isn't Utilities toolbar listed in View -> Toolbars. It looks like this was done intentionally?
Re: Draft Snap toolbar persistence
I think only toolbars added by the standard WB mechanism are there... Since this toolbar is a bit special (the buttons must stay presssed), I did it directly from pyside, so it doesn't appear there. I don't think it is possible ATM.triplus wrote:why isn't Utilities toolbar listed in View -> Toolbars. It looks like this was done intentionally?
Re: Draft Snap toolbar persistence
I see. Thanks for the insight. ATM i guess this isn't all that important but as i stumble on something i rather ask if it's not clear to me what is going on.yorik wrote:I think only toolbars added by the standard WB mechanism are there... Since this toolbar is a bit special (the buttons must stay presssed), I did it directly from pyside, so it doesn't appear there. I don't think it is possible ATM.triplus wrote:why isn't Utilities toolbar listed in View -> Toolbars. It looks like this was done intentionally?
As for putting the toolbar in toolbars menu i guess it might be possible as i guess 3rd Party module PCB has the same type of toolbars and they are listed in the toolbars menu. But it is true the setting doesn't persist for them when switching workbench.
Re: Draft Snap toolbar persistence
Hi Yorik.
This won't happen anytime soon but eventually i would like for snap toolbar commands to work with my modules. Are you OK with me looking into this and make the needed changes in Draft WB in the future?
P.S. If yes when i will have something i will consult with you first to see if you are OK with the changes made.
This won't happen anytime soon but eventually i would like for snap toolbar commands to work with my modules. Are you OK with me looking into this and make the needed changes in Draft WB in the future?
P.S. If yes when i will have something i will consult with you first to see if you are OK with the changes made.
Re: Draft Snap toolbar persistence
sure, go ahead...
Re: Draft Snap toolbar persistence
OK i started working on this and the first thing i did is i made commands from Draft Snap toolbar reusable:
I did explore different possibilities on how to create standard FreeCAD toolbar out of it. But some things are missing ATM and i came to a conclusion it isn't possible to achieve such goal in straightforward fashion. Therefore i just changed the current Draft Snap toolbar to allow commands from it to be reused. In addition i reset the toolbar/toolbutton size to default values:
The size change proposal is optional and it is not needed for command reuse purposes. Change can be reverted if decided current behaviour is more desirable.
https://github.com/FreeCAD/FreeCAD/pull/671
I did explore different possibilities on how to create standard FreeCAD toolbar out of it. But some things are missing ATM and i came to a conclusion it isn't possible to achieve such goal in straightforward fashion. Therefore i just changed the current Draft Snap toolbar to allow commands from it to be reused. In addition i reset the toolbar/toolbutton size to default values:
The size change proposal is optional and it is not needed for command reuse purposes. Change can be reverted if decided current behaviour is more desirable.
https://github.com/FreeCAD/FreeCAD/pull/671
Re: Draft Snap toolbar persistence
WhatsThis command should now work on Draft Snap toolbar commands:
https://github.com/FreeCAD/FreeCAD/pull/962
https://github.com/FreeCAD/FreeCAD/pull/962