#include "frontends/FontMetrics.h"
-#include "Color.h"
#include "Font.h"
using lyx::docstring;
void Painter::button(int x, int y, int w, int h, bool mouseHover)
{
if (mouseHover)
- fillRectangle(x, y, w, h, Color::buttonhoverbg);
+ fillRectangle(x, y, w, h, Color_buttonhoverbg);
else
- fillRectangle(x, y, w, h, Color::buttonbg);
+ fillRectangle(x, y, w, h, Color_buttonbg);
buttonFrame(x, y, w, h);
}
void Painter::buttonFrame(int x, int y, int w, int h)
{
- line(x, y, x, y + h - 1, Color::buttonframe);
- line(x - 1 + w, y, x - 1 + w, y + h - 1, Color::buttonframe);
- line(x, y - 1, x - 1 + w, y - 1, Color::buttonframe);
- line(x, y + h - 1, x - 1 + w, y + h - 1, Color::buttonframe);
+ line(x, y, x, y + h - 1, Color_buttonframe);
+ line(x - 1 + w, y, x - 1 + w, y + h - 1, Color_buttonframe);
+ line(x, y - 1, x - 1 + w, y - 1, Color_buttonframe);
+ line(x, y + h - 1, x - 1 + w, y + h - 1, Color_buttonframe);
}
void Painter::rectText(int x, int y,
docstring const & str,
Font const & font,
- Color_color back,
- Color_color frame)
+ ColorCode back,
+ ColorCode frame)
{
int width;
int ascent;
FontMetrics const & fm = theFontMetrics(font);
fm.rectText(str, width, ascent, descent);
- if (back != Color::none)
+ if (back != Color_none)
fillRectangle(x + 1, y - ascent + 1, width - 1,
ascent + descent - 1, back);
- if (frame != Color::none)
+ if (frame != Color_none)
rectangle(x, y - ascent, width, ascent + descent, frame);
text(x + 3, y, str, font);
switch (style) {
case preedit_default:
// default unselecting mode.
- fillRectangle(x, y - height + 1, width, height, Color::background);
+ fillRectangle(x, y - height + 1, width, height, Color_background);
dashedUnderline(font, x, y - descent + 1, width);
break;
case preedit_selecting:
// We are in selecting mode: white text on black background.
- fillRectangle(x, y - height + 1, width, height, Color::black);
- temp_font.setColor(Color::white);
+ fillRectangle(x, y - height + 1, width, height, Color_black);
+ temp_font.setColor(Color_white);
break;
case preedit_cursor:
// The character comes with a cursor.
- fillRectangle(x, y - height + 1, width, height, Color::background);
+ fillRectangle(x, y - height + 1, width, height, Color_background);
underline(font, x, y - descent + 1, width);
break;
}