mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Remember the previuos active tool on selection change
This prevents issues where activating a tool before selecting something would change to the translate tool. Fixes #53
This commit is contained in:
parent
3c5096cebc
commit
e795aaa45a
1 changed files with 9 additions and 1 deletions
|
|
@ -68,6 +68,7 @@ class CuraApplication(QtApplication):
|
|||
self._output_devices = {}
|
||||
self._print_information = None
|
||||
self._i18n_catalog = None
|
||||
self._previous_active_tool = None
|
||||
|
||||
self.activeMachineChanged.connect(self._onActiveMachineChanged)
|
||||
|
||||
|
|
@ -191,6 +192,10 @@ class CuraApplication(QtApplication):
|
|||
def onSelectionChanged(self):
|
||||
if Selection.hasSelection():
|
||||
if not self.getController().getActiveTool():
|
||||
if self._previous_active_tool:
|
||||
self.getController().setActiveTool(self._previous_active_tool)
|
||||
self._previous_active_tool = None
|
||||
else:
|
||||
self.getController().setActiveTool("TranslateTool")
|
||||
|
||||
self._camera_animation.setStart(self.getController().getTool("CameraTool").getOrigin())
|
||||
|
|
@ -198,7 +203,10 @@ class CuraApplication(QtApplication):
|
|||
self._camera_animation.start()
|
||||
else:
|
||||
if self.getController().getActiveTool():
|
||||
self._previous_active_tool = self.getController().getActiveTool().getPluginId()
|
||||
self.getController().setActiveTool(None)
|
||||
else:
|
||||
self._previous_active_tool = None
|
||||
|
||||
requestAddPrinter = pyqtSignal()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue