[LyX/master] Change preedit color settings

Koji Yokota yokota6 at gmail.com
Sun Jul 19 02:35:36 UTC 2026


> 2026/07/17 2:27、Jürgen Spitzmüller <jspitzm at gmail.com>のメール:
> 
> Am Donnerstag, dem 16.07.2026 um 23:13 +0900 schrieb Koji Yokota:
>> But preview still picks up the workarea background even though png’s
>> background is transparent.
> 
> Yes, as I wrote. This should probably be fixed in PreviewLoader or
> somewhere related.
> 
> Note further, if this is done, the foreground color will need to be
> adapted as well to get proper contrast (as we do in the workarea).

Thanks, Jürgen. The attached is the candidate of the fix. If there is no problems, I’m going to commit it to master.

Additional part from the previous patch is as below. Adjustment of foreground color is also working.

BTW, I noticed two things, which may or may not be related to the introduction of color themes, which I’m going to check:

	- Role of “text (inverted background)” is different between the default
	  and the other themes in the dark mode. Default picks its “Light” color,
	  whereas other themes picks up its “Dark” color.
	- Text color in LyX comment stays black in the dark mode. But this
	  doesn’t seem to apply to user color themes.

Koji

------ (new change) ------
diff --git a/src/Color.cpp b/src/Color.cpp
index 5fd774afa8..1ca2c0ced3 100644
--- a/src/Color.cpp
+++ b/src/Color.cpp
@@ -299,6 +299,7 @@ ColorSet::ColorSet()
    { Color_none, N_("none"), "none", black, black, "none" },
    { Color_black, N_("black"), "black", black, black, "black" },
    { Color_white, N_("white"), "white", white, white, "white" },
+   { Color_transparent, N_("transparent"), "transparent", transparent, transparent, "transparent" },
    { Color_blue, N_("blue"), "blue", blue, blue, "blue" },
    { Color_brown, N_("brown"), "brown", brown, brown, "brown" },
    { Color_cyan, N_("cyan"), "cyan", cyan, cyan, "cyan" },
diff --git a/src/ColorCode.h b/src/ColorCode.h
index 3492498746..d101b43d62 100644
--- a/src/ColorCode.h
+++ b/src/ColorCode.h
@@ -21,6 +21,8 @@ enum ColorCode {
    ///
    Color_white,
    ///
+   Color_transparent,
+   ///
    Color_blue,
    ///
    Color_brown,
diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 9ba086a715..96fa9a42c3 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -615,7 +615,7 @@ ColorCode InsetMathHull::backgroundColor(PainterInfo const & pi) const
        Dimension const dim = dimension(*pi.base.bv);
        if (previewTooSmall(dim))
            return Color_error;
-       return graphics::PreviewLoader::backgroundColor();
+       return Color_transparent;
    }
    return InsetMath::backgroundColor(pi);
 }

-------------- next part --------------
A non-text attachment was scrubbed...
Name: preview.candidate.patch
Type: application/octet-stream
Size: 3627 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20260719/67c77e4c/attachment.obj>


More information about the lyx-devel mailing list