diff --git a/CHANGELOG.md b/CHANGELOG.md index 3de6a5e3..c38b58c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ CHANGELOG for FlatCAM beta 7.10.2021 - updated the Turkish translation files (by Mehmet Kaya) +- added a new color in the Object Colors ("indigo") +- now the object color transparency is preserved if a new color is chosen 5.10.2021 diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index b90125f9..b4135101 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -864,6 +864,9 @@ class MainGUI(QtWidgets.QMainWindow): self.menuproject_brown = self.menuprojectcolor.addAction( QtGui.QIcon(self.app.resource_location + '/brown32.png'), _('Brown')) + self.menuproject_brown = self.menuprojectcolor.addAction( + QtGui.QIcon(self.app.resource_location + '/indigo32.png'), _('Indigo')) + self.menuproject_brown = self.menuprojectcolor.addAction( QtGui.QIcon(self.app.resource_location + '/white32.png'), _('White')) diff --git a/app_Main.py b/app_Main.py index d195d0d5..0c80a367 100644 --- a/app_Main.py +++ b/app_Main.py @@ -8815,6 +8815,8 @@ class App(QtCore.QObject): self.log.debug("App.on_set_color_triggered() launched...") new_color = self.defaults['gerber_plot_fill'] + new_line_color = self.defaults['gerber_plot_line'] + clicked_action = self.sender() assert isinstance(clicked_action, QAction), "Expected a QAction, got %s" % type(clicked_action) @@ -8827,18 +8829,21 @@ class App(QtCore.QObject): # a default value, I just chose this one alpha_level = 'BF' for sel_obj in sel_obj_list: - if sel_obj.kind == 'excellon': - alpha_level = str(hex(int(self.defaults['excellon_plot_fill'][7:9], 16))[2:]) - elif sel_obj.kind == 'gerber': - alpha_level = str(hex(int(self.defaults['gerber_plot_fill'][7:9], 16))[2:]) - elif sel_obj.kind == 'geometry': - alpha_level = 'FF' + if hasattr(sel_obj, "alpha_level"): + alpha_level = sel_obj.alpha_level else: - self.log.debug( - "App.on_set_color_action_triggered() --> Default transparency level " - "for this object type not supported yet") - continue - sel_obj.alpha_level = alpha_level + if sel_obj.kind == 'excellon': + alpha_level = str(hex(int(self.defaults['excellon_plot_fill'][7:9], 16))[2:]) + elif sel_obj.kind == 'gerber': + alpha_level = str(hex(int(self.defaults['gerber_plot_fill'][7:9], 16))[2:]) + elif sel_obj.kind == 'geometry': + alpha_level = 'FF' + else: + self.log.debug( + "App.on_set_color_action_triggered() --> Default transparency level " + "for this object type not supported yet") + continue + sel_obj.alpha_level = alpha_level if act_name == _('Red'): new_color = '#FF0000' + alpha_level @@ -8853,6 +8858,8 @@ class App(QtCore.QObject): new_color = '#FF00FF' + alpha_level if act_name == _('Brown'): new_color = '#A52A2A' + alpha_level + if act_name == _('Indigo'): + new_color = '#4B0082' + alpha_level if act_name == _('White'): new_color = '#FFFFFF' + alpha_level if act_name == _('Black'): @@ -8914,7 +8921,7 @@ class App(QtCore.QObject): for sel_obj in sel_obj_list: new_color = sel_obj.fill_color[:-2] + alpha_str new_line_color = sel_obj.outline_color - + sel_obj.alpha_level = alpha_str sel_obj.fill_color = new_color sel_obj.shapes.redraw( update_colors=(sel_obj.fill_color, sel_obj.outline_color) diff --git a/assets/resources/dark_resources/indigo32.png b/assets/resources/dark_resources/indigo32.png new file mode 100644 index 00000000..2fbe2ee3 Binary files /dev/null and b/assets/resources/dark_resources/indigo32.png differ diff --git a/assets/resources/indigo32.png b/assets/resources/indigo32.png new file mode 100644 index 00000000..2fbe2ee3 Binary files /dev/null and b/assets/resources/indigo32.png differ