Skip to content

Commit

Permalink
wxGUI/main_window: fix rendering Layers pane map display toolbar widg…
Browse files Browse the repository at this point in the history
…et (#3262)

On the wxMac.
  • Loading branch information
tmszi committed Nov 27, 2023
1 parent ef229b7 commit 5a50ab0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions gui/wxpython/main_window/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,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()
Expand Down Expand Up @@ -338,6 +343,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"""
Expand Down Expand Up @@ -480,6 +486,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

Expand Down Expand Up @@ -955,6 +963,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)
Expand Down

0 comments on commit 5a50ab0

Please sign in to comment.