- modified the way the FlatCAM Tools are run from toolbar as opposed of running them from other sources

- some Gerber UI changes
This commit is contained in:
Marius Stanciu
2019-03-06 15:22:35 +02:00
committed by Marius
parent 996b63cf4e
commit b20a6a1a85
15 changed files with 146 additions and 122 deletions

View File

@@ -48,22 +48,23 @@ class Properties(FlatCAMTool):
self.vlay.addWidget(self.treeWidget)
self.vlay.setStretch(0,0)
def run(self):
def run(self, toggle=False):
self.app.report_usage("ToolProperties()")
if self.app.tool_tab_locked is True:
return
self.set_tool_ui()
# 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
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
FlatCAMTool.run(self)
self.properties()