]> git.lyx.org Git - features.git/commitdiff
Show custom text styles in status bar
authorYuriy Skalko <yuriy.skalko@gmail.com>
Mon, 31 Aug 2020 07:29:14 +0000 (10:29 +0300)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 16 Sep 2020 16:43:23 +0000 (18:43 +0200)
Fixes bug #11951.

(cherry picked from commit b0db575dc1bcd08efb5b1289204326a3391de798)

src/Text.cpp
status.23x

index 0c27d51fa2e51f1eeffa77ec4c348252d760254b..8337e6db4f9bacf13809d626aed7aa90bd9c23d8 100644 (file)
@@ -1898,7 +1898,7 @@ bool Text::read(Lexer & lex,
 }
 
 
-// Returns the current font and depth as a message.
+// Returns the current state (font, depth etc.) as a message for status bar.
 docstring Text::currentState(Cursor const & cur, bool devel_mode) const
 {
        LBUFERR(this == cur.text());
@@ -1928,7 +1928,7 @@ docstring Text::currentState(Cursor const & cur, bool devel_mode) const
        os << bformat(_("Font: %1$s"), font.stateText(&buf.params()));
 
        // The paragraph depth
-       int depth = cur.paragraph().getDepth();
+       int depth = par.getDepth();
        if (depth > 0)
                os << bformat(_(", Depth: %1$d"), depth);
 
@@ -1956,6 +1956,11 @@ docstring Text::currentState(Cursor const & cur, bool devel_mode) const
                }
        }
 
+       // Custom text style
+       InsetLayout const & layout = cur.inset().getLayout();
+       if (layout.lyxtype() == InsetLayout::CHARSTYLE)
+               os << _(", Style: ") << translateIfPossible(layout.labelstring());
+
        if (devel_mode) {
                os << _(", Inset: ") << &cur.inset();
                os << _(", Paragraph: ") << cur.pit();
index 295286c2fb3b6cae865f4fee446341133963e2ca..57da79c4e526bb5698a432df7b1d45bc9ba57ede 100644 (file)
@@ -37,6 +37,8 @@ What's new
 - Update autocorrect in mathed so that pressing '*' after a delimiter will
   cycle through all sizes.
 
+- Display character styles along with fonts in status bar (bug 11951).
+
 
 * MISCELLANEOUS