X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetCollapsable.cpp;h=d038cfc2813a8a277a2bd713555576c681646885;hb=dae8555234f0e5c8358b91c307d91b219c664617;hp=6c880cd514c53c4eeff51d38c114d34a2640516b;hpb=7287a259c5436b8f3f384c0d0bd7641a2f2601e9;p=lyx.git diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 6c880cd514..d038cfc281 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -173,7 +173,9 @@ void InsetCollapsable::read(Lexer & lex) Dimension InsetCollapsable::dimensionCollapsed(BufferView const & bv) const { Dimension dim; - theFontMetrics(getLayout().labelfont()).buttonText( + FontInfo labelfont(getLabelfont()); + labelfont.realize(sane_font); + theFontMetrics(labelfont).buttonText( buttonLabel(bv), dim.wid, dim.asc, dim.des); return dim; } @@ -184,7 +186,7 @@ void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const auto_open_[mi.base.bv] = mi.base.bv->cursor().isInside(this); FontInfo tmpfont = mi.base.font; - mi.base.font = getLayout().font(); + mi.base.font = getFont(); mi.base.font.realize(tmpfont); BufferView const & bv = *mi.base.bv; @@ -201,7 +203,7 @@ void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const case SubLabel: { InsetText::metrics(mi, dim); // consider width of the inset label - FontInfo font(getLayout().labelfont()); + FontInfo font(getLabelfont()); font.realize(sane_font); font.decSize(); font.decSize(); @@ -253,7 +255,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const auto_open_[&bv] = bv.cursor().isInside(this); FontInfo tmpfont = pi.base.font; - pi.base.font = getLayout().font(); + pi.base.font = getFont(); pi.base.font.realize(tmpfont); // Draw button first -- top, left or only @@ -267,7 +269,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const button_dim.y1 = y - dimc.asc; button_dim.y2 = y + dimc.des; - FontInfo labelfont = getLayout().labelfont(); + FontInfo labelfont = getLabelfont(); labelfont.setColor(labelColor()); pi.pain.buttonText(x, y, buttonLabel(bv), labelfont, mouse_hover_[&bv]); @@ -334,7 +336,7 @@ void InsetCollapsable::draw(PainterInfo & pi, int x, int y) const // the label below the text. Can be toggled. if (geometry(bv) == SubLabel) { - FontInfo font(getLayout().labelfont()); + FontInfo font(getLabelfont()); font.realize(sane_font); font.decSize(); font.decSize();