dim = dimensionCollapsed();
if (status() == Open) {
InsetText::metrics(mi, textdim_);
- openinlined_ = textdim_.wid + 2 * dim.wid <= mi.base.textwidth;
+ // This expression should not contain mi.base.texwidth
+ openinlined_ = textdim_.wid < 0.5 * mi.base.bv->workWidth();
if (openinlined_) {
// Correct for button width, and re-fit
mi.base.textwidth -= dim.wid;
tabular.getCellInset(cell)->metrics(m, dim);
if (!p_width.zero())
dim.wid = m.base.textwidth;
+ tabular.setWidthOfCell(cell, dim.wid);
+ if (p_width.zero()) {
+ m.base.textwidth = dim.wid + 2 * ADD_TO_TABULAR_WIDTH;
+ // FIXME there must be a way to get rid of
+ // the second metrics call
+ tabular.getCellInset(cell)->metrics(m, dim);
+ }
maxAsc = max(maxAsc, dim.asc);
maxDesc = max(maxDesc, dim.des);
- tabular.setWidthOfCell(cell, dim.wid);
++cell;
}
int const top_space = tabular.row_info[i].top_space_default ?