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

- further modifications in Preferences -> General GUI

Marius Stanciu 6 лет назад
Родитель
Сommit
1863cbcb39
4 измененных файлов с 155 добавлено и 161 удалено
  1. 21 93
      FlatCAMApp.py
  2. 3 3
      FlatCAMObj.py
  3. 1 0
      README.md
  4. 130 65
      flatcamGUI/PreferencesUI.py

+ 21 - 93
FlatCAMApp.py

@@ -457,8 +457,6 @@ class App(QtCore.QObject):
                 'mm': [0.1, 0.2, 0.5, 1, 2.54]
                 'mm': [0.1, 0.2, 0.5, 1, 2.54]
             },
             },
 
 
-            "global_plot_fill": '#BBF268BF',
-            "global_plot_line": '#006E20BF',
             "global_sel_fill": '#a5a5ffbf',
             "global_sel_fill": '#a5a5ffbf',
             "global_sel_line": '#0000ffbf',
             "global_sel_line": '#0000ffbf',
             "global_alt_sel_fill": '#BBF268BF',
             "global_alt_sel_fill": '#BBF268BF',
@@ -525,6 +523,9 @@ class App(QtCore.QObject):
             "gerber_clean_apertures": True,
             "gerber_clean_apertures": True,
             "gerber_extra_buffering": True,
             "gerber_extra_buffering": True,
 
 
+            "gerber_plot_fill": '#BBF268BF',
+            "gerber_plot_line": '#006E20BF',
+
             "gerber_def_units": 'IN',
             "gerber_def_units": 'IN',
             "gerber_def_zeros": 'L',
             "gerber_def_zeros": 'L',
             "gerber_save_filters": "Gerber File (*.gbr);;Gerber File (*.bot);;Gerber File (*.bsm);;"
             "gerber_save_filters": "Gerber File (*.gbr);;Gerber File (*.bot);;Gerber File (*.bsm);;"
@@ -1118,8 +1119,6 @@ class App(QtCore.QObject):
             "global_workspaceT": self.ui.general_defaults_form.general_gui_group.wk_cb,
             "global_workspaceT": self.ui.general_defaults_form.general_gui_group.wk_cb,
             "global_workspace_orientation": self.ui.general_defaults_form.general_gui_group.wk_orientation_radio,
             "global_workspace_orientation": self.ui.general_defaults_form.general_gui_group.wk_orientation_radio,
 
 
-            "global_plot_fill": self.ui.general_defaults_form.general_gui_group.pf_color_entry,
-            "global_plot_line": self.ui.general_defaults_form.general_gui_group.pl_color_entry,
             "global_sel_fill": self.ui.general_defaults_form.general_gui_group.sf_color_entry,
             "global_sel_fill": self.ui.general_defaults_form.general_gui_group.sf_color_entry,
             "global_sel_line": self.ui.general_defaults_form.general_gui_group.sl_color_entry,
             "global_sel_line": self.ui.general_defaults_form.general_gui_group.sl_color_entry,
             "global_alt_sel_fill": self.ui.general_defaults_form.general_gui_group.alt_sf_color_entry,
             "global_alt_sel_fill": self.ui.general_defaults_form.general_gui_group.alt_sf_color_entry,
@@ -1160,6 +1159,8 @@ class App(QtCore.QObject):
             "gerber_def_zeros": self.ui.gerber_defaults_form.gerber_gen_group.gerber_zeros_radio,
             "gerber_def_zeros": self.ui.gerber_defaults_form.gerber_gen_group.gerber_zeros_radio,
             "gerber_clean_apertures": self.ui.gerber_defaults_form.gerber_gen_group.gerber_clean_cb,
             "gerber_clean_apertures": self.ui.gerber_defaults_form.gerber_gen_group.gerber_clean_cb,
             "gerber_extra_buffering": self.ui.gerber_defaults_form.gerber_gen_group.gerber_extra_buffering,
             "gerber_extra_buffering": self.ui.gerber_defaults_form.gerber_gen_group.gerber_extra_buffering,
+            "gerber_plot_fill": self.ui.gerber_defaults_form.gerber_gen_group.pf_color_entry,
+            "gerber_plot_line": self.ui.gerber_defaults_form.gerber_gen_group.pl_color_entry,
 
 
             # Gerber Options
             # Gerber Options
             "gerber_isotooldia": self.ui.gerber_defaults_form.gerber_opt_group.iso_tool_dia_entry,
             "gerber_isotooldia": self.ui.gerber_defaults_form.gerber_opt_group.iso_tool_dia_entry,
@@ -2009,19 +2010,6 @@ class App(QtCore.QObject):
         # ############################# GUI COLORS SIGNALS ############################
         # ############################# GUI COLORS SIGNALS ############################
         # #############################################################################
         # #############################################################################
 
 
-        # Setting plot colors signals
-        self.ui.general_defaults_form.general_gui_group.pf_color_entry.editingFinished.connect(
-            self.on_pf_color_entry)
-        self.ui.general_defaults_form.general_gui_group.pf_color_button.clicked.connect(
-            self.on_pf_color_button)
-        self.ui.general_defaults_form.general_gui_group.pf_color_alpha_spinner.valueChanged.connect(
-            self.on_pf_color_spinner)
-        self.ui.general_defaults_form.general_gui_group.pf_color_alpha_slider.valueChanged.connect(
-            self.on_pf_color_slider)
-        self.ui.general_defaults_form.general_gui_group.pl_color_entry.editingFinished.connect(
-            self.on_pl_color_entry)
-        self.ui.general_defaults_form.general_gui_group.pl_color_button.clicked.connect(
-            self.on_pl_color_button)
         # Setting selection (left - right) colors signals
         # Setting selection (left - right) colors signals
         self.ui.general_defaults_form.general_gui_group.sf_color_entry.editingFinished.connect(
         self.ui.general_defaults_form.general_gui_group.sf_color_entry.editingFinished.connect(
             self.on_sf_color_entry)
             self.on_sf_color_entry)
@@ -2035,6 +2023,7 @@ class App(QtCore.QObject):
             self.on_sl_color_entry)
             self.on_sl_color_entry)
         self.ui.general_defaults_form.general_gui_group.sl_color_button.clicked.connect(
         self.ui.general_defaults_form.general_gui_group.sl_color_button.clicked.connect(
             self.on_sl_color_button)
             self.on_sl_color_button)
+
         # Setting selection (right - left) colors signals
         # Setting selection (right - left) colors signals
         self.ui.general_defaults_form.general_gui_group.alt_sf_color_entry.editingFinished.connect(
         self.ui.general_defaults_form.general_gui_group.alt_sf_color_entry.editingFinished.connect(
             self.on_alt_sf_color_entry)
             self.on_alt_sf_color_entry)
@@ -2048,6 +2037,7 @@ class App(QtCore.QObject):
             self.on_alt_sl_color_entry)
             self.on_alt_sl_color_entry)
         self.ui.general_defaults_form.general_gui_group.alt_sl_color_button.clicked.connect(
         self.ui.general_defaults_form.general_gui_group.alt_sl_color_button.clicked.connect(
             self.on_alt_sl_color_button)
             self.on_alt_sl_color_button)
+
         # Setting Editor Draw colors signals
         # Setting Editor Draw colors signals
         self.ui.general_defaults_form.general_gui_group.draw_color_entry.editingFinished.connect(
         self.ui.general_defaults_form.general_gui_group.draw_color_entry.editingFinished.connect(
             self.on_draw_color_entry)
             self.on_draw_color_entry)
@@ -6271,19 +6261,19 @@ class App(QtCore.QObject):
 
 
     def init_color_pickers_in_preferences_gui(self):
     def init_color_pickers_in_preferences_gui(self):
         # Init Plot Colors
         # Init Plot Colors
-        self.ui.general_defaults_form.general_gui_group.pf_color_entry.set_value(self.defaults['global_plot_fill'])
-        self.ui.general_defaults_form.general_gui_group.pf_color_button.setStyleSheet(
+        self.ui.gerber_defaults_form.gerber_gen_group.pf_color_entry.set_value(self.defaults['gerber_plot_fill'])
+        self.ui.gerber_defaults_form.gerber_gen_group.pf_color_button.setStyleSheet(
             "background-color:%s;"
             "background-color:%s;"
-            "border-color: dimgray" % str(self.defaults['global_plot_fill'])[:7])
-        self.ui.general_defaults_form.general_gui_group.pf_color_alpha_spinner.set_value(
-            int(self.defaults['global_plot_fill'][7:9], 16))
-        self.ui.general_defaults_form.general_gui_group.pf_color_alpha_slider.setValue(
-            int(self.defaults['global_plot_fill'][7:9], 16))
-
-        self.ui.general_defaults_form.general_gui_group.pl_color_entry.set_value(self.defaults['global_plot_line'])
-        self.ui.general_defaults_form.general_gui_group.pl_color_button.setStyleSheet(
+            "border-color: dimgray" % str(self.defaults['gerber_plot_fill'])[:7])
+        self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_spinner.set_value(
+            int(self.defaults['gerber_plot_fill'][7:9], 16))
+        self.ui.gerber_defaults_form.gerber_gen_group.pf_color_alpha_slider.setValue(
+            int(self.defaults['gerber_plot_fill'][7:9], 16))
+
+        self.ui.gerber_defaults_form.gerber_gen_group.pl_color_entry.set_value(self.defaults['gerber_plot_line'])
+        self.ui.gerber_defaults_form.gerber_gen_group.pl_color_button.setStyleSheet(
             "background-color:%s;"
             "background-color:%s;"
-            "border-color: dimgray" % str(self.defaults['global_plot_line'])[:7])
+            "border-color: dimgray" % str(self.defaults['gerber_plot_line'])[:7])
 
 
         # Init Left-Right Selection colors
         # Init Left-Right Selection colors
         self.ui.general_defaults_form.general_gui_group.sf_color_entry.set_value(self.defaults['global_sel_fill'])
         self.ui.general_defaults_form.general_gui_group.sf_color_entry.set_value(self.defaults['global_sel_fill'])
@@ -6516,68 +6506,6 @@ class App(QtCore.QObject):
         )
         )
         self.on_excellon_format_changed()
         self.on_excellon_format_changed()
 
 
-    # Setting plot colors handlers
-    def on_pf_color_entry(self):
-        self.defaults['global_plot_fill'] = \
-            self.ui.general_defaults_form.general_gui_group.pf_color_entry.get_value()[:7] + \
-            self.defaults['global_plot_fill'][7:9]
-        self.ui.general_defaults_form.general_gui_group.pf_color_button.setStyleSheet(
-            "background-color:%s" % str(self.defaults['global_plot_fill'])[:7])
-
-    def on_pf_color_button(self):
-        current_color = QtGui.QColor(self.defaults['global_plot_fill'][:7])
-
-        c_dialog = QtWidgets.QColorDialog()
-        plot_fill_color = c_dialog.getColor(initial=current_color)
-
-        if plot_fill_color.isValid() is False:
-            return
-
-        self.ui.general_defaults_form.general_gui_group.pf_color_button.setStyleSheet(
-            "background-color:%s" % str(plot_fill_color.name()))
-
-        new_val = str(plot_fill_color.name()) + str(self.defaults['global_plot_fill'][7:9])
-        self.ui.general_defaults_form.general_gui_group.pf_color_entry.set_value(new_val)
-        self.defaults['global_plot_fill'] = new_val
-
-    def on_pf_color_spinner(self):
-        spinner_value = self.ui.general_defaults_form.general_gui_group.pf_color_alpha_spinner.value()
-        self.ui.general_defaults_form.general_gui_group.pf_color_alpha_slider.setValue(spinner_value)
-        self.defaults['global_plot_fill'] = \
-            self.defaults['global_plot_fill'][:7] + \
-            (hex(spinner_value)[2:] if int(hex(spinner_value)[2:], 16) > 0 else '00')
-        self.defaults['global_plot_line'] = \
-            self.defaults['global_plot_line'][:7] + \
-            (hex(spinner_value)[2:] if int(hex(spinner_value)[2:], 16) > 0 else '00')
-
-    def on_pf_color_slider(self):
-        slider_value = self.ui.general_defaults_form.general_gui_group.pf_color_alpha_slider.value()
-        self.ui.general_defaults_form.general_gui_group.pf_color_alpha_spinner.setValue(slider_value)
-
-    def on_pl_color_entry(self):
-        self.defaults['global_plot_line'] = \
-            self.ui.general_defaults_form.general_gui_group.pl_color_entry.get_value()[:7] + \
-            self.defaults['global_plot_line'][7:9]
-        self.ui.general_defaults_form.general_gui_group.pl_color_button.setStyleSheet(
-            "background-color:%s" % str(self.defaults['global_plot_line'])[:7])
-
-    def on_pl_color_button(self):
-        current_color = QtGui.QColor(self.defaults['global_plot_line'][:7])
-        # print(current_color)
-
-        c_dialog = QtWidgets.QColorDialog()
-        plot_line_color = c_dialog.getColor(initial=current_color)
-
-        if plot_line_color.isValid() is False:
-            return
-
-        self.ui.general_defaults_form.general_gui_group.pl_color_button.setStyleSheet(
-            "background-color:%s" % str(plot_line_color.name()))
-
-        new_val_line = str(plot_line_color.name()) + str(self.defaults['global_plot_line'][7:9])
-        self.ui.general_defaults_form.general_gui_group.pl_color_entry.set_value(new_val_line)
-        self.defaults['global_plot_line'] = new_val_line
-
     # Setting selection colors (left - right) handlers
     # Setting selection colors (left - right) handlers
     def on_sf_color_entry(self):
     def on_sf_color_entry(self):
         self.defaults['global_sel_fill'] = \
         self.defaults['global_sel_fill'] = \
@@ -10534,7 +10462,7 @@ class App(QtCore.QObject):
                                      mirror=None)
                                      mirror=None)
 
 
             if obj.kind.lower() == 'gerber':
             if obj.kind.lower() == 'gerber':
-                # color = self.defaults["global_plot_fill"][:-2]
+                # color = self.defaults["gerber_plot_fill"][:-2]
                 color = obj.fill_color[:-2]
                 color = obj.fill_color[:-2]
             elif obj.kind.lower() == 'excellon':
             elif obj.kind.lower() == 'excellon':
                 color = '#C40000'
                 color = '#C40000'
@@ -12447,7 +12375,7 @@ class App(QtCore.QObject):
         self.clear_pool()
         self.clear_pool()
 
 
     def on_set_color_action_triggered(self):
     def on_set_color_action_triggered(self):
-        new_color = self.defaults['global_plot_fill']
+        new_color = self.defaults['gerber_plot_fill']
         act_name = self.sender().text().lower()
         act_name = self.sender().text().lower()
 
 
         sel_obj_list = self.collection.get_selected()
         sel_obj_list = self.collection.get_selected()
@@ -12475,7 +12403,7 @@ class App(QtCore.QObject):
                         str(hex(self.ui.general_defaults_form.general_gui_group.pf_color_alpha_slider.value())[2:])
                         str(hex(self.ui.general_defaults_form.general_gui_group.pf_color_alpha_slider.value())[2:])
 
 
         if act_name == 'custom':
         if act_name == 'custom':
-            new_color = QtGui.QColor(self.defaults['global_plot_fill'][:7])
+            new_color = QtGui.QColor(self.defaults['gerber_plot_fill'][:7])
             c_dialog = QtWidgets.QColorDialog()
             c_dialog = QtWidgets.QColorDialog()
             plot_fill_color = c_dialog.getColor(initial=new_color)
             plot_fill_color = c_dialog.getColor(initial=new_color)
 
 

+ 3 - 3
FlatCAMObj.py

@@ -659,8 +659,8 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
 
 
         self.units_found = self.app.defaults['units']
         self.units_found = self.app.defaults['units']
 
 
-        self.fill_color = self.app.defaults['global_plot_fill']
-        self.outline_color = self.app.defaults['global_plot_line']
+        self.fill_color = self.app.defaults['gerber_plot_fill']
+        self.outline_color = self.app.defaults['gerber_plot_line']
 
 
         # Attributes to be included in serialization
         # Attributes to be included in serialization
         # Always append to it because it carries contents
         # Always append to it because it carries contents
@@ -1790,7 +1790,7 @@ class FlatCAMGerber(FlatCAMObj, Gerber):
         if 'color' in kwargs:
         if 'color' in kwargs:
             color = kwargs['color']
             color = kwargs['color']
         else:
         else:
