]> git.lyx.org Git - features.git/commitdiff
Use black as default color for an inset button label text
authorEnrico Forestieri <forenr@lyx.org>
Tue, 9 May 2023 09:33:13 +0000 (11:33 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Tue, 9 May 2023 09:33:13 +0000 (11:33 +0200)
It turns out that LyX was using red as default color for the
inset button text since ever. However, due to the use of "inherit",
the default button text color was black in practice. This was so
until [897ee2ed/lyxgit], which made the label font not inherited
by default anymore. Hence, all insets that didn't specify a specific
label button color started using red as default color.

This commit restores the previous behavior and introduces the
possibility of modifying this default color.

Fixes bug #12771

lib/scripts/layout2layout.py
src/Color.cpp
src/ColorCode.h
src/TextClass.cpp
src/insets/InsetLayout.h

index a8c0ded990a21ab2f6ed1428d8d198a0c5d5cb11..e718017cbeda8346cb138416578be10a8c94ae31 100644 (file)
@@ -11,7 +11,7 @@
 # This script will update a .layout file to current format
 
 # The latest layout format is also defined in src/TextClass.cpp
-currentFormat = 99
+currentFormat = 100
 
 
 # Incremented to format 4, 6 April 2007, lasgouttes
@@ -334,6 +334,9 @@ currentFormat = 99
 # Incremented to format 99, 22 December 2022 by tcuvelier
 # Add DocBookGenerateTitle for Layout
 
+# Incremented to format 100, 9 May 2023 by forenr
+# Add inset label color
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
@@ -580,7 +583,7 @@ def convert(lines, end_format):
                 i += 1
             continue
 
-        if 87 <= format <= 98:
+        if 87 <= format <= 100:
             # nothing to do.
             i += 1
             continue
index bd30ddc3d6467d858036dfc73034cfdf859f72d4..3b9e68ebd1959d78537a838996f7d73d1f0aec69 100644 (file)
@@ -318,6 +318,7 @@ ColorSet::ColorSet()
        { Color_collapsible, N_("collapsible inset text"), "collapsible", DarkRed, DarkRed, "collapsible" },
        { Color_collapsibleframe, N_("collapsible inset frame"), "collapsibleframe", IndianRed, IndianRed, "collapsibleframe" },
        { Color_insetbg, N_("inset background"), "insetbg", grey80, grey80, "insetbg" },
+       { Color_insetlabel, N_("inset label"), "insetlabel", black, black, "insetlabel" },
        { Color_insetframe, N_("inset frame"), "insetframe", IndianRed, IndianRed, "insetframe" },
        { Color_error, N_("LaTeX error"), "error", red, DarkRed, "error" },
        { Color_eolmarker, N_("end-of-line marker"), "eolmarker", Brown, Brown, "eolmarker" },
index 17f759745b2617793db4ac707ca2ea872bb89a19..3439c287277c6beda78f7922600b5c2567cdf596 100644 (file)
@@ -171,6 +171,8 @@ enum ColorCode {
        Color_insetbg,
        /// Inset marker frame color
        Color_insetframe,
+       /// Inset marker label color
+       Color_insetlabel,
 
        /// Error box text color
        Color_error,
index 56054180a041804e23665e275fb8e7171c7d1ce6..3db75c1847c0cd35682013a98b410f437b9421ef 100644 (file)
@@ -59,7 +59,7 @@ namespace lyx {
 // You should also run the development/tools/updatelayouts.py script,
 // to update the format of all of our layout files.
 //
-int const LAYOUT_FORMAT = 99; // tcuvelier: add docbookgeneratetitle
+int const LAYOUT_FORMAT = 100; // forenr: add inset label color
 
 
 // Layout format for the current lyx file format. Controls which format is
index 5de781d517d6a999abc07bc9eb64242d094ce253..4bf84c64a5b1ed3fe7999bea7d31a7554adb0c50 100644 (file)
@@ -55,7 +55,7 @@ enum class InsetLaTeXType : int {
 class InsetLayout {
 public:
        ///
-       InsetLayout() { labelfont_.setColor(Color_error); }
+       InsetLayout() { labelfont_.setColor(Color_insetlabel); }
        ///
        bool read(Lexer & lexrc, TextClass const & tclass,
                        bool validating = false);