Просмотр исходного кода

- replaced the layout from Grid to Form for the Reference objects comboboxes in Paint Tool and in NCC Tool

Marius Stanciu 6 лет назад
Родитель
Сommit
1d470bafb4
3 измененных файлов с 13 добавлено и 17 удалено
  1. 2 1
      README.md
  2. 4 7
      flatcamTools/ToolNonCopperClear.py
  3. 7 9
      flatcamTools/ToolPaint.py

+ 2 - 1
README.md

@@ -11,7 +11,8 @@ CAD program, and create G-Code for Isolation routing.
 
 20.08.2019
 
-- added ability to do copper clearing through NCC Tool on Geometry objects also
+- added ability to do copper clearing through NCC Tool on Geometry objects
+- replaced the layout from Grid to Form for the Reference objects comboboxes in Paint Tool and in NCC Tool
 
 19.08.2019
 

+ 4 - 7
flatcamTools/ToolNonCopperClear.py

@@ -321,8 +321,8 @@ class NonCopperClear(FlatCAMTool, Gerber):
         grid3.addWidget(self.reference_label, 9, 0)
         grid3.addWidget(self.reference_radio, 9, 1)
 
-        grid4 = QtWidgets.QGridLayout()
-        self.tools_box.addLayout(grid4)
+        form1 = QtWidgets.QFormLayout()
+        self.tools_box.addLayout(form1)
 
         self.box_combo_type_label = QtWidgets.QLabel('%s:' % _("Ref. Type"))
         self.box_combo_type_label.setToolTip(
@@ -333,9 +333,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
         self.box_combo_type.addItem(_("Gerber   Reference Box Object"))
         self.box_combo_type.addItem(_("Excellon Reference Box Object"))
         self.box_combo_type.addItem(_("Geometry Reference Box Object"))
-
-        grid4.addWidget(self.box_combo_type_label, 0, 0)
-        grid4.addWidget(self.box_combo_type, 0, 1)
+        form1.addRow(self.box_combo_type_label, self.box_combo_type)
 
         self.box_combo_label = QtWidgets.QLabel('%s:' % _("Ref. Object"))
         self.box_combo_label.setToolTip(
@@ -345,8 +343,7 @@ class NonCopperClear(FlatCAMTool, Gerber):
         self.box_combo.setModel(self.app.collection)
         self.box_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
         self.box_combo.setCurrentIndex(1)
-        grid4.addWidget(self.box_combo_label, 1, 0)
-        grid4.addWidget(self.box_combo, 1, 1)
+        form1.addRow(self.box_combo_label, self.box_combo)
 
         self.box_combo.hide()
         self.box_combo_label.hide()

+ 7 - 9
flatcamTools/ToolPaint.py

@@ -1,10 +1,10 @@
-# ########################################################## ##
+# ##########################################################
 # FlatCAM: 2D Post-processing for Manufacturing            #
 # http://flatcam.org                                       #
 # File Modified: Marius Adrian Stanciu (c)                 #
 # Date: 3/10/2019                                          #
 # MIT Licence                                              #
-# ########################################################## ##
+# ##########################################################
 
 from FlatCAMTool import FlatCAMTool
 from copy import copy, deepcopy
@@ -262,8 +262,8 @@ class ToolPaint(FlatCAMTool, Gerber):
         )
         grid3.addWidget(self.selectmethod_combo, 7, 1)
 
-        grid4 = QtWidgets.QGridLayout()
-        self.tools_box.addLayout(grid4)
+        form1 = QtWidgets.QFormLayout()
+        self.tools_box.addLayout(form1)
 
         self.box_combo_type_label = QtWidgets.QLabel('%s:' % _("Ref. Type"))
         self.box_combo_type_label.setToolTip(
@@ -274,9 +274,8 @@ class ToolPaint(FlatCAMTool, Gerber):
         self.box_combo_type.addItem(_("Gerber   Reference Box Object"))
         self.box_combo_type.addItem(_("Excellon Reference Box Object"))
         self.box_combo_type.addItem(_("Geometry Reference Box Object"))
+        form1.addRow(self.box_combo_type_label, self.box_combo_type)
 
-        grid4.addWidget(self.box_combo_type_label, 0, 0)
-        grid4.addWidget(self.box_combo_type, 0, 1)
 
         self.box_combo_label = QtWidgets.QLabel('%s:' % _("Ref. Object"))
         self.box_combo_label.setToolTip(
@@ -286,8 +285,7 @@ class ToolPaint(FlatCAMTool, Gerber):
         self.box_combo.setModel(self.app.collection)
         self.box_combo.setRootModelIndex(self.app.collection.index(0, 0, QtCore.QModelIndex()))
         self.box_combo.setCurrentIndex(1)
-        grid4.addWidget(self.box_combo_label, 1, 0)
-        grid4.addWidget(self.box_combo, 1, 1)
+        form1.addRow(self.box_combo_label, self.box_combo)
 
         self.box_combo.hide()
         self.box_combo_label.hide()
@@ -606,7 +604,7 @@ class ToolPaint(FlatCAMTool, Gerber):
                     tool_dia = float(self.addtool_entry.get_value().replace(',', '.'))
                 except ValueError:
                     self.app.inform.emit(_("[ERROR_NOTCL] Wrong value format entered, "
-                                         "use a number."))
+                                           "use a number."))
                     return
 
             if tool_dia is None: