diff --git a/CHANGELOG.md b/CHANGELOG.md index adb52a70..ade20f18 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ CHANGELOG for FlatCAM beta ================================================= +9.01.2022 + +- some UI changes in the Preferences: the clicked tab now have a distinctive color (green) and some strings are optimized + 8.01.2021 - in Isolation Plugin fixed the issue with clicking the header not toggling all tools rows diff --git a/appGUI/GUIElements.py b/appGUI/GUIElements.py index 65368418..7fa7aa59 100644 --- a/appGUI/GUIElements.py +++ b/appGUI/GUIElements.py @@ -2777,6 +2777,7 @@ class FCMenu(QtWidgets.QMenu): class FCTab(QtWidgets.QTabWidget): def __init__(self, parent=None): super(FCTab, self).__init__(parent) + self.setTabsClosable(True) self.tabCloseRequested.connect(self.closeTab) diff --git a/appGUI/MainGUI.py b/appGUI/MainGUI.py index e8bd8718..55e490cc 100644 --- a/appGUI/MainGUI.py +++ b/appGUI/MainGUI.py @@ -1499,6 +1499,7 @@ class MainGUI(QtWidgets.QMainWindow): self.pref_tab_area_tabBar.setStyleSheet("QTabBar::tab{min-width:90px;}") self.pref_tab_area_tabBar.setExpanding(True) self.pref_tab_layout.addWidget(self.pref_tab_area) + self.default_pref_tab_area_tab_text_color = self.pref_tab_area.tabBar().tabTextColor(0) self.general_tab = QtWidgets.QWidget() self.general_tab.setObjectName("general_tab") @@ -2048,6 +2049,8 @@ class MainGUI(QtWidgets.QMainWindow): self.plot_tab_area.tab_detached.connect(self.on_tab_detached) + self.pref_tab_area.tabBar().tabBarClicked.connect(self.on_pref_tabbar_clicked) + # self.screenChanged.connect(self.on_screen_change) # def on_screen_change(self, old_screen, new_screen): @@ -2064,7 +2067,18 @@ class MainGUI(QtWidgets.QMainWindow): # if old_pixel_ratio != 1.0 or new_pixel_ratio != 1.0: # # update canvas dpi # ratio = new_pixel_ratio / old_pixel_ratio - # self.app.plotcanvas.dpi = self.app.plotcanvas.dpi * ratio + # self.app.plotcanvas.dpi = self.app.plotcanvas.Pdpi * ratio + + def on_pref_tabbar_clicked(self, idx, color=None): + self.set_pref_tab_area_tab_default_text_color() + if color is None: + self.pref_tab_area.tabBar().setTabTextColor(idx, QtGui.QColor('green')) + else: + self.pref_tab_area.tabBar().setTabTextColor(idx, color) + + def set_pref_tab_area_tab_default_text_color(self): + for idx in range(self.pref_tab_area.count()): + self.pref_tab_area.tabBar().setTabTextColor(idx, self.default_pref_tab_area_tab_text_color) def update_location_labels(self, dx, dy, x, y): """ diff --git a/appGUI/preferences/PreferencesUIManager.py b/appGUI/preferences/PreferencesUIManager.py index 0a3afc42..293f4e46 100644 --- a/appGUI/preferences/PreferencesUIManager.py +++ b/appGUI/preferences/PreferencesUIManager.py @@ -708,6 +708,9 @@ class PreferencesUIManager: } + # set the colors of the tab text's to default and the color of the first tab is 'green' + self.ui.on_pref_tabbar_clicked(0) + def defaults_read_form(self): """ Will read all the values in the Preferences GUI and update the defaults dictionary. @@ -1118,28 +1121,6 @@ class PreferencesUIManager: if should_restart is True: self.ui.app.on_app_restart() - def on_pref_close_button(self): - # Preferences saved, update flag - self.preferences_changed_flag = False - self.ignore_tab_close_event = True - - # restore stylesheet to default for the statusBar icon - self.ui.pref_status_label.setStyleSheet("") - - self.defaults_write_form(source_dict=self.defaults.current_defaults) - - self.defaults.update(self.defaults.current_defaults) - - # Preferences save, update the color of the Preferences Tab text - for idx in range(self.ui.plot_tab_area.count()): - if self.ui.plot_tab_area.tabText(idx) == _("Preferences"): - self.ui.plot_tab_area.tabBar.setTabTextColor(idx, self.old_color) - self.ui.plot_tab_area.closeTab(idx) - break - - self.inform.emit('%s' % _("Preferences closed without saving.")) - self.ignore_tab_close_event = False - def on_restore_defaults_preferences(self): """ Loads the application's factory default settings into ``self.defaults``. @@ -1310,3 +1291,25 @@ class PreferencesUIManager: self.preferences_changed_flag = False self.inform.emit('') return + + def on_pref_close_button(self): + # Preferences saved, update flag + self.preferences_changed_flag = False + self.ignore_tab_close_event = True + + # restore stylesheet to default for the statusBar icon + self.ui.pref_status_label.setStyleSheet("") + + self.defaults_write_form(source_dict=self.defaults.current_defaults) + + self.defaults.update(self.defaults.current_defaults) + + # Preferences save, update the color of the Preferences Tab text + for idx in range(self.ui.plot_tab_area.count()): + if self.ui.plot_tab_area.tabText(idx) == _("Preferences"): + self.ui.plot_tab_area.tabBar.setTabTextColor(idx, self.old_color) + self.ui.plot_tab_area.closeTab(idx) + break + + self.inform.emit('%s' % _("Preferences closed without saving.")) + self.ignore_tab_close_event = False diff --git a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py index c9dd6e34..88223038 100644 --- a/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobAdvOptPrefGroupUI.py @@ -18,7 +18,7 @@ class CNCJobAdvOptPrefGroupUI(OptionsGroupUI): self.decimals = decimals self.defaults = defaults - self.setTitle(str(_("CNC Job Adv. Options"))) + self.setTitle(str(_("Adv. Options"))) # ############################################################################################################# # PARAMETERS Frame diff --git a/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py index 114d2ae7..24879f94 100644 --- a/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobEditorPrefGroupUI.py @@ -18,7 +18,7 @@ class CNCJobEditorPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "CNC Job Options Preferences", parent=None) super(CNCJobEditorPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("CNC Job Editor"))) + self.setTitle(str(_("Editor"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py index 5a87c42d..deb6faca 100644 --- a/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobGenPrefGroupUI.py @@ -17,7 +17,7 @@ class CNCJobGenPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "CNC Job General Preferences", parent=None) super(CNCJobGenPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("CNC Job General"))) + self.setTitle(str(_("General"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py index d0654c94..f0bceae8 100644 --- a/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py +++ b/appGUI/preferences/cncjob/CNCJobOptPrefGroupUI.py @@ -18,7 +18,7 @@ class CNCJobOptPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "CNC Job Options Preferences", parent=None) super(CNCJobOptPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("CNC Job Options"))) + self.setTitle(str(_("Options"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py index 182c04c5..d17037d6 100644 --- a/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonAdvOptPrefGroupUI.py @@ -17,7 +17,7 @@ class ExcellonAdvOptPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "Excellon Advanced Options", parent=parent) super(ExcellonAdvOptPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Excellon Adv. Options"))) + self.setTitle(str(_("Adv. Options"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py index a7ea51a7..828e2f4c 100644 --- a/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonEditorPrefGroupUI.py @@ -16,7 +16,7 @@ class ExcellonEditorPrefGroupUI(OptionsGroupUI): def __init__(self, defaults, decimals=4, parent=None): super(ExcellonEditorPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Excellon Editor"))) + self.setTitle(str(_("Editor"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py index 8b1b486a..f0986e4c 100644 --- a/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonExpPrefGroupUI.py @@ -16,7 +16,7 @@ class ExcellonExpPrefGroupUI(OptionsGroupUI): def __init__(self, defaults, decimals=4, parent=None): super(ExcellonExpPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Excellon Export"))) + self.setTitle(str(_("Export"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py index 4b5d7032..65455bf1 100644 --- a/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonGenPrefGroupUI.py @@ -20,7 +20,7 @@ class ExcellonGenPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "Excellon Options", parent=parent) super(ExcellonGenPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Excellon General"))) + self.setTitle(str(_("General"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py index 87b4060b..0c2e6076 100644 --- a/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py +++ b/appGUI/preferences/excellon/ExcellonOptPrefGroupUI.py @@ -17,7 +17,7 @@ class ExcellonOptPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "Excellon Options", parent=parent) super(ExcellonOptPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Excellon Options"))) + self.setTitle(str(_("Options"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py index 1200aa11..65c2516f 100644 --- a/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryAdvOptPrefGroupUI.py @@ -17,7 +17,7 @@ class GeometryAdvOptPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "Geometry Advanced Options Preferences", parent=parent) super(GeometryAdvOptPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Geometry Adv. Options"))) + self.setTitle(str(_("Adv. Options"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py b/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py index 09860ce6..57e2fdc8 100644 --- a/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryEditorPrefGroupUI.py @@ -17,7 +17,7 @@ class GeometryEditorPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "Gerber Adv. Options Preferences", parent=parent) super(GeometryEditorPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Geometry Editor"))) + self.setTitle(str(_("Editor"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py b/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py index d3d5f586..8b988562 100644 --- a/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryExpPrefGroupUI.py @@ -16,7 +16,7 @@ class GeometryExpPrefGroupUI(OptionsGroupUI): def __init__(self, defaults, decimals=4, parent=None): super(GeometryExpPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Geometry Export"))) + self.setTitle(str(_("Export"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py index 9c4dd072..acf41e44 100644 --- a/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryGenPrefGroupUI.py @@ -19,7 +19,7 @@ class GeometryGenPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "Geometry General Preferences", parent=parent) super(GeometryGenPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Geometry General"))) + self.setTitle(str(_("General"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py index 86036978..7454b323 100644 --- a/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py +++ b/appGUI/preferences/geometry/GeometryOptPrefGroupUI.py @@ -18,7 +18,7 @@ class GeometryOptPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "Geometry Options Preferences", parent=parent) super(GeometryOptPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Geometry Options"))) + self.setTitle(str(_("Options"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py b/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py index 9663d45a..f1dae662 100644 --- a/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberAdvOptPrefGroupUI.py @@ -18,7 +18,7 @@ class GerberAdvOptPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "Gerber Adv. Options Preferences", parent=parent) super(GerberAdvOptPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Gerber Adv. Options"))) + self.setTitle(str(_("Adv. Options"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py index 311d9100..398dfe29 100644 --- a/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberEditorPrefGroupUI.py @@ -18,7 +18,7 @@ class GerberEditorPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "Gerber Adv. Options Preferences", parent=parent) super(GerberEditorPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Gerber Editor"))) + self.setTitle(str(_("Editor"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/gerber/GerberExpPrefGroupUI.py b/appGUI/preferences/gerber/GerberExpPrefGroupUI.py index cd0f7482..39ae72c1 100644 --- a/appGUI/preferences/gerber/GerberExpPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberExpPrefGroupUI.py @@ -17,7 +17,7 @@ class GerberExpPrefGroupUI(OptionsGroupUI): def __init__(self, defaults, decimals=4, parent=None): super(GerberExpPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Gerber Export"))) + self.setTitle(str(_("Export"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/gerber/GerberGenPrefGroupUI.py b/appGUI/preferences/gerber/GerberGenPrefGroupUI.py index bfb8016d..d9f11f18 100644 --- a/appGUI/preferences/gerber/GerberGenPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberGenPrefGroupUI.py @@ -18,7 +18,7 @@ class GerberGenPrefGroupUI(OptionsGroupUI): # OptionsGroupUI.__init__(self, "Gerber General Preferences", parent=parent) super(GerberGenPrefGroupUI, self).__init__(self, parent=parent) - self.setTitle(str(_("Gerber General"))) + self.setTitle(str(_("General"))) self.decimals = decimals self.defaults = defaults diff --git a/appGUI/preferences/gerber/GerberOptPrefGroupUI.py b/appGUI/preferences/gerber/GerberOptPrefGroupUI.py index 2bc07393..9d60f2cd 100644 --- a/appGUI/preferences/gerber/GerberOptPrefGroupUI.py +++ b/appGUI/preferences/gerber/GerberOptPrefGroupUI.py @@ -20,7 +20,7 @@ class GerberOptPrefGroupUI(OptionsGroupUI): self.decimals = decimals self.defaults = defaults - self.setTitle(str(_("Gerber Options"))) + self.setTitle(str(_("Options"))) # ############################################################################################################# # Non-copper Regions Frame