]> git.lyx.org Git - features.git/commitdiff
Painter::wavyHorizontalLine(): new method for inline spellcheck purpose.
authorAbdelrazak Younes <younes@lyx.org>
Sat, 28 Mar 2009 16:37:28 +0000 (16:37 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 28 Mar 2009 16:37:28 +0000 (16:37 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28961 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiPainter.cpp
src/frontends/qt4/GuiPainter.h

index f4bd49587c5445aad8c4d0c85f08dcb8bf6b0e8d..fd2f96b39db0ebd17389dde96d03e0d3234ffd16 100644 (file)
@@ -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
index fa87940d45ed0174d26ef158642b15ab55e82155..232798e11ea594972a81373236d4c1242b7705ec 100644 (file)
@@ -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,