- Painter & pain = bv->painter();
- LyXFont font(f);
- tmacro->update();
- if (opened) {
- tmacro->setEditMode(true);
- InsetFormula::draw(bv, font, baseline, x, cleared);
- tmacro->setEditMode(false);
- } else {
- font.setColor(LColor::math);
-
- int y = baseline - ascent(bv, font) + 1;
- int w = width(bv, font) - 2;
- int h = (ascent(bv, font) + descent(bv, font) - 2);
-
-
- pain.fillRectangle(int(x), y, w, h, LColor::mathbg);
- pain.rectangle(int(x), y, w, h, LColor::mathframe);
-
- string s(_("Macro: "));
- s += name;
- pain.text(int(x + 2), baseline, s, font);
- x += width(bv, font) - 1;
- }
+ par()->metrics(mi, dim_);
+ dim_.asc += 5;
+ dim_.des += 5;
+ dim_.wid += 10 + font_metrics::width(prefix(), mi.base.font);
+ dim = dim_;