- some changes in the theme selection, added that the default situation is where no theme is applied

- some string changes
This commit is contained in:
Marius Stanciu
2022-04-18 22:22:47 +03:00
committed by Marius
parent 4226a1e84a
commit 00144bafa0
12 changed files with 53 additions and 43 deletions

View File

@@ -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'

View File

@@ -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())

View File

@@ -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()

View File

@@ -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')

View File

@@ -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'

View File

@@ -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'

View File

@@ -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)