X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetbutton.C;h=b171dc91012285ed9dea6f930bd58abfe237ddad;hb=4a5b7a5952ad2381fcdf4830511293e184c7c5a1;hp=c3b8907f6ea462826753dcbd49ef53606655a678;hpb=5f2e3c4c43f8e1736a2b7654595dfe6c175b4b3b;p=lyx.git diff --git a/src/insets/insetbutton.C b/src/insets/insetbutton.C index c3b8907f6e..b171dc9101 100644 --- a/src/insets/insetbutton.C +++ b/src/insets/insetbutton.C @@ -38,22 +38,12 @@ int InsetButton::ascent(BufferView * bv, LyXFont const &) const int descent; 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; } @@ -70,22 +60,12 @@ int InsetButton::descent(BufferView * bv, LyXFont const &) const int descent; 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; } @@ -102,22 +82,12 @@ int InsetButton::width(BufferView * bv, LyXFont const &) const int descent; 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; } @@ -134,27 +104,12 @@ void InsetButton::draw(BufferView * bv, LyXFont const &, 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 }