- in Invert Plugin updated the GUI

This commit is contained in:
Marius Stanciu
2021-09-06 00:05:12 +03:00
committed by Marius Stanciu
parent eccd3cd4c6
commit e465865252
3 changed files with 39 additions and 33 deletions

View File

@@ -24,6 +24,7 @@ CHANGELOG for FlatCAM beta
- in NCC Plugin updated the GUI - in NCC Plugin updated the GUI
- in Subtraction Plugin updated the GUI - in Subtraction Plugin updated the GUI
- in Follow Plugin updated the GUI - in Follow Plugin updated the GUI
- in Invert Plugin updated the GUI
4.09.2021 4.09.2021

View File

@@ -9,7 +9,7 @@ from PyQt6 import QtWidgets, QtCore, QtGui
from appTool import AppTool from appTool import AppTool
from appGUI.GUIElements import FCButton, FCDoubleSpinner, RadioSet, FCComboBox, FCLabel, \ from appGUI.GUIElements import FCButton, FCDoubleSpinner, RadioSet, FCComboBox, FCLabel, \
VerticalScrollArea, FCGridLayout VerticalScrollArea, FCGridLayout, FCFrame
from shapely.geometry import box from shapely.geometry import box
@@ -229,7 +229,6 @@ class InvertUI:
} }
""") """)
self.layout.addWidget(title_label) self.layout.addWidget(title_label)
self.layout.addWidget(FCLabel(""))
self.tools_frame = QtWidgets.QFrame() self.tools_frame = QtWidgets.QFrame()
self.tools_frame.setContentsMargins(0, 0, 0, 0) self.tools_frame.setContentsMargins(0, 0, 0, 0)
@@ -239,11 +238,12 @@ class InvertUI:
self.tools_box.setContentsMargins(0, 0, 0, 0) self.tools_box.setContentsMargins(0, 0, 0, 0)
self.tools_frame.setLayout(self.tools_box) self.tools_frame.setLayout(self.tools_box)
# Grid Layout # #############################################################################################################
grid0 = FCGridLayout(v_spacing=5, h_spacing=3) # Source Object Frame
grid0.setColumnStretch(0, 0) # #############################################################################################################
grid0.setColumnStretch(1, 1) self.gerber_label = FCLabel('<span style="color:darkorange;"><b>%s</b></span>' % _("Source Object"))
self.tools_box.addLayout(grid0) self.gerber_label.setToolTip(_("Gerber object that will be inverted."))
self.tools_box.addWidget(self.gerber_label)
# Target Gerber Object # Target Gerber Object
self.gerber_combo = FCComboBox() self.gerber_combo = FCComboBox()
@@ -252,23 +252,28 @@ class InvertUI:
self.gerber_combo.is_last = True self.gerber_combo.is_last = True
self.gerber_combo.obj_type = "Gerber" self.gerber_combo.obj_type = "Gerber"
self.gerber_label = FCLabel('<b>%s:</b>' % _("GERBER")) self.tools_box.addWidget(self.gerber_combo)
self.gerber_label.setToolTip(
_("Gerber object that will be inverted.")
)
grid0.addWidget(self.gerber_label, 1, 0, 1, 2) # separator_line = QtWidgets.QFrame()
grid0.addWidget(self.gerber_combo, 2, 0, 1, 2) # separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
# separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
# grid0.addWidget(separator_line, 3, 0, 1, 2)
separator_line = QtWidgets.QFrame() # #############################################################################################################
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine) # COMMON PARAMETERS Frame
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) # #############################################################################################################
grid0.addWidget(separator_line, 3, 0, 1, 2) self.param_label = FCLabel('<span style="color:blue;"><b>%s</b></span>' % _("Parameters"))
self.param_label = FCLabel("<b>%s:</b>" % _("Parameters"))
self.param_label.setToolTip('%s.' % _("Parameters for this tool")) self.param_label.setToolTip('%s.' % _("Parameters for this tool"))
self.tools_box.addWidget(self.param_label)
grid0.addWidget(self.param_label, 4, 0, 1, 2) self.gp_frame = FCFrame()
self.tools_box.addWidget(self.gp_frame)
# Grid Layout
grid0 = FCGridLayout(v_spacing=5, h_spacing=3)
grid0.setColumnStretch(0, 0)
grid0.setColumnStretch(1, 1)
self.gp_frame.setLayout(grid0)
# Margin # Margin
self.margin_label = FCLabel('%s:' % _('Margin')) self.margin_label = FCLabel('%s:' % _('Margin'))
@@ -281,10 +286,10 @@ class InvertUI:
self.margin_entry.set_range(0.0000, 10000.0000) self.margin_entry.set_range(0.0000, 10000.0000)
self.margin_entry.setObjectName(_("Margin")) self.margin_entry.setObjectName(_("Margin"))
grid0.addWidget(self.margin_label, 5, 0, 1, 2) grid0.addWidget(self.margin_label, 0, 0)
grid0.addWidget(self.margin_entry, 6, 0, 1, 2) grid0.addWidget(self.margin_entry, 0, 1)
self.join_label = FCLabel('%s:' % _("Lines Join Style")) self.join_label = FCLabel('%s: ' % _("Lines Join Style"))
self.join_label.setToolTip( self.join_label.setToolTip(
_("The way that the lines in the object outline will be joined.\n" _("The way that the lines in the object outline will be joined.\n"
"Can be:\n" "Can be:\n"
@@ -298,14 +303,12 @@ class InvertUI:
{'label': _('Bevel'), 'value': 'b'} {'label': _('Bevel'), 'value': 'b'}
], orientation='vertical', stretch=False) ], orientation='vertical', stretch=False)
grid0.addWidget(self.join_label, 7, 0, 1, 2) grid0.addWidget(self.join_label, 2, 0)
grid0.addWidget(self.join_radio, 8, 0, 1, 2) grid0.addWidget(self.join_radio, 2, 1)
separator_line = QtWidgets.QFrame()
separator_line.setFrameShape(QtWidgets.QFrame.Shape.HLine)
separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid0.addWidget(separator_line, 9, 0, 1, 2)
# #############################################################################################################
# Generate Inverted Gerber Button
# #############################################################################################################
self.invert_btn = FCButton(_('Invert Gerber')) self.invert_btn = FCButton(_('Invert Gerber'))
self.invert_btn.setIcon(QtGui.QIcon(self.app.resource_location + '/invert32.png')) self.invert_btn.setIcon(QtGui.QIcon(self.app.resource_location + '/invert32.png'))
self.invert_btn.setToolTip( self.invert_btn.setToolTip(
@@ -319,9 +322,9 @@ class InvertUI:
font-weight: bold; font-weight: bold;
} }
""") """)
grid0.addWidget(self.invert_btn, 10, 0, 1, 2) self.tools_box.addWidget(self.invert_btn)
self.tools_box.addStretch() self.tools_box.addStretch(1)
# ## Reset Tool # ## Reset Tool
self.reset_button = FCButton(_("Reset Tool")) self.reset_button = FCButton(_("Reset Tool"))

View File

@@ -1377,7 +1377,9 @@ class PanelizeUI:
self.separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken) self.separator_line.setFrameShadow(QtWidgets.QFrame.Shadow.Sunken)
grid3.addWidget(self.separator_line, 10, 0, 1, 2) grid3.addWidget(self.separator_line, 10, 0, 1, 2)
# Buttons # #############################################################################################################
# Generate Panel Button
# #############################################################################################################
self.panelize_object_button = FCButton(_("Panelize Object")) self.panelize_object_button = FCButton(_("Panelize Object"))
self.panelize_object_button.setIcon(QtGui.QIcon(self.app.resource_location + '/panelize16.png')) self.panelize_object_button.setIcon(QtGui.QIcon(self.app.resource_location + '/panelize16.png'))
self.panelize_object_button.setToolTip( self.panelize_object_button.setToolTip(