Sketcher: Rewrite grid command

==============================

Fix unresolved issues:
https://github.com/FreeCAD/FreeCAD/pull/7754/files#r1025493443
https://github.com/FreeCAD/FreeCAD/pull/7754/files#r1019077589
https://github.com/FreeCAD/FreeCAD/pull/7754/files#r1025502204

Summary:
- EventFilter unnecessary in light of new implemented signal aboutToshow. The data of the drop-down action is updated only when necessary (when it is going to be shown).
- Structure of individual commands under drop-down simplified to a single action, rendering the need for groupcommands obsolete, while keeping all the grid related controls and
the logic for controlling the grid in a single action class.
- Reduce the complexity and overload of isActive to the bare minimum (determining if it is active and updating the icon to the right icon if so).

Refactor:
- Better name for utils functions, as when a DSH is active, the edit mode VPSketch is a data member of DSH, sketchgui (so this function is not really necessary when the DSH is active).
This commit is contained in:
Abdullah Tahiri
2023-02-09 14:22:25 +01:00
committed by abdullahtahiriyo
parent 5244e28565
commit 5a0e7d4ee3
4 changed files with 166 additions and 143 deletions

View File

@@ -188,7 +188,7 @@ inline void SketcherAddWorkbenchSketchEditModeActions(Gui::ToolBarItem& sketch)
sketch << "Sketcher_LeaveSketch"
<< "Sketcher_ViewSketch"
<< "Sketcher_ViewSection"
<< "Sketcher_CompGrid";
<< "Sketcher_Grid";
}
template <typename T>