diff libgui/src/m-editor/file-editor-tab.cc @ 31304:d3231a604a62

re-enable user preferences for current editor line color (bug #62984) * gui-preferences-ed.h: include gui-settings instead of gui-preferences, new gui-pref for current line color with magenta as default for automatic computation of the color * gui-settings.h: more detailed comment for settings_color_no_change * file-editor-tab.cc (update_lexer_settings): compute and/or set current line color depending on color mode and user preference * settings-dialog.cc (settings_dialog): rename ed_mode in mode, add and initialize color picker for current line color; (update_editor_lexers): get current color for new color picker; (write_lexer_settings): read value from color picker and wirte it to file * settings-dialog.ui: update layouts for including new color picker
author Torsten Lilge <ttl-octave@mailbox.org>
date Sat, 15 Oct 2022 13:34:05 +0200
parents c6c4c6f04170
children 5cc53fd090c3
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor-tab.cc	Fri Oct 14 13:06:43 2022 -0400
+++ b/libgui/src/m-editor/file-editor-tab.cc	Sat Oct 15 13:34:05 2022 +0200
@@ -907,7 +907,13 @@
     m_edit_area->setMarginsBackgroundColor (bgm);
     m_edit_area->setFoldMarginColors (bgm, fgm);
 
-    bgm = interpolate_color (bg, fg, 0.5, 0.1);
+    QColor current_line_bg
+      = settings->color_value (ed_highlight_current_line_color, mode);
+    if (current_line_bg == settings_color_no_change)
+       bgm = interpolate_color (bg, fg, 0.5, 0.1);  // It is the "auto" color
+     else
+       bgm = current_line_bg;  // Specific color given
+
     m_edit_area->setCaretLineBackgroundColor (bgm);
 
     // color indicator for highlighting all occurrences: