X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetbutton.C;h=b171dc91012285ed9dea6f930bd58abfe237ddad;hb=4a5b7a5952ad2381fcdf4830511293e184c7c5a1;hp=617b2bf8200dba10272bf095ed2692842173e3bb;hpb=94c00c08a86bbe839d0d9f357a345c1f8250eafb;p=lyx.git diff --git a/src/insets/insetbutton.C b/src/insets/insetbutton.C index 617b2bf820..b171dc9101 100644 --- a/src/insets/insetbutton.C +++ b/src/insets/insetbutton.C @@ -36,24 +36,14 @@ int InsetButton::ascent(BufferView * bv, LyXFont const &) const int width; int ascent; int descent; - string const s = getScreenLabel(); + string const s = getScreenLabel(bv->buffer()); -#if 0 - if (editable()) { - bv->painter().buttonText(0, 0, s, font, - false, width, ascent, descent); - } else { - bv->painter().rectText(0, 0, s, font, - LColor::commandbg, LColor::commandframe, - false, width, ascent, descent); - } -#else if (editable()) { lyxfont::buttonText(s, font, width, ascent, descent); } else { lyxfont::rectText(s, font, width, ascent, descent); } -#endif + return ascent; } @@ -68,24 +58,14 @@ int InsetButton::descent(BufferView * bv, LyXFont const &) const int width; int ascent; int descent; - string const s = getScreenLabel(); + string const s = getScreenLabel(bv->buffer()); -#if 0 - if (editable()) { - bv->painter().buttonText(0, 0, s, font, - false, width, ascent, descent); - } else { - bv->painter().rectText(0, 0, s, font, - LColor::commandbg, LColor::commandframe, - false, width, ascent, descent); - } -#else if (editable()) { lyxfont::buttonText(s, font, width, ascent, descent); } else { lyxfont::rectText(s, font, width, ascent, descent); } -#endif + return descent; } @@ -100,24 +80,14 @@ int InsetButton::width(BufferView * bv, LyXFont const &) const int width; int ascent; int descent; - string const s = getScreenLabel(); + string const s = getScreenLabel(bv->buffer()); -#if 0 - if (editable()) { - bv->painter().buttonText(0, 0, s, font, - false, width, ascent, descent); - } else { - bv->painter().rectText(0, 0, s, font, - LColor::commandbg, LColor::commandframe, - false, width, ascent, descent); - } -#else if (editable()) { lyxfont::buttonText(s, font, width, ascent, descent); } else { lyxfont::rectText(s, font, width, ascent, descent); } -#endif + return width + 4; } @@ -132,29 +102,14 @@ void InsetButton::draw(BufferView * bv, LyXFont const &, LyXFont font(LyXFont::ALL_SANE); font.setColor(LColor::command).decSize(); - string const s = getScreenLabel(); + string const s = getScreenLabel(bv->buffer()); -#if 0 - int width; - if (editable()) { - pain.buttonText(int(x) + 2, baseline, s, font, true, width); - } else { - pain.rectText(int(x) + 2, baseline, s, font, - LColor::commandbg, LColor::commandframe, - true, width); - } -#else if (editable()) { pain.buttonText(int(x) + 2, baseline, s, font); } else { pain.rectText(int(x) + 2, baseline, s, font, LColor::commandbg, LColor::commandframe); } -#endif -#if 0 - x += width + 4; -#else x += width(bv, font); -#endif }