From d2f23c303cc96e74fcec480f392f3dcce334ba8f Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 9 Feb 2021 16:12:16 +0100 Subject: [PATCH] Remove left/right spacing around top/left buttons This makes collapsible insets look better. Fixes #10323. --- src/insets/InsetCollapsible.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetCollapsible.cpp b/src/insets/InsetCollapsible.cpp index 24aca66945..ac42e1d265 100644 --- a/src/insets/InsetCollapsible.cpp +++ b/src/insets/InsetCollapsible.cpp @@ -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; } -- 2.39.5