diff libgui/src/workspace-model.cc @ 29487:00674bc1446d

provide second color mode for workspace view * gui-preferences-ws.h: using the extensions for color preference keys of different color modes, define the keys for new mode, define preference for the selected modes * gui-settings.cc: slightly change the way for inverting the lightness of the default color * gui-settings.h: update the text and tooltip of the color mode checkbox * settings-dialog.cc (read_workspace_colors): add checkbox for second color mode, connect trigger signal of this checkbox to new slot update_workspace_colors, use new method color_value for reading colors from the settings; (update_workspace_colors): slot for updating the current color picker colors depending on selected color mode; (write_workspace_colors): use new method set_color_value for writing colors to settings depending on color mode; (read_terminal_colors): read integer from color mode settings, not boolean; (write_terminal_colors): test if check box was really found * settings-dialog.h: new slot update_workspace_colors * workspace-model.cc (notice_settings): get colors with new method color_value from gui_settings
author Torsten Lilge <ttl-octave@mailbox.org>
date Sat, 03 Apr 2021 08:26:30 +0200
parents 0a5b15007766
children 8ba6f4d0373c
line wrap: on
line diff
--- a/libgui/src/workspace-model.cc	Fri Apr 02 17:02:36 2021 +0200
+++ b/libgui/src/workspace-model.cc	Sat Apr 03 08:26:30 2021 +0200
@@ -200,10 +200,11 @@
   {
     m_enable_colors = settings->value (ws_enable_colors).toBool ();
 
+    int mode = settings->value (ws_color_mode).toInt ();
+
     for (int i = 0; i < ws_colors_count; i++)
       {
-        QColor setting_color = settings->value (ws_colors[i].key,
-                                                ws_colors[i].def).value<QColor> ();
+        QColor setting_color = settings->color_value (ws_colors[i], mode);
 
         QPalette p (setting_color);
         m_storage_class_colors.replace (i,setting_color);