]> git.lyx.org Git - lyx.git/commitdiff
Take label width into account for SubLabel insets
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 15 Dec 2020 14:25:07 +0000 (15:25 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 17 Dec 2020 09:29:52 +0000 (10:29 +0100)
The drawing of the label should not go further than inset width.

Fixes bug #12046.

(cherry picked from commit 3950f054977c60cdbf73c805cbd898003974aaee)

src/insets/InsetCollapsible.cpp
status.23x

index 3a2a9a56465084731ed72e72d6f6af47161ac8c7..81b456112a16e03598cbc873b230ef38c40faeeb 100644 (file)
@@ -184,6 +184,7 @@ void InsetCollapsible::metrics(MetricsInfo & mi, Dimension & dim) const
                int d = 0;
                theFontMetrics(font).rectText(buttonLabel(bv), w, a, d);
                dim.des += a + d;
+               dim.wid = max(dim.wid, w);
                break;
                }
        case TopButton:
index d9c81fb531999bf118caba104c1f5820fd24a611..4f282fa68bf2226d20f149b4403bf6fe09d67c43 100644 (file)
@@ -62,6 +62,8 @@ What's new
 
 - Do not close spellchecker after "Replace All" action (bug 11310).
 
+- Fix width of collapsible insets with sublabels (bug 12046).
+
 
 * INTERNALS