From 054a812f7b87547b85782801bebf8b5c200fdbd4 Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Thu, 19 May 2022 14:13:25 +0300 Subject: [PATCH] - added a new setting that control the selection shape creation, in the Preferences. If the checkbox Selection Outline is checked then the selection shape is only an outline. --- CHANGELOG.md | 4 ++++ appGUI/preferences/PreferencesUIManager.py | 2 ++ appGUI/preferences/general/GeneralGUIPrefGroupUI.py | 7 +++++++ appMain.py | 6 ++++++ defaults.py | 1 + 5 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5b81354..45130185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ CHANGELOG for FlatCAM Evo beta ================================================= +19.05.2022 + +- added a new setting that control the selection shape creation, in the Preferences. If the checkbox Selection Outline is checked then the selection shape is only an outline. + 18.05.2022 - added some safeguards in Cutout Plugin diff --git a/appGUI/preferences/PreferencesUIManager.py b/appGUI/preferences/PreferencesUIManager.py index 423552f7..1e2decf1 100644 --- a/appGUI/preferences/PreferencesUIManager.py +++ b/appGUI/preferences/PreferencesUIManager.py @@ -88,6 +88,8 @@ class PreferencesUIManager(QtCore.QObject): "global_layout": self.ui.general_pref_form.general_gui_group.layout_combo, "global_hover_shape": self.ui.general_pref_form.general_gui_group.hover_cb, "global_selection_shape": self.ui.general_pref_form.general_gui_group.selection_cb, + "global_selection_shape_as_line": self.ui.general_pref_form.general_gui_group.selection_outline_cb, + "global_gui_layout": self.ui.general_pref_form.general_gui_group.gui_lay_combo, "global_sel_fill": self.ui.general_pref_form.general_gui_group.sf_color_entry, diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py index cad40955..50e47c20 100644 --- a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -137,6 +137,13 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) grid0.addWidget(self.selection_cb, 12, 0, 1, 3) + # Enable Selection box + self.selection_outline_cb = FCCheckBox('%s' % _('Selection Outline')) + self.selection_outline_cb.setToolTip( + _("If checked, the selection shape is an outline.") + ) + grid0.addWidget(self.selection_outline_cb, 13, 0, 1, 3) + # Select the GUI layout self.ui_lay_lbl = FCLabel('%s:' % _('GUI Layout')) self.ui_lay_lbl.setToolTip( diff --git a/appMain.py b/appMain.py index 65a68319..d93eba3c 100644 --- a/appMain.py +++ b/appMain.py @@ -8059,6 +8059,9 @@ class App(QtCore.QObject): if b_sel_rect.is_empty or not b_sel_rect.is_valid or b_sel_rect is None: b_sel_rect = sel_rect + if self.options['global_selection_shape_as_line'] is True: + b_sel_rect = b_sel_rect.exterior + if color: face = color[:-2] + str(hex(int(0.2 * 255)))[2:] outline = color[:-2] + str(hex(int(0.8 * 255)))[2:] @@ -8113,6 +8116,9 @@ class App(QtCore.QObject): pt4 = (x0, y1) sel_rect = Polygon([pt1, pt2, pt3, pt4]) + if self.options['global_selection_shape_as_line'] is True: + sel_rect = sel_rect.exterior + # color_t = Color(face_color) # color_t.alpha = face_alpha diff --git a/defaults.py b/defaults.py index 47541dc3..ac9e1f30 100644 --- a/defaults.py +++ b/defaults.py @@ -119,6 +119,7 @@ class AppDefaults: "global_layout": "compact", "global_hover_shape": False, "global_selection_shape": True, + "global_selection_shape_as_line": False, "global_sel_fill": '#a5a5ffbf', "global_sel_line": '#0000ffbf',