diff --git a/src/frontends/qt4/GuiPainter.cpp b/src/frontends/qt4/GuiPainter.cpp index f4bd49587c..fd2f96b39d 100644 --- a/src/frontends/qt4/GuiPainter.cpp +++ b/src/frontends/qt4/GuiPainter.cpp @@ -548,5 +548,24 @@ void GuiPainter::dashedUnderline(FontInfo const & f, int x, int y, int width) line(x, y + below + n, x + width, y + below + n, f.realColor(), line_onoffdash); } + +void GuiPainter::wavyHorizontalLine(int x, int y, int width, ColorCode col) +{ + setQPainterPen(computeColor(col)); + int const step = 4; + int const xend = x + width; + int height = 1; + //FIXME: I am not sure if Antialiasing gives the best effect. + //setRenderHint(Antialiasing, true); + while (x < xend) { + height = - height; + drawLine(x, y - height, x + step, y + height); + x += step; + drawLine(x, y + height, x + 2, y + height); + x += 2; + } + //setRenderHint(Antialiasing, false); +} + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt4/GuiPainter.h b/src/frontends/qt4/GuiPainter.h index fa87940d45..232798e11e 100644 --- a/src/frontends/qt4/GuiPainter.h +++ b/src/frontends/qt4/GuiPainter.h @@ -119,6 +119,8 @@ public: virtual int preeditText(int x, int y, char_type c, FontInfo const & f, preedit_style style); + void wavyHorizontalLine(int x, int y, int width, ColorCode col); + private: /// check the font, and if set, draw an underline void underline(FontInfo const & f,