From a4aa9962d8de4761191528d268194f8ff925990b Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauld.mccarthy@gmail.com> Date: Fri, 13 Nov 2015 17:32:42 +0000 Subject: [PATCH] Fixed FSLEyesFrame allowing panels to be removed from centre pane (I think). Also fixed that persistent VolumeOpts.__toggleListeners error - DisplayOpts.destroy was not calling syncable.detachFromParent, so dangling references in DisplayOpts peers lists were being left. --- fsl/fsleyes/displaycontext/display.py | 2 ++ fsl/fsleyes/displaycontext/displaycontext.py | 2 ++ fsl/fsleyes/frame.py | 8 ++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fsl/fsleyes/displaycontext/display.py b/fsl/fsleyes/displaycontext/display.py index 4041d2473..cd21c9708 100644 --- a/fsl/fsleyes/displaycontext/display.py +++ b/fsl/fsleyes/displaycontext/display.py @@ -436,6 +436,8 @@ class DisplayOpts(actions.ActionProvider): """ actions.ActionProvider.destroy(self) + self.detachFromParent() + self.overlay = None self.display = None self.overlayList = None diff --git a/fsl/fsleyes/displaycontext/displaycontext.py b/fsl/fsleyes/displaycontext/displaycontext.py index 2d592eae9..d9914af10 100644 --- a/fsl/fsleyes/displaycontext/displaycontext.py +++ b/fsl/fsleyes/displaycontext/displaycontext.py @@ -246,6 +246,8 @@ class DisplayContext(props.SyncableHasProperties): instances managed by it are destroyed as well. """ + self.detachFromParent() + self.__overlayList.removeListener('overlays', self.__name) for overlay, display in self.__displays.items(): diff --git a/fsl/fsleyes/frame.py b/fsl/fsleyes/frame.py index 5c1f8d63a..4f51e483f 100644 --- a/fsl/fsleyes/frame.py +++ b/fsl/fsleyes/frame.py @@ -186,8 +186,8 @@ class FSLEyesFrame(wx.Frame): paneInfo = (aui.AuiPaneInfo() .Name(title) .Caption(title) - .Dockable() .CloseButton() + .Dockable() .Resizable() .DestroyOnClose()) @@ -199,7 +199,7 @@ class FSLEyesFrame(wx.Frame): # So if we only have one panel, we # hide the caption bar if panelId == 1: - paneInfo.Centre().CaptionVisible(False) + paneInfo.Centre().Dockable(False).CaptionVisible(False) # But then re-show it when another # panel is added. The __viewPanels @@ -330,9 +330,9 @@ class FSLEyesFrame(wx.Frame): numPanels = len(self.__viewPanels) wasCentre = paneInfo.dock_direction_get() == aui.AUI_DOCK_CENTRE - if numPanels == 1 or (numPanels > 0 and wasCentre): + if numPanels >= 1 and wasCentre: paneInfo = self.__viewPanels.keys()[0] - paneInfo.Centre().CaptionVisible(False) + paneInfo.Centre().Dockable(False).CaptionVisible(numPanels > 1) def __onClose(self, ev): -- GitLab