Set minimal width of fixedwidth collapsable insets.

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
This commit is contained in:
Pavel Sanda 2015-10-07 02:15:35 -07:00
parent 68be651e89
commit 7a5eff56b0

View File

@ -213,6 +213,11 @@ void InsetCollapsable::metrics(MetricsInfo & mi, Dimension & dim) const
case TopButton: case TopButton:
case LeftButton: case LeftButton:
case ButtonOnly: 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); dim = dimensionCollapsed(bv);
if (geometry(bv) == TopButton if (geometry(bv) == TopButton
|| geometry(bv) == LeftButton) { || geometry(bv) == LeftButton) {