]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Painter.C
Extracted from r14281
[lyx.git] / src / frontends / Painter.C
index 6650722fcacb2ff2557c9a87d7ff5a4d19cb9f33..a3b14ff624b0bb1606492a9809e4820f6b4e9ceb 100644 (file)
@@ -13,7 +13,6 @@
 
 #include "Painter.h"
 #include "font_metrics.h"
-#include "WorkArea.h"
 
 #include "LColor.h"
 #include "lyxfont.h"
@@ -21,6 +20,8 @@
 using std::max;
 using std::string;
 
+namespace lyx {
+namespace frontend {
 
 void Painter::button(int x, int y, int w, int h)
 {
@@ -35,22 +36,14 @@ void Painter::buttonFrame(int x, int y, int w, int h)
        int const d = 2;
 
        fillRectangle(x, y, w, d, LColor::top);
-       fillRectangle(x, (y + h - d), w, d, LColor::bottom);
-
-       // Now a couple of trapezoids
-       int x1[4], y1[4];
-
-       x1[0] = x + d;   y1[0] = y + d;
-       x1[1] = x + d;   y1[1] = y + h - d;
-       x1[2] = x;       y1[2] = y + h;
-       x1[3] = x;       y1[3] = y;
-       fillPolygon(x1, y1, 4, LColor::left);
-
-       x1[0] = x + w - d;  y1[0] = y + d;
-       x1[1] = x + w - d;  y1[1] = y + h - d;
-       x1[2] = x + w;      y1[2] = y + h - d;
-       x1[3] = x + w;      y1[3] = y;
-       fillPolygon(x1, y1, 4, LColor::right);
+       fillRectangle(x, y + h - d, w, d, LColor::bottom);
+
+       for (int i = 0 ; i < d ; ++i) {
+               line(x + i, y + i,
+                    x + i, y + h - 1 - i, LColor::left);
+               line(x + w - 1 - i, y + i + 1,
+                    x + w - 1 - i, y + h - 1 - i, LColor::right);
+       }
 }
 
 
@@ -100,3 +93,6 @@ void Painter::underline(LyXFont const & f, int x, int y, int width)
        else
                fillRectangle(x, y + below, width, below + height, f.color());
 }
+
+} // namespace frontend
+} // namespace lyx