Commit cbdb6f7d307c1e6798db82dcb40054b4961ebfad
1 parent
4511a871
Exists in
master
and in
1 other branch
Reset interactor style when closing project
Showing
3 changed files
with
12 additions
and
1 deletions
Show diff stats
invesalius/data/slice_.py
... | ... | @@ -302,6 +302,8 @@ class Slice(object): |
302 | 302 | self.hue_range = (0, 0) |
303 | 303 | self.value_range = (0, 1) |
304 | 304 | |
305 | + self.interaction_style.Reset() | |
306 | + | |
305 | 307 | Publisher.sendMessage('Select first item from slice menu') |
306 | 308 | |
307 | 309 | def __set_current_mask_threshold_limits(self, pubsub_evt): | ... | ... |
invesalius/data/viewer_volume.py
... | ... | @@ -355,7 +355,7 @@ class Viewer(wx.Panel): |
355 | 355 | def OnCloseProject(self, pubsub_evt): |
356 | 356 | if self.raycasting_volume: |
357 | 357 | self.raycasting_volume = False |
358 | - | |
358 | + | |
359 | 359 | if self.slice_plane: |
360 | 360 | self.slice_plane.Disable() |
361 | 361 | self.slice_plane.DeletePlanes() |
... | ... | @@ -365,6 +365,10 @@ class Viewer(wx.Panel): |
365 | 365 | self.on_wl = False |
366 | 366 | self.slice_plane = 0 |
367 | 367 | |
368 | + self.interaction_style.Reset() | |
369 | + self.SetInteractorStyle(const.STATE_DEFAULT) | |
370 | + self._last_state = const.STATE_DEFAULT | |
371 | + | |
368 | 372 | def OnHideText(self, pubsub_evt): |
369 | 373 | self.text.Hide() |
370 | 374 | self.interactor.Render() | ... | ... |
invesalius/style.py
... | ... | @@ -114,3 +114,8 @@ class StyleStateManager(object): |
114 | 114 | max_level = max(self.stack.keys()) |
115 | 115 | state = self.stack[max_level] |
116 | 116 | return state |
117 | + | |
118 | + def Reset(self): | |
119 | + self.stack = {} | |
120 | + self.stack[const.STYLE_LEVEL[const.STATE_DEFAULT]] = \ | |
121 | + const.STATE_DEFAULT | ... | ... |