- reverted changes in Tools regarding the toggle effect - now they work as expected

This commit is contained in:
Marius Stanciu
2019-03-11 22:58:27 +02:00
parent 255254a292
commit 090a3ff8f8
13 changed files with 95 additions and 26 deletions

View File

@@ -71,9 +71,9 @@ class FlatCAMTool(QtWidgets.QWidget):
if separator is True:
pos.addSeparator()
self.menuAction.triggered.connect(lambda: self.run(toggle=True))
self.menuAction.triggered.connect(self.run)
def run(self, toggle=True):
def run(self):
if self.app.tool_tab_locked is True:
return
@@ -86,17 +86,6 @@ class FlatCAMTool(QtWidgets.QWidget):
# Switch notebook to tool page
self.app.ui.notebook.setCurrentWidget(self.app.ui.tool_tab)
if toggle:
# if the splitter is hidden, display it, else hide it but only if the current widget is the same
if self.app.ui.splitter.sizes()[0] == 0:
self.app.ui.splitter.setSizes([1, 1])
else:
try:
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
self.app.ui.splitter.setSizes([0, 1])
except AttributeError:
pass
# Set the tool name as the widget object name
self.app.ui.tool_scroll_area.widget().setObjectName(self.toolName)