From: Jean-Marc Lasgouttes Date: Wed, 15 Mar 2006 15:32:32 +0000 (+0000) Subject: fix drawing of buttons (bug 2328) X-Git-Tag: 1.6.10~13505 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=4b7512f767d7a0ae96743cb9b72612af17dc8040;p=lyx.git fix drawing of buttons (bug 2328) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13381 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index c361894bf6..22b3998923 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,10 @@ +2006-03-15 Jean-Marc Lasgouttes + + * Painter.h (fillPolygon): mark as unused. + + * Painter.C (buttonFrame): draw lines instead of trapezoids; it is + simpler and fixes drawing with Qt frontend (bug 2328). + 2005-08-02 Martin Vermeer * LyXView.C (updateInset): scroll bar fix diff --git a/src/frontends/Painter.C b/src/frontends/Painter.C index 6650722fca..096e4abfd6 100644 --- a/src/frontends/Painter.C +++ b/src/frontends/Painter.C @@ -35,22 +35,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); + } } diff --git a/src/frontends/Painter.h b/src/frontends/Painter.h index 4dfc02331c..c5eaa2d958 100644 --- a/src/frontends/Painter.h +++ b/src/frontends/Painter.h @@ -110,7 +110,7 @@ public: int w, int h, LColor_color) = 0; - /// draw a filled (irregular) polygon + /// draw a filled (irregular) polygon (UNUSED, could be removed) virtual void fillPolygon( int const * xp, int const * yp,