Show custom text styles in status bar

Fixes bug #11951.
This commit is contained in:
Yuriy Skalko 2020-08-31 10:29:14 +03:00 committed by Jean-Marc Lasgouttes
parent 06855a66ca
commit b0db575dc1

View File

@ -1991,7 +1991,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(CursorData const & cur, bool devel_mode) const docstring Text::currentState(CursorData const & cur, bool devel_mode) const
{ {
LBUFERR(this == cur.text()); LBUFERR(this == cur.text());
@ -2021,7 +2021,7 @@ docstring Text::currentState(CursorData const & cur, bool devel_mode) const
os << bformat(_("Font: %1$s"), font.stateText(&buf.params())); os << bformat(_("Font: %1$s"), font.stateText(&buf.params()));
// The paragraph depth // The paragraph depth
int depth = cur.paragraph().getDepth(); int depth = par.getDepth();
if (depth > 0) if (depth > 0)
os << bformat(_(", Depth: %1$d"), depth); os << bformat(_(", Depth: %1$d"), depth);
@ -2049,6 +2049,11 @@ docstring Text::currentState(CursorData 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) { if (devel_mode) {
os << _(", Inset: ") << &cur.inset(); os << _(", Inset: ") << &cur.inset();
if (cur.lastidx() > 0) if (cur.lastidx() > 0)