From f7a7d4ed6175f3715711896d3bc6a2c7fabd9b33 Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Mon, 24 Mar 2025 20:53:39 +0100 Subject: [PATCH 1/2] Draft: Update checked state of grid button when switching the grid The checked state of the grid button was not updated when the grid was only displayed during Draft commands. --- src/Mod/Draft/draftguitools/gui_trackers.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Mod/Draft/draftguitools/gui_trackers.py b/src/Mod/Draft/draftguitools/gui_trackers.py index 1ce39fd681..35341b9c8f 100644 --- a/src/Mod/Draft/draftguitools/gui_trackers.py +++ b/src/Mod/Draft/draftguitools/gui_trackers.py @@ -43,6 +43,7 @@ import FreeCADGui import Draft import DraftVecUtils from FreeCAD import Vector +from draftutils import grid_observer from draftutils import gui_utils from draftutils import params from draftutils import utils @@ -1350,6 +1351,16 @@ class gridTracker(Tracker): self.setAxesColor(wp) self.on() + def on(self): + """Set the visibility to True and update the checked state grid button.""" + super().on() + grid_observer._update_grid_gui() + + def off(self): + """Set the visibility to False and update the checked state grid button.""" + super().off() + grid_observer._update_grid_gui() + def getClosestNode(self, point): """Return the closest node from the given point.""" wp = self._get_wp() From 5ba1c2c9b4ad15098624dd2af3776fb114b9d11b Mon Sep 17 00:00:00 2001 From: Roy-043 Date: Mon, 24 Mar 2025 20:58:31 +0100 Subject: [PATCH 2/2] Typo in docstrings --- src/Mod/Draft/draftguitools/gui_trackers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Draft/draftguitools/gui_trackers.py b/src/Mod/Draft/draftguitools/gui_trackers.py index 35341b9c8f..1c067781f6 100644 --- a/src/Mod/Draft/draftguitools/gui_trackers.py +++ b/src/Mod/Draft/draftguitools/gui_trackers.py @@ -1352,12 +1352,12 @@ class gridTracker(Tracker): self.on() def on(self): - """Set the visibility to True and update the checked state grid button.""" + """Set the visibility to True and update the checked state of the grid button.""" super().on() grid_observer._update_grid_gui() def off(self): - """Set the visibility to False and update the checked state grid button.""" + """Set the visibility to False and update the checked state of the grid button.""" super().off() grid_observer._update_grid_gui()