From 2b8e50300d29fa2e107ca11e01ef4e17eb1cc2ff Mon Sep 17 00:00:00 2001 From: Tomas Zigo <50632337+tmszi@users.noreply.github.com> Date: Mon, 27 Nov 2023 16:27:29 +0100 Subject: [PATCH] wxGUI/main_window: fix rendering Layers pane map display toolbar widget (#3262) On the wxMac. --- gui/wxpython/main_window/frame.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gui/wxpython/main_window/frame.py b/gui/wxpython/main_window/frame.py index 09ec467a656..41a35d8352d 100644 --- a/gui/wxpython/main_window/frame.py +++ b/gui/wxpython/main_window/frame.py @@ -239,6 +239,11 @@ def show_menu_errors(messages): self._show_demo_map() + def _repaintLayersPaneMapDisplayToolbar(self): + """Repaint Layers pane map display toolbar widget on the wxMac""" + if sys.platform == "darwin": + wx.CallLater(100, self.notebookLayers.Refresh) + def _setTitle(self): """Set frame title""" gisenv = grass.gisenv() @@ -340,6 +345,7 @@ def _createDisplay(self, parent): # bindings self.notebookLayers.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CHANGED, self.OnCBPageChanged) self.notebookLayers.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CLOSING, self.OnCBPageClosing) + self.notebookLayers.Bind(FN.EVT_FLATNOTEBOOK_PAGE_CLOSED, self.OnCBPageClosed) def _createSearchModule(self, parent): """Initialize Search module widget""" @@ -482,6 +488,8 @@ def CreateNewMapDisplay(giface, layertree): cb_boxsizer.Fit(self.GetLayerTree()) self.currentPage.Layout() self.GetLayerTree().Layout() + # Repaint Layers pane map display toolbar widget on the wxMac + self._repaintLayersPaneMapDisplayToolbar() self.displayIndex += 1 @@ -956,6 +964,12 @@ def OnCBPageChanged(self, event): event.Skip() + def OnCBPageClosed(self, event): + """Page of notebook has been closed from the Layers pane via x + button or via closing map display notebook page""" + # Repaint Layers pane map display toolbar widget on the wxMac + self._repaintLayersPaneMapDisplayToolbar() + def OnCBPageClosing(self, event): """Page of notebook is being closed from Layer Manager (x button next to arrows)