Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: maximize volume viewer when starting navigation #864

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions invesalius/gui/default_viewers.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,18 +158,32 @@ def __bind_events_wx(self):
self.aui_manager.Bind(wx.aui.EVT_AUI_PANE_RESTORE, self.OnRestore)

def __bind_events(self):
Publisher.subscribe(self.MaximizeViewerVolume, "Set target mode")
Publisher.subscribe(self.OnSetTargetMode, "Set target mode")
Publisher.subscribe(self.OnStartNavigation, "Start navigation")
Publisher.subscribe(self._Exit, "Exit")

def MaximizeViewerVolume(self, enabled=True):
def OnSetTargetMode(self, enabled=True):
if enabled:
self.aui_manager.MaximizePane(
self.aui_manager.GetAllPanes()[-1]
) # Viewer volume is the last pane
Publisher.sendMessage("Show raycasting widget")
self.MaximizeViewerVolume()
else:
self.aui_manager.RestoreMaximizedPane()
Publisher.sendMessage("Hide raycasting widget")
self.RestoreViewerVolume()

def OnStartNavigation(self):
self.MaximizeViewerVolume()

def RestoreViewerVolume(self):
self.aui_manager.RestoreMaximizedPane()
Publisher.sendMessage("Hide raycasting widget")
self.aui_manager.Update()

def MaximizeViewerVolume(self):
# Restore volume viewer to make sure it is not already maximized before attempting to maximize it
# to fix the issue with panes locking into the maximized state where they cannot be restored
self.RestoreViewerVolume()
self.aui_manager.MaximizePane(
self.aui_manager.GetAllPanes()[-1]
) # Viewer volume is the last pane
Publisher.sendMessage("Show raycasting widget")
self.aui_manager.Update()

def OnMaximize(self, evt):
Expand Down
Loading