Skip to content

Commit

Permalink
Merge pull request #2494 from jmoraleda/agw-aui-preserve-icons-on-loa…
Browse files Browse the repository at this point in the history
…d-perspective

Preserve pane icons when loading a perspective in agw.aui
  • Loading branch information
swt2c committed Dec 8, 2023
2 parents 17aa9c9 + 8a705cd commit 87674de
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions wx/lib/agw/aui/framemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -5223,6 +5223,7 @@ def LoadPerspective(self, layout, update=True, restorecaption=False):

# mark all panes currently managed as docked and hidden
saveCapt = {} # see restorecaption param
saveIcon = {} # icons are not preserved by perspectives, so preserve them
for pane in self._panes:

# dock the notebook pages
Expand All @@ -5237,6 +5238,7 @@ def LoadPerspective(self, layout, update=True, restorecaption=False):

pane.Dock().Hide()
saveCapt[pane.name] = pane.caption
saveIcon[pane.name] = pane.icon

# clear out the dock array; this will be reconstructed
self._docks = []
Expand Down Expand Up @@ -5294,6 +5296,9 @@ def LoadPerspective(self, layout, update=True, restorecaption=False):
if restorecaption:
if pane.name in saveCapt:
pane.Caption(saveCapt[pane.name])
# restore icons from code. This is always done. Since icons are not saved in perspectives
if pane.name in saveIcon:
pane.icon = saveIcon[pane.name]

if not p.IsOk():
if pane.IsNotebookControl():
Expand Down

0 comments on commit 87674de

Please sign in to comment.