- reverted changes in Tools regarding the toggle effect - now they work as expected
This commit is contained in:
@@ -235,11 +235,18 @@ class ToolCalculator(FlatCAMTool):
|
||||
|
||||
self.calculate_plate_button.clicked.connect(self.on_calculate_eplate)
|
||||
|
||||
|
||||
def run(self, toggle=True):
|
||||
self.app.report_usage("ToolCalculators()")
|
||||
|
||||
FlatCAMTool.run(self, toggle=toggle)
|
||||
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:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
|
||||
self.set_tool_ui()
|
||||
|
||||
|
||||
@@ -282,7 +282,15 @@ class CutOut(FlatCAMTool):
|
||||
def run(self, toggle=True):
|
||||
self.app.report_usage("ToolCutOut()")
|
||||
|
||||
FlatCAMTool.run(self, toggle=toggle)
|
||||
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:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
||||
self.app.ui.notebook.setTabText(2, "Cutout Tool")
|
||||
|
||||
@@ -272,7 +272,15 @@ class DblSidedTool(FlatCAMTool):
|
||||
def run(self, toggle=True):
|
||||
self.app.report_usage("Tool2Sided()")
|
||||
|
||||
FlatCAMTool.run(self, toggle=toggle)
|
||||
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:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
||||
self.app.ui.notebook.setTabText(2, _("2-Sided Tool"))
|
||||
|
||||
@@ -183,7 +183,15 @@ class Film(FlatCAMTool):
|
||||
def run(self, toggle=True):
|
||||
self.app.report_usage("ToolFilm()")
|
||||
|
||||
FlatCAMTool.run(self, toggle=toggle)
|
||||
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:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
|
||||
self.set_tool_ui()
|
||||
|
||||
|
||||
@@ -150,7 +150,15 @@ class ToolImage(FlatCAMTool):
|
||||
def run(self, toggle=True):
|
||||
self.app.report_usage("ToolImage()")
|
||||
|
||||
FlatCAMTool.run(self, toggle=toggle)
|
||||
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:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
||||
self.app.ui.notebook.setTabText(2, _("Image Tool"))
|
||||
|
||||
@@ -262,7 +262,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
|
||||
def run(self, toggle=True):
|
||||
self.app.report_usage("ToolNonCopperClear()")
|
||||
|
||||
FlatCAMTool.run(self, toggle=toggle)
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
||||
self.build_ui()
|
||||
|
||||
@@ -320,7 +320,15 @@ class ToolPaint(FlatCAMTool, Gerber):
|
||||
def run(self, toggle=True):
|
||||
self.app.report_usage("ToolPaint()")
|
||||
|
||||
FlatCAMTool.run(self, toggle=toggle)
|
||||
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:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
||||
self.app.ui.notebook.setTabText(2, _("Paint Tool"))
|
||||
|
||||
@@ -216,7 +216,15 @@ class Panelize(FlatCAMTool):
|
||||
def run(self, toggle=True):
|
||||
self.app.report_usage("ToolPanelize()")
|
||||
|
||||
FlatCAMTool.run(self, toggle=toggle)
|
||||
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:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
||||
self.app.ui.notebook.setTabText(2, "Panel. Tool")
|
||||
|
||||
@@ -69,9 +69,18 @@ class Properties(FlatCAMTool):
|
||||
|
||||
if self.app.tool_tab_locked is True:
|
||||
return
|
||||
|
||||
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:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
||||
FlatCAMTool.run(self, toggle=toggle)
|
||||
self.properties()
|
||||
|
||||
def install(self, icon=None, separator=None, **kwargs):
|
||||
|
||||
@@ -429,7 +429,15 @@ class SolderPaste(FlatCAMTool):
|
||||
def run(self, toggle=True):
|
||||
self.app.report_usage("ToolSolderPaste()")
|
||||
|
||||
FlatCAMTool.run(self, toggle=toggle)
|
||||
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:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
self.build_ui()
|
||||
|
||||
|
||||
@@ -378,7 +378,15 @@ class ToolTransform(FlatCAMTool):
|
||||
def run(self, toggle=True):
|
||||
self.app.report_usage("ToolTransform()")
|
||||
|
||||
FlatCAMTool.run(self, toggle=toggle)
|
||||
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:
|
||||
if self.app.ui.tool_scroll_area.widget().objectName() == self.toolName:
|
||||
self.app.ui.splitter.setSizes([0, 1])
|
||||
|
||||
FlatCAMTool.run(self)
|
||||
self.set_tool_ui()
|
||||
|
||||
self.app.ui.notebook.setTabText(2, _("Transform Tool"))
|
||||
|
||||
Reference in New Issue
Block a user