-            color = self.app.defaults['global_plot_fill']
+            color = self.app.defaults['gerber_plot_fill']
 
 
         if 'marked_aperture' not in kwargs:
         if 'marked_aperture' not in kwargs:
             return
             return

+ 1 - 0
README.md

@@ -20,6 +20,7 @@ CAD program, and create G-Code for Isolation routing.
 - added a clean_up() method in all the Editor Tools that need it, to be run when aborting using the ESC key
 - added a clean_up() method in all the Editor Tools that need it, to be run when aborting using the ESC key
 - fixed an error in the Gerber parser; it did not took into consideration the aperture size declared before the beginning of a Gerber region. Detected for Gerber files generated by KiCAD 5.x
 - fixed an error in the Gerber parser; it did not took into consideration the aperture size declared before the beginning of a Gerber region. Detected for Gerber files generated by KiCAD 5.x
 - in Panelize Tool made sure that for Gerber objects if one of the apertures is without geometry then it is ignored
 - in Panelize Tool made sure that for Gerber objects if one of the apertures is without geometry then it is ignored
+- further modifications in Preferences -> General GUI
 
 
 25.12.2019
 25.12.2019
 
 

+ 130 - 65
flatcamGUI/PreferencesUI.py

@@ -472,71 +472,6 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI):
         grid0.addWidget(self.wk_orientation_label, 8, 0)
         grid0.addWidget(self.wk_orientation_label, 8, 0)
         grid0.addWidget(self.wk_orientation_radio, 8, 1)
         grid0.addWidget(self.wk_orientation_radio, 8, 1)
 
 
-        separator_line = QtWidgets.QFrame()
-        separator_line.setFrameShape(QtWidgets.QFrame.HLine)
-        separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
-        grid0.addWidget(separator_line, 9, 0, 1, 2)
-
-        self.gerber_color_label = QtWidgets.QLabel('<b>%s</b>' % _('Gerber Object Color'))
-        grid0.addWidget(self.gerber_color_label, 10, 0, 1, 2)
-
-        # Plot Line Color
-        self.pl_color_label = QtWidgets.QLabel('%s:' % _('Outline'))
-        self.pl_color_label.setToolTip(
-           _("Set the line color for plotted objects.")
-        )
-        self.pl_color_entry = FCEntry()
-        self.pl_color_button = QtWidgets.QPushButton()
-        self.pl_color_button.setFixedSize(15, 15)
-
-        self.form_box_child_2 = QtWidgets.QHBoxLayout()
-        self.form_box_child_2.addWidget(self.pl_color_entry)
-        self.form_box_child_2.addWidget(self.pl_color_button)
-        self.form_box_child_2.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
-
-        grid0.addWidget(self.pl_color_label, 11, 0)
-        grid0.addLayout(self.form_box_child_2, 11, 1)
-
-        # Plot Fill Color
-        self.pf_color_label = QtWidgets.QLabel('%s:' % _('Fill'))
-        self.pf_color_label.setToolTip(
-            _("Set the fill color for plotted objects.\n"
-              "First 6 digits are the color and the last 2\n"
-              "digits are for alpha (transparency) level.")
-        )
-        self.pf_color_entry = FCEntry()
-        self.pf_color_button = QtWidgets.QPushButton()
-        self.pf_color_button.setFixedSize(15, 15)
-
-        self.form_box_child_1 = QtWidgets.QHBoxLayout()
-        self.form_box_child_1.addWidget(self.pf_color_entry)
-        self.form_box_child_1.addWidget(self.pf_color_button)
-        self.form_box_child_1.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
-
-        grid0.addWidget(self.pf_color_label, 12, 0)
-        grid0.addLayout(self.form_box_child_1, 12, 1)
-
-        # Plot Fill Transparency Level
-        self.pf_alpha_label = QtWidgets.QLabel('%s:' % _('Alpha'))
-        self.pf_alpha_label.setToolTip(
-           _("Set the fill transparency for plotted objects.")
-        )
-        self.pf_color_alpha_slider = QtWidgets.QSlider(QtCore.Qt.Horizontal)
-        self.pf_color_alpha_slider.setMinimum(0)
-        self.pf_color_alpha_slider.setMaximum(255)
-        self.pf_color_alpha_slider.setSingleStep(1)
-
-        self.pf_color_alpha_spinner = FCSpinner()
-        self.pf_color_alpha_spinner.setMinimumWidth(70)
-        self.pf_color_alpha_spinner.set_range(0, 255)
-
-        self.form_box_child_3 = QtWidgets.QHBoxLayout()
-        self.form_box_child_3.addWidget(self.pf_color_alpha_slider)
-        self.form_box_child_3.addWidget(self.pf_color_alpha_spinner)
-
-        grid0.addWidget(self.pf_alpha_label, 13, 0)
-        grid0.addLayout(self.form_box_child_3, 13, 1)
-
         separator_line = QtWidgets.QFrame()
         separator_line = QtWidgets.QFrame()
         separator_line.setFrameShape(QtWidgets.QFrame.HLine)
         separator_line.setFrameShape(QtWidgets.QFrame.HLine)
         separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
         separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
@@ -1701,8 +1636,138 @@ class GerberGenPrefGroupUI(OptionsGroupUI):
         )
         )
         grid0.addWidget(self.gerber_extra_buffering, 8, 0, 1, 3)
         grid0.addWidget(self.gerber_extra_buffering, 8, 0, 1, 3)
 
 
+        separator_line = QtWidgets.QFrame()
+        separator_line.setFrameShape(QtWidgets.QFrame.HLine)
+        separator_line.setFrameShadow(QtWidgets.QFrame.Sunken)
+        grid0.addWidget(separator_line, 9, 0, 1, 3)
+
+        # Gerber Object Color
+        self.gerber_color_label = QtWidgets.QLabel('<b>%s</b>' % _('Gerber Object Color'))
+        grid0.addWidget(self.gerber_color_label, 10, 0, 1, 3)
+
+        # Plot Line Color
+        self.pl_color_label = QtWidgets.QLabel('%s:' % _('Outline'))
+        self.pl_color_label.setToolTip(
+            _("Set the line color for plotted objects.")
+        )
+        self.pl_color_entry = FCEntry()
+        self.pl_color_button = QtWidgets.QPushButton()
+        self.pl_color_button.setFixedSize(15, 15)
+
+        self.form_box_child_2 = QtWidgets.QHBoxLayout()
+        self.form_box_child_2.addWidget(self.pl_color_entry)
+        self.form_box_child_2.addWidget(self.pl_color_button)
+        self.form_box_child_2.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
+
+        grid0.addWidget(self.pl_color_label, 11, 0)
+        grid0.addLayout(self.form_box_child_2, 11, 1, 1, 2)
+
+        # Plot Fill Color
+        self.pf_color_label = QtWidgets.QLabel('%s:' % _('Fill'))
+        self.pf_color_label.setToolTip(
+            _("Set the fill color for plotted objects.\n"
+              "First 6 digits are the color and the last 2\n"
+              "digits are for alpha (transparency) level.")
+        )
+        self.pf_color_entry = FCEntry()
+        self.pf_color_button = QtWidgets.QPushButton()
+        self.pf_color_button.setFixedSize(15, 15)
+
+        self.form_box_child_1 = QtWidgets.QHBoxLayout()
+        self.form_box_child_1.addWidget(self.pf_color_entry)
+        self.form_box_child_1.addWidget(self.pf_color_button)
+        self.form_box_child_1.setAlignment(QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)
+
+        grid0.addWidget(self.pf_color_label, 12, 0)
+        grid0.addLayout(self.form_box_child_1, 12, 1, 1, 2)
+
+        # Plot Fill Transparency Level
+        self.pf_alpha_label = QtWidgets.QLabel('%s:' % _('Alpha'))
+        self.pf_alpha_label.setToolTip(
+            _("Set the fill transparency for plotted objects.")
+        )
+        self.pf_color_alpha_slider = QtWidgets.QSlider(QtCore.Qt.Horizontal)
+        self.pf_color_alpha_slider.setMinimum(0)
+        self.pf_color_alpha_slider.setMaximum(255)
+        self.pf_color_alpha_slider.setSingleStep(1)
+
+        self.pf_color_alpha_spinner = FCSpinner()
+        self.pf_color_alpha_spinner.setMinimumWidth(70)
+        self.pf_color_alpha_spinner.set_range(0, 255)
+
+        self.form_box_child_3 = QtWidgets.QHBoxLayout()
+        self.form_box_child_3.addWidget(self.pf_color_alpha_slider)
+        self.form_box_child_3.addWidget(self.pf_color_alpha_spinner)
+
+        grid0.addWidget(self.pf_alpha_label, 13, 0)
+        grid0.addLayout(self.form_box_child_3, 13, 1, 1, 2)
+
         self.layout.addStretch()
         self.layout.addStretch()
 
 
