]> git.lyx.org Git - features.git/commitdiff
Set minimal width of fixedwidth collapsable insets.
authorPavel Sanda <sanda@lyx.org>
Wed, 7 Oct 2015 09:15:35 +0000 (02:15 -0700)
committerPavel Sanda <sanda@lyx.org>
Wed, 7 Oct 2015 09:15:35 +0000 (02:15 -0700)
Intention behind this is actually Box inset being too tiny
to reasonably contain other insets like ERT.

http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg188987.html

src/insets/InsetCollapsable.cpp

index 623cebbc77f15b907b57beb3a126a3eba7a2d92e..d656d7a29e65d0b3aaae6c20d0b4623f1d81baf4 100644 (file)
@@ -213,6 +213,11 @@ void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
        case TopButton:
        case LeftButton:
        case ButtonOnly:
+               if (hasFixedWidth()){
+                       const int mindim=button_dim.x2-button_dim.x1;
+                       if (mi.base.textwidth<mindim)
+                               mi.base.textwidth=mindim;
+               }
                dim = dimensionCollapsed(bv);
                if (geometry(bv) == TopButton 
                          || geometry(bv) == LeftButton) {