[LyX/master] Remove left/right spacing around top/left buttons
Jean-Marc Lasgouttes
lasgouttes at lyx.org
Wed Feb 10 09:19:30 UTC 2021
commit d2f23c303cc96e74fcec480f392f3dcce334ba8f
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date: Tue Feb 9 16:12:16 2021 +0100
Remove left/right spacing around top/left buttons
This makes collapsible insets look better.
Fixes #10323.
---
src/insets/InsetCollapsible.cpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/insets/InsetCollapsible.cpp b/src/insets/InsetCollapsible.cpp
index 24aca66..ac42e1d 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;
}
More information about the lyx-cvs
mailing list