Am Freitag, dem 29.09.2023 um 15:11 +0200 schrieb Jürgen Spitzmüller:
> Or maybe introduce a Color_selectionmath. I think this could be
> easily implemented for 2.4 without having to fear collateral effects.

Like this. Involves a new string, tough. And it only works for fully
selected math insets, not for parts of it. Don't know where to set the
latter.

-- 
Jürgen
diff --git a/src/Color.cpp b/src/Color.cpp
index 3b9e68ebd1..23e40a9c94 100644
--- a/src/Color.cpp
+++ b/src/Color.cpp
@@ -264,6 +264,7 @@ ColorSet::ColorSet()
 	{ Color_background, N_("background"), "background", Linen, black, "background" },
 	{ Color_foreground, N_("text"), "foreground", black, Linen, "foreground" },
 	{ Color_selection, N_("selection"), "selection", "#add8e6", "#add8e6", "selection" },
+	{ Color_selectionmath, N_("selected math"), "selectionmath", "#00008B", "#00008B", "selectionmath" },
 	{ Color_selectiontext, N_("selected text"), "selectiontext", black, black, "selectiontext" },
 	{ Color_latex, N_("LaTeX text"), "latex", DarkRed, "#D66613", "latex" },
 	{ Color_textlabel1, N_("Text label 1"), "textlabel1", blue, "#86a4ff", "textlabel1" },
diff --git a/src/ColorCode.h b/src/ColorCode.h
index 3439c28727..9b26e7219c 100644
--- a/src/ColorCode.h
+++ b/src/ColorCode.h
@@ -65,6 +65,8 @@ enum ColorCode {
 	Color_foreground,
 	/// Background color of selected text
 	Color_selection,
+	/// Foreground color of selected math
+	Color_selectionmath,
 	/// Foreground color of selected text
 	Color_selectiontext,
 	/// Text color in LaTeX mode
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index d2c2159167..9415200f2f 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -697,8 +697,9 @@ void InsetMathHull::draw(PainterInfo & pi, int x, int y) const
 	}
 
 	// Then the equations
-	ColorCode color = pi.selected && lyxrc.use_system_colors
-		? Color_selectiontext : standardColor();
+	ColorCode color = pi.selected
+		? (lyxrc.use_system_colors ? Color_selectiontext : Color_selectionmath)
+		: standardColor();
 	bool const really_change_color = pi.base.font.color() == Color_none;
 	Changer dummy0 = really_change_color ? pi.base.font.changeColor(color)
 		: noChange();

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to