X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FRenderButton.cpp;h=06fc653da731ae3cb8d7a2c8f062aecc7606a636;hb=1cdd5fcb6f76ef8066707c521eef0c01cead00dd;hp=2656bd453da578c310d1b3aa41ba535f8521688a;hpb=237c132c1e6fc720b87f2fea6deb18a8395cbe0a;p=lyx.git diff --git a/src/insets/RenderButton.cpp b/src/insets/RenderButton.cpp index 2656bd453d..06fc653da7 100644 --- a/src/insets/RenderButton.cpp +++ b/src/insets/RenderButton.cpp @@ -12,7 +12,6 @@ #include "RenderButton.h" -#include "Color.h" #include "MetricsInfo.h" #include "frontends/FontMetrics.h" @@ -42,7 +41,7 @@ void RenderButton::update(docstring const & text, bool editable) void RenderButton::metrics(MetricsInfo &, Dimension & dim) const { - Font font(Font::ALL_SANE); + FontInfo font = sane_font; font.decSize(); frontend::FontMetrics const & fm = theFontMetrics(font); @@ -52,7 +51,7 @@ void RenderButton::metrics(MetricsInfo &, Dimension & dim) const else fm.rectText(text_, dim.wid, dim.asc, dim.des); - dim.wid += 4; + dim.wid += 2; dim_ = dim; } @@ -60,15 +59,15 @@ void RenderButton::metrics(MetricsInfo &, Dimension & dim) const void RenderButton::draw(PainterInfo & pi, int x, int y) const { // Draw it as a box with the LaTeX text - Font font(Font::ALL_SANE); - font.setColor(Color::command); + FontInfo font = sane_font; + font.setColor(Color_command); font.decSize(); if (editable_) { - pi.pain.buttonText(x + 2, y, text_, font, renderState()); + pi.pain.buttonText(x + 1, y, text_, font, renderState()); } else { - pi.pain.rectText(x + 2, y, text_, font, - Color::commandbg, Color::commandframe); + pi.pain.rectText(x + 1, y, text_, font, + Color_commandbg, Color_commandframe); } }