From 85d87c0a46e834389f5d7c8bd52ff5e32a6092c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20K=C3=BCmmel?= Date: Tue, 7 Sep 2010 05:14:57 +0000 Subject: [PATCH] use one place to adjust width of thin lines git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35302 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/Painter.h | 7 ++++--- src/frontends/qt4/GuiPainter.cpp | 4 +++- src/frontends/qt4/GuiPainter.h | 8 ++++---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/frontends/Painter.h b/src/frontends/Painter.h index 31bb2405fd..8bbda37701 100644 --- a/src/frontends/Painter.h +++ b/src/frontends/Painter.h @@ -57,6 +57,7 @@ public: Painter() : drawing_enabled_(true) {} float line_width; + static const float thin_line; /// possible line styles enum line_style { @@ -76,7 +77,7 @@ public: /// draw a line from point to point virtual void line(int x1, int y1, int x2, int y2, Color, - line_style = line_solid, float line_width = 0.5) = 0; + line_style = line_solid, float line_width = thin_line) = 0; /** * lines - draw a set of lines @@ -85,11 +86,11 @@ public: * @param np size of the points array */ virtual void lines(int const * xp, int const * yp, int np, Color, - line_style = line_solid, float line_width = 0.5) = 0; + line_style = line_solid, float line_width = thin_line) = 0; /// draw a rectangle virtual void rectangle(int x, int y, int w, int h, Color, - line_style = line_solid, float line_width = 0.5) = 0; + line_style = line_solid, float line_width = thin_line) = 0; /// draw a filled rectangle virtual void fillRectangle(int x, int y, int w, int h, Color) = 0; diff --git a/src/frontends/qt4/GuiPainter.cpp b/src/frontends/qt4/GuiPainter.cpp index fb3e5e9bf8..44f82dafe3 100644 --- a/src/frontends/qt4/GuiPainter.cpp +++ b/src/frontends/qt4/GuiPainter.cpp @@ -44,6 +44,8 @@ using namespace std; namespace lyx { namespace frontend { + +const float Painter::thin_line = 0.5; GuiPainter::GuiPainter(QPaintDevice * device) : QPainter(device), Painter(), @@ -52,7 +54,7 @@ GuiPainter::GuiPainter(QPaintDevice * device) // new QPainter has default QPen: current_color_ = guiApp->colorCache().get(Color_black); current_ls_ = line_solid; - current_lw_ = 0.5; + current_lw_ = thin_line; } diff --git a/src/frontends/qt4/GuiPainter.h b/src/frontends/qt4/GuiPainter.h index ffa95ccab0..a3849bb679 100644 --- a/src/frontends/qt4/GuiPainter.h +++ b/src/frontends/qt4/GuiPainter.h @@ -42,7 +42,7 @@ public: int x2, int y2, Color, line_style = line_solid, - float line_width = 0.5); + float line_width = thin_line); /** * lines - draw a set of lines @@ -56,7 +56,7 @@ public: int np, Color, line_style = line_solid, - float line_width = 0.5); + float line_width = thin_line); /// draw a rectangle virtual void rectangle( @@ -64,7 +64,7 @@ public: int w, int h, Color, line_style = line_solid, - float line_width = 0.5); + float line_width = thin_line); /// draw a filled rectangle virtual void fillRectangle( @@ -150,7 +150,7 @@ private: /// set pen parameters void setQPainterPen(QColor const & col, - line_style ls = line_solid, float lw = 0.5); + line_style ls = line_solid, float lw = thin_line); QColor current_color_; Painter::line_style current_ls_; -- 2.39.2