mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 02:07:51 -06:00
Always deactivate the tool when the selection is cleared
This commit is contained in:
parent
f4ea538615
commit
0f65cf3cf1
1 changed files with 2 additions and 2 deletions
|
@ -110,13 +110,13 @@ class PrinterApplication(QtApplication):
|
||||||
engine.rootContext().setContextProperty('Printer', self)
|
engine.rootContext().setContextProperty('Printer', self)
|
||||||
|
|
||||||
def onSelectionChanged(self):
|
def onSelectionChanged(self):
|
||||||
if Selection.getCount() > 0:
|
if Selection.hasSelection():
|
||||||
if not self.getController().getActiveTool():
|
if not self.getController().getActiveTool():
|
||||||
self.getController().setActiveTool('TranslateTool')
|
self.getController().setActiveTool('TranslateTool')
|
||||||
|
|
||||||
self.getController().getTool('CameraTool').setOrigin(Selection.getSelectedObject(0).getGlobalPosition())
|
self.getController().getTool('CameraTool').setOrigin(Selection.getSelectedObject(0).getGlobalPosition())
|
||||||
else:
|
else:
|
||||||
if self.getController().getActiveTool() and self.getController().getActiveTool().getName() == 'TranslateTool':
|
if self.getController().getActiveTool():
|
||||||
self.getController().setActiveTool(None)
|
self.getController().setActiveTool(None)
|
||||||
|
|
||||||
@pyqtSlot(QUrl)
|
@pyqtSlot(QUrl)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue