Hi,

we currently rescale box inset on the screen accordingly to its output size.
This creates troubles if you use very thin boxes (I often need to include ERT,
so with single-char width of box it visually ends up as ten lines of single
char per line). 
Is there any objection to setting up some minimal box-size limit for the screen?

Patch could be something along the lines below, where min width is set to 
collapsable
button on top of the inset.

Pavel
diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp
index 08f950b..2e0edd5 100644
--- a/src/insets/InsetBox.cpp
+++ b/src/insets/InsetBox.cpp
@@ -171,6 +171,9 @@ void InsetBox::metrics(MetricsInfo & m, Dimension & dim) 
const
        int textwidth_backup = m.base.textwidth;
        if (hasFixedWidth())
                m.base.textwidth = params_.width.inPixels(m.base.textwidth);
+       int mindim=button_dim.x2-button_dim.x1;
+       if (m.base.textwidth<mindim)
+                m.base.textwidth=mindim;
        InsetCollapsable::metrics(m, dim);
        // retore textwidth.
        m.base.textwidth = textwidth_backup;
diff --git a/src/insets/InsetCollapsable.h b/src/insets/InsetCollapsable.h
index fba355a..6608ca8 100644
--- a/src/insets/InsetCollapsable.h
+++ b/src/insets/InsetCollapsable.h
@@ -156,13 +156,13 @@ protected:
        Inset * editXY(Cursor & cur, int x, int y);
        ///
        mutable CollapseStatus status_;
+       ///
+       mutable Box button_dim;
 private:
        ///
        Dimension dimensionCollapsed(BufferView const & bv) const;
        ///
        docstring labelstring_;
-       ///
-       mutable Box button_dim;
        /// a substatus of the Open status, determined automatically in metrics
        mutable bool openinlined_;
        /// the inset will automatically open when the cursor is inside. This is

Reply via email to