]> git.lyx.org Git - features.git/blobdiff - src/frontends/Painter.cpp
Move Color::color enum to ColorCode.h
[features.git] / src / frontends / Painter.cpp
index b5a6b48f04a33050aa549e5117a14c63e7a0999d..40930134c19cdf4cc1bda6893f6932c68f58d049 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "frontends/FontMetrics.h"
 
-#include "Color.h"
 #include "Font.h"
 
 using lyx::docstring;
@@ -29,27 +28,27 @@ namespace frontend {
 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;
@@ -58,11 +57,11 @@ void Painter::rectText(int x, int y,
        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);
@@ -97,17 +96,17 @@ int Painter::preeditText(int x, int y, char_type c,
        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;
        }