Remove left/right spacing around top/left buttons

This makes collapsible insets look better.

Fixes #10323.
This commit is contained in:
Jean-Marc Lasgouttes 2021-02-09 16:12:16 +01:00
parent c2822d684b
commit d2f23c303c

View File

@ -187,9 +187,12 @@ Dimension InsetCollapsible::dimensionCollapsed(BufferView const & bv) const
{
Dimension dim;
FontInfo labelfont(getLabelfont());
int const offset =
(geometry(bv) != LeftButton && geometry(bv) != TopButton)
? Inset::textOffset(&bv) : 0;
labelfont.realize(sane_font);
theFontMetrics(labelfont).buttonText(
buttonLabel(bv), Inset::textOffset(&bv), dim.wid, dim.asc, dim.des);
buttonLabel(bv), offset, dim.wid, dim.asc, dim.des);
return dim;
}