From: Enrico Forestieri Date: Tue, 9 May 2023 09:33:13 +0000 (+0200) Subject: Use black as default color for an inset button label text X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ee9fca42bbbc5422e3f36cfe763b437ceeae1a94;p=features.git Use black as default color for an inset button label text 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 --- diff --git a/lib/scripts/layout2layout.py b/lib/scripts/layout2layout.py index a8c0ded990..e718017cbe 100644 --- a/lib/scripts/layout2layout.py +++ b/lib/scripts/layout2layout.py @@ -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 diff --git a/src/Color.cpp b/src/Color.cpp index bd30ddc3d6..3b9e68ebd1 100644 --- a/src/Color.cpp +++ b/src/Color.cpp @@ -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" }, diff --git a/src/ColorCode.h b/src/ColorCode.h index 17f759745b..3439c28727 100644 --- a/src/ColorCode.h +++ b/src/ColorCode.h @@ -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, diff --git a/src/TextClass.cpp b/src/TextClass.cpp index 56054180a0..3db75c1847 100644 --- a/src/TextClass.cpp +++ b/src/TextClass.cpp @@ -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 diff --git a/src/insets/InsetLayout.h b/src/insets/InsetLayout.h index 5de781d517..4bf84c64a5 100644 --- a/src/insets/InsetLayout.h +++ b/src/insets/InsetLayout.h @@ -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);