diff --git a/CHANGELOG.md b/CHANGELOG.md index 00fa0320..d97cbc40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ CHANGELOG for FlatCAM Evo beta - replaced all the FCLabel widgets that have color HTML with the new FCLabel widget that uses parameters for 'color' and weight - minor changes - added a way to allow patching FCLabel widget colors for certain cases without having to pass them each instance +- some changes in the theme selection, added that the default situation is where no theme is applied +- some string changes 17.04.2022 diff --git a/appEditors/geo_plugins/GeoCopyPlugin.py b/appEditors/geo_plugins/GeoCopyPlugin.py index 4cc079cc..1100e82f 100644 --- a/appEditors/geo_plugins/GeoCopyPlugin.py +++ b/appEditors/geo_plugins/GeoCopyPlugin.py @@ -496,7 +496,7 @@ class CopyEditorUI: self.rows.valueChanged.connect(self.on_rows_cols_value_changed) self.columns.valueChanged.connect(self.on_rows_cols_value_changed) - self.app.inform.emit(_("Click to place ...")) + self.app.inform.emit(_("Click on reference location ...")) else: if val == 'linear': self.array_circular_frame.hide() @@ -505,7 +505,7 @@ class CopyEditorUI: self.spacing_frame.hide() self.offset_frame.hide() - self.app.inform.emit(_("Click to place ...")) + self.app.inform.emit(_("Click on reference location ...")) else: # 'circular' self.array_circular_frame.show() self.array_linear_frame.hide() diff --git a/appGUI/PlotCanvas.py b/appGUI/PlotCanvas.py index 2ba5003b..0d40cf9f 100644 --- a/appGUI/PlotCanvas.py +++ b/appGUI/PlotCanvas.py @@ -54,14 +54,14 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: self.line_color = (0.3, 0.0, 0.0, 1.0) # self.rect_hud_color = Color('#0000FF10') self.rect_hud_color = Color('#80808040') @@ -389,14 +389,14 @@ class PlotCanvas(QtCore.QObject, VisPyCanvas): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: color = 'dimgray' else: color = '#dededeff' diff --git a/appGUI/PlotCanvas3d.py b/appGUI/PlotCanvas3d.py index 1c3d6e13..748b459c 100644 --- a/appGUI/PlotCanvas3d.py +++ b/appGUI/PlotCanvas3d.py @@ -66,19 +66,19 @@ class PlotCanvas3d(QtCore.QObject, scene.SceneCanvas): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False if settings.contains("axis_font_size"): a_fsize = settings.value('axis_font_size', type=int) else: a_fsize = 8 - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: theme_color = Color('#FFFFFF') tick_color = Color('#000000') back_color = str(QPalette().color(QPalette.ColorRole.Window).name()) diff --git a/appGUI/PlotCanvasLegacy.py b/appGUI/PlotCanvasLegacy.py index 45d34023..17590476 100644 --- a/appGUI/PlotCanvasLegacy.py +++ b/appGUI/PlotCanvasLegacy.py @@ -86,14 +86,14 @@ class CanvasCache(QtCore.QObject): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: self.axes.set_facecolor('#FFFFFF') else: self.axes.set_facecolor('#000000') @@ -165,7 +165,7 @@ class PlotCanvasLegacy(QtCore.QObject): self.app = app - if self.app.options['global_theme'] == 'light': + if self.app.options['global_theme'] in ['default', 'light']: theme_color = '#FFFFFF' tick_color = '#000000' self.rect_hud_color = '#0000FF10' @@ -457,7 +457,7 @@ class PlotCanvasLegacy(QtCore.QObject): super().__init__() self.p = plotcanvas - units = self.p.app.app_units + # units = self.p.app.app_units # self._text = 'Dx: %s [%s]\nDy: %s [%s]\n\nX: %s [%s]\nY: %s [%s]' % \ # ('0.0000', units, '0.0000', units, '0.0000', units, '0.0000', units) self.on_update_text_hud() diff --git a/appGUI/VisPyCanvas.py b/appGUI/VisPyCanvas.py index 991f3546..35d86aa4 100644 --- a/appGUI/VisPyCanvas.py +++ b/appGUI/VisPyCanvas.py @@ -39,14 +39,14 @@ class VisPyCanvas(scene.SceneCanvas): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: theme_color = Color('#FFFFFF') tick_color = Color('#000000') back_color = str(QPalette().color(QPalette.ColorRole.Window).name()) @@ -102,15 +102,15 @@ class VisPyCanvas(scene.SceneCanvas): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False self.view = view - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: self.grid = scene.GridLines(parent=self.view.scene, color='dimgray') else: self.grid = scene.GridLines(parent=self.view.scene, color='#dededeff') diff --git a/appGUI/preferences/general/GeneralAPPSetGroupUI.py b/appGUI/preferences/general/GeneralAPPSetGroupUI.py index 2ec99b73..b7d92edf 100644 --- a/appGUI/preferences/general/GeneralAPPSetGroupUI.py +++ b/appGUI/preferences/general/GeneralAPPSetGroupUI.py @@ -496,14 +496,14 @@ class GeneralAPPSetGroupUI(OptionsGroupUI): if theme_settings.contains("theme"): theme = theme_settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if theme_settings.contains("dark_canvas"): dark_canvas = theme_settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: self.app.cursor_color_3D = 'black' else: self.app.cursor_color_3D = 'gray' diff --git a/appGUI/preferences/general/GeneralAppSettingsGroupUI.py b/appGUI/preferences/general/GeneralAppSettingsGroupUI.py index 93ba5780..60bbc5fa 100644 --- a/appGUI/preferences/general/GeneralAppSettingsGroupUI.py +++ b/appGUI/preferences/general/GeneralAppSettingsGroupUI.py @@ -292,14 +292,14 @@ class GeneralAppSettingsGroupUI(OptionsGroupUI2): if theme_settings.contains("theme"): theme = theme_settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if theme_settings.contains("dark_canvas"): dark_canvas = theme_settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: self.app.cursor_color_3D = 'black' else: self.app.cursor_color_3D = 'gray' diff --git a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py index bec7d99e..e846d1e0 100644 --- a/appGUI/preferences/general/GeneralGUIPrefGroupUI.py +++ b/appGUI/preferences/general/GeneralGUIPrefGroupUI.py @@ -42,21 +42,24 @@ class GeneralGUIPrefGroupUI(OptionsGroupUI): ) self.appearance_radio = RadioSet([ - {"label": _("OS Dependent"), "value": "auto"}, + {"label": _("Default"), "value": "default"}, + {"label": _("Auto"), "value": "auto"}, {"label": _("Light"), "value": "light"}, {"label": _("Dark"), "value": "dark"} ], compact=True) self.appearance_radio.setToolTip( - _("OS Dependent: Matches mode from OS\n" + _("The theme can be:\n" + "Default: Default theme\n" + "Auto: Matches mode from OS\n" "Light: Light mode\n" "Dark: Dark mode") ) # Dark Canvas - self.dark_canvas_cb = FCCheckBox('%s' % _('Always use dark canvas')) + self.dark_canvas_cb = FCCheckBox('%s' % _('Dark Canvas')) self.dark_canvas_cb.setToolTip( - _("Check this box to always use Dark canvas\n" - "even if Light theme is selected.") + _("Check this box to force the use of dark canvas\n" + "even if a dark theme is not selected.") ) grid0.addWidget(self.appearance_label, 0, 0, 1, 2) diff --git a/appMain.py b/appMain.py index 8632f289..aed6b931 100644 --- a/appMain.py +++ b/appMain.py @@ -619,7 +619,9 @@ class App(QtCore.QObject): else: theme = 'light' else: - if self.options["global_appearance"] == 'dark': + if self.options["global_appearance"] == 'default': + theme = 'default' + elif self.options["global_appearance"] == 'dark': theme = 'dark' else: theme = 'light' @@ -634,7 +636,9 @@ class App(QtCore.QObject): else: self.decimals = int(self.options['decimals_inch']) - if self.options["global_theme"] == 'light': + if self.options["global_theme"] == 'default': + self.resource_location = 'assets/resources' + elif self.options["global_theme"] == 'light': self.resource_location = 'assets/resources' self.qapp.setStyleSheet(qdarktheme.load_stylesheet('light')) else: @@ -1040,12 +1044,12 @@ class App(QtCore.QObject): if self.options["global_cursor_color_enabled"]: self.cursor_color_3D = self.options["global_cursor_color"] else: - if theme == 'light' and not self.options["global_dark_canvas"]: + if (theme == 'light' or theme == 'default') and not self.options["global_dark_canvas"]: self.cursor_color_3D = 'black' else: self.cursor_color_3D = 'gray' - # update the options dict with the setting in QSetting + # update the 'options' dict with the setting in QSetting self.options['global_theme'] = theme # ######################## diff --git a/appPlugins/ToolDistance.py b/appPlugins/ToolDistance.py index e27d3697..a7f4ec28 100644 --- a/appPlugins/ToolDistance.py +++ b/appPlugins/ToolDistance.py @@ -764,20 +764,20 @@ class Distance(AppTool): if settings.contains("theme"): theme = settings.value('theme', type=str) else: - theme = 'light' + theme = 'default' if settings.contains("dark_canvas"): dark_canvas = settings.value('dark_canvas', type=bool) else: - dark_canvas = True + dark_canvas = False if self.app.use_3d_engine: - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: color = '#000000FF' else: color = '#FFFFFFFF' else: - if theme == 'light' and not dark_canvas: + if (theme == 'default' or theme == 'light') and not dark_canvas: color = '#000000' else: color = '#FFFFFF' diff --git a/defaults.py b/defaults.py index f8f16e25..2cd38352 100644 --- a/defaults.py +++ b/defaults.py @@ -112,8 +112,9 @@ class AppDefaults: "global_tpdf_rmargin": 20.0, # General GUI Preferences - "global_appearance": 'auto', - "global_dark_canvas": True, + "global_appearance": 'default', + "global_dark_canvas": False, + "global_theme": 'default', "global_layout": "compact", "global_hover_shape": False,