+        # Setting plot colors signals
+        self.pl_color_entry.editingFinished.connect(self.on_pl_color_entry)
+        self.pl_color_button.clicked.connect(self.on_pl_color_button)
+        self.pf_color_entry.editingFinished.connect(self.on_pf_color_entry)
+        self.pf_color_button.clicked.connect(self.on_pf_color_button)
+        self.pf_color_alpha_spinner.valueChanged.connect(self.on_pf_color_spinner)
+        self.pf_color_alpha_slider.valueChanged.connect(self.on_pf_color_slider)
+
+    # Setting plot colors handlers
+    def on_pf_color_entry(self):
+        self.app.defaults['gerber_plot_fill'] = self.pf_color_entry.get_value()[:7] + \
+            self.app.defaults['gerber_plot_fill'][7:9]
+        self.pf_color_button.setStyleSheet("background-color:%s" % str(self.defaults['gerber_plot_fill'])[:7])
+
+    def on_pf_color_button(self):
+        current_color = QtGui.QColor(self.app.defaults['gerber_plot_fill'][:7])
+
+        c_dialog = QtWidgets.QColorDialog()
+        plot_fill_color = c_dialog.getColor(initial=current_color)
+
+        if plot_fill_color.isValid() is False:
+            return
+
+        self.pf_color_button.setStyleSheet("background-color:%s" % str(plot_fill_color.name()))
+
+        new_val = str(plot_fill_color.name()) + str(self.app.defaults['gerber_plot_fill'][7:9])
+        self.pf_color_entry.set_value(new_val)
+        self.app.defaults['gerber_plot_fill'] = new_val
+
+    def on_pf_color_spinner(self):
+        spinner_value = self.pf_color_alpha_spinner.value()
+        self.pf_color_alpha_slider.setValue(spinner_value)
+        self.app.defaults['gerber_plot_fill'] = \
+            self.app.defaults['gerber_plot_fill'][:7] + \
+            (hex(spinner_value)[2:] if int(hex(spinner_value)[2:], 16) > 0 else '00')
+        self.app.defaults['gerber_plot_line'] = \
+            self.app.defaults['gerber_plot_line'][:7] + \
+            (hex(spinner_value)[2:] if int(hex(spinner_value)[2:], 16) > 0 else '00')
+
+    def on_pf_color_slider(self):
+        slider_value = self.pf_color_alpha_slider.value()
+        self.pf_color_alpha_spinner.setValue(slider_value)
+
+    def on_pl_color_entry(self):
+        self.app.defaults['gerber_plot_line'] = self.pl_color_entry.get_value()[:7] + \
+                                                self.app.defaults['gerber_plot_line'][7:9]
+        self.pl_color_button.setStyleSheet("background-color:%s" % str(self.defaults['gerber_plot_line'])[:7])
+
+    def on_pl_color_button(self):
+        current_color = QtGui.QColor(self.app.defaults['gerber_plot_line'][:7])
+        # print(current_color)
+
+        c_dialog = QtWidgets.QColorDialog()
+        plot_line_color = c_dialog.getColor(initial=current_color)
+
+        if plot_line_color.isValid() is False:
+            return
+
+        self.pl_color_button.setStyleSheet("background-color:%s" % str(plot_line_color.name()))
+
+        new_val_line = str(plot_line_color.name()) + str(self.app.defaults['gerber_plot_line'][7:9])
+        self.pl_color_entry.set_value(new_val_line)
+        self.app.defaults['gerber_plot_line'] = new_val_line
+
 
 
 class GerberOptPrefGroupUI(OptionsGroupUI):
 class GerberOptPrefGroupUI(OptionsGroupUI):
     def __init__(self, decimals=4, parent=None):
     def __init__(self, decimals=4, parent=None):