+ setPosCache(pi, x, y);
+
+ LyXFont tmpfont = pi.base.font;
+ getDrawFont(pi.base.font);
+ // I don't understand why the above .reduce and .realize aren't
+ //needed, or even wanted, here. It just works. -- MV 10.04.2005
+ InsetText::draw(pi, x, y);
+ pi.base.font = tmpfont;
+
+ int desc = InsetText::descent();
+ if (params_.show_label)
+ desc -= ascent();
+
+ pi.pain.line(x, y + desc - 4, x, y + desc, params_.labelfont.color());
+ pi.pain.line(x, y + desc, x + dim_.wid - 3, y + desc,
+ params_.labelfont.color());
+ pi.pain.line(x + dim_.wid - 3, y + desc, x + dim_.wid - 3, y + desc - 4,
+ params_.labelfont.color());
+
+ // the name of the charstyle. Can be toggled.
+ if (params_.show_label) {
+ LyXFont font(params_.labelfont);
+ font.realize(LyXFont(LyXFont::ALL_SANE));
+ font.decSize();
+ font.decSize();
+ int w = 0;
+ int a = 0;
+ int d = 0;
+ // FIXME UNICODE
+ docstring s(from_utf8(params_.type));
+ if (undefined())
+ s = _("Undef: ") + s;
+ theFontMetrics(font).rectText(s, w, a, d);
+ pi.pain.rectText(x + (dim_.wid - w) / 2, y + desc + a,
+ s, font, LColor::none, LColor::none);
+ }
+
+ // a visual clue when the cursor is inside the inset
+ LCursor & cur = pi.base.bv->cursor();
+ if (cur.isInside(this)) {
+ y -= ascent();
+ pi.pain.line(x, y + 4, x, y, params_.labelfont.color());
+ pi.pain.line(x + 4, y, x, y, params_.labelfont.color());
+ pi.pain.line(x + dim_.wid - 3, y + 4, x + dim_.wid - 3, y,
+ params_.labelfont.color());
+ pi.pain.line(x + dim_.wid - 7, y, x + dim_.wid - 3, y,
+ params_.labelfont.color());
+ }