- If you have an open document and switch to the Draft Workbench the grid is displayed (if the "Always show the grid" preference is checked), but not aligned with the working plane.
- If the Draft Workbench is active and you open a new document, or a new 3D view, the grid is not automatically displayed.
- In such a case two clicks on the Draft_ToggleGrid button are required to switch the grid on.
- When switching to a different workbench the grid remains visible which typically confuses novice FreeCAD users.
- When changing the grid via the Draft_SelectPlane command the grid is not switched on automatically.
- DraftWorkingPlane.setup() is called where appropriate so that the working plane is correct before calling grid.set().
- A 'view observer' is introduced to monitor the creation of new 3D views and the activation of existing 3D views. See: https://forum.freecadweb.org/viewtopic. ... 10#p566416. Via this 'observer' a grid is added to views that do not have one.
- The grid attached to a view stores its own always_show property. The initial value of this property is based on the "Always show the grid" preference. Draft_ToggleGrid changes this property for the current view only.
- When switching to a different workbench all grids are hidden. When switching back to the Draft Workbench, grids that were previously displayed are shown again. Views that were created while another workbench was active are handled by the 'view observer'.
- If the properties of the grid are changed with the Draft_SelectPlane command the grid is switched on.
IMO we should consider removing the "Use grid" preference.
The attached ZIP contains the following file:
gui_edit.py
gui_grid.py
gui_snapper.py
gui_trackers.py
gui_utils.py
The gui_utils.py file goes in Mod/Draft/draftutils/ all other files go in Mod/Draft/draftguitools/.
For reference the Org folder in the ZIP contains the original files.