From 8ff3248c25b70e69fc7f290d710f878f2d459401 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 13 Feb 2020 21:22:21 +0200 Subject: [PATCH] - minor changes in the Tool Transform and Tool Calculators UI to bring them up2date with the other tools --- README.md | 1 + flatcamTools/ToolCalculators.py | 14 ++++++++++++++ flatcamTools/ToolTransform.py | 15 +++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/README.md b/README.md index 8ab918e5..2fb1bf22 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ CAD program, and create G-Code for Isolation routing. 13.02.2020 - finished Punch Gerber Tool +- minor changes in the Tool Transform and Tool Calculators UI to bring them up2date with the other tools 12.02.2020 diff --git a/flatcamTools/ToolCalculators.py b/flatcamTools/ToolCalculators.py index 2cc2551e..3a7ff665 100644 --- a/flatcamTools/ToolCalculators.py +++ b/flatcamTools/ToolCalculators.py @@ -242,6 +242,19 @@ class ToolCalculator(FlatCAMTool): self.layout.addStretch() + # ## Reset Tool + self.reset_button = QtWidgets.QPushButton(_("Reset Tool")) + self.reset_button.setToolTip( + _("Will reset the tool parameters.") + ) + self.reset_button.setStyleSheet(""" + QPushButton + { + font-weight: bold; + } + """) + self.layout.addWidget(self.reset_button) + self.units = '' # ## Signals @@ -255,6 +268,7 @@ class ToolCalculator(FlatCAMTool): self.inch_entry.editingFinished.connect(self.on_calculate_mm_units) self.calculate_plate_button.clicked.connect(self.on_calculate_eplate) + self.reset_button.clicked.connect(self.set_tool_ui) def run(self, toggle=True): self.app.report_usage("ToolCalculators()") diff --git a/flatcamTools/ToolTransform.py b/flatcamTools/ToolTransform.py index aa0a9a1e..04cb1dc8 100644 --- a/flatcamTools/ToolTransform.py +++ b/flatcamTools/ToolTransform.py @@ -412,6 +412,19 @@ class ToolTransform(FlatCAMTool): self.transform_lay.addStretch() + # ## Reset Tool + self.reset_button = QtWidgets.QPushButton(_("Reset Tool")) + self.reset_button.setToolTip( + _("Will reset the tool parameters.") + ) + self.reset_button.setStyleSheet(""" + QPushButton + { + font-weight: bold; + } + """) + self.transform_lay.addWidget(self.reset_button) + # ## Signals self.rotate_button.clicked.connect(self.on_rotate) self.skewx_button.clicked.connect(self.on_skewx) @@ -426,6 +439,8 @@ class ToolTransform(FlatCAMTool): self.buffer_button.clicked.connect(self.on_buffer_by_distance) self.buffer_factor_button.clicked.connect(self.on_buffer_by_factor) + self.reset_button.clicked.connect(self.set_tool_ui) + # self.rotate_entry.returnPressed.connect(self.on_rotate) # self.skewx_entry.returnPressed.connect(self.on_skewx) # self.skewy_entry.returnPressed.connect(self.on_skewy)