false by default.
(metrics): do not set to openinlined if
hasFixedWidth is true.
* insetbox.C (hasFixedWidth): returns true if the box has a fixed
width.
(metrics): use hasFixedWidth.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16426
a592a061-630c-0410-9148-
cb99ea01b6c8
}
+bool InsetBox::hasFixedWidth() const
+{
+ return params_.inner_box || params_.special != "width";
+}
+
+
bool InsetBox::metrics(MetricsInfo & m, Dimension & dim) const
{
MetricsInfo mi = m;
- if (params_.inner_box || params_.special != "width")
+ if (hasFixedWidth())
mi.base.textwidth = params_.width.inPixels(m.base.textwidth);
InsetCollapsable::metrics(mi, dim);
bool const changed = dim_ != dim;
protected:
InsetBox(InsetBox const &);
virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
+ /// Is the width forced to some value?
+ virtual bool hasFixedWidth() const;
private:
friend class InsetBoxParams;
if (status() == Open) {
InsetText::metrics(mi, textdim_);
// This expression should not contain mi.base.texwidth
- openinlined_ = textdim_.wid < 0.5 * mi.base.bv->workWidth();
+ openinlined_ = !hasFixedWidth()
+ && textdim_.wid < 0.5 * mi.base.bv->workWidth();
if (openinlined_) {
// Correct for button width, and re-fit
mi.base.textwidth -= dim.wid;
InsetBase * editXY(LCursor & cur, int x, int y);
///
void setInlined() { status_ = Inlined; }
+ /// Is the width forced to some value?
+ virtual bool hasFixedWidth() const { return false; }
///
docstring floatName(std::string const & type, BufferParams const &);