]> git.lyx.org Git - features.git/commitdiff
Introduce semantic label colors
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 11 Dec 2020 10:44:45 +0000 (11:44 +0100)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 11 Dec 2020 10:44:45 +0000 (11:44 +0100)
This allows customization e.g. in dark mode and is a prerequisite
for color theming

Part of #8325

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

index 0a1edde4b89a76efbdd87d607a5f9a17423d736a..cc20a35b0ae43f762139e65e2ccb23ec30b14f09 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 = 89
+currentFormat = 90
 
 
 # Incremented to format 4, 6 April 2007, lasgouttes
@@ -304,6 +304,9 @@ currentFormat = 89
 # Incremented to format 89, 5 December 2020 by rkh
 # New tag LaTeXName for counters
 
+# Incremented to format 90, 11 December 2020 by spitz
+# Use semantic label colors
+
 # Do not forget to document format change in Customization
 # Manual (section "Declaring a new text class").
 
@@ -554,7 +557,7 @@ def convert(lines, end_format):
                 i += 1
             continue
 
-        if 87 <= format <= 89:
+        if 87 <= format <= 90:
             # nothing to do.
             i += 1
             continue
index 6c5260f750ada44a202ce3d4a6778717a63b5541..e68b8b4b31e605ef790922e11ee400e4153501aa 100644 (file)
@@ -254,6 +254,9 @@ ColorSet::ColorSet()
        { Color_selection, N_("selection"), "selection", "#add8e6", "selection" },
        { Color_selectiontext, N_("selected text"), "selectiontext", black, "selectiontext" },
        { Color_latex, N_("LaTeX text"), "latex", DarkRed, "latex" },
+       { Color_textlabel1, N_("Text label 1"), "textlabel1", blue, "textlabel1" },
+       { Color_textlabel2, N_("Text label 2"), "textlabel2", Green, "textlabel2" },
+       { Color_textlabel3, N_("Text label 3"), "textlabel3", magenta, "textlabel3" },
        { Color_inlinecompletion, N_("inline completion"),
                "inlinecompletion", grey60, "inlinecompletion" },
        { Color_nonunique_inlinecompletion, N_("non-unique inline completion"),
index 24d43428c01abf97f113e7398bdc168d1531d13e..9badae91b57a9f6cf0ffe1f7cab9bb24dcca49fa 100644 (file)
@@ -108,6 +108,13 @@ enum ColorCode {
        /// Label color for URL insets
        Color_urllabel,
 
+       /// Label color 1 for text (layout) labels
+       Color_textlabel1,
+       /// Label color 2 for text (layout) labels
+       Color_textlabel2,
+       /// Label color 3 for text (layout) labels
+       Color_textlabel3,
+
        /// Color for URL inset text
        Color_urltext,
 
index 5b69be6ae1a52ba40d5bcb94c9de44b88ec70398..9a8db85502daeba297ebd526902739824814001f 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 = 89; // rkh: LaTeXName for counters
+int const LAYOUT_FORMAT = 90; // spitz: semantic label colors
 
 
 // Layout format for the current lyx file format. Controls which format is