diff options
Diffstat (limited to 'plugingui/verticalline.cc')
-rw-r--r-- | plugingui/verticalline.cc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/plugingui/verticalline.cc b/plugingui/verticalline.cc index 53d82a6..5bf4afd 100644 --- a/plugingui/verticalline.cc +++ b/plugingui/verticalline.cc @@ -28,14 +28,24 @@ #include "painter.h" -GUI::VerticalLine::VerticalLine(GUI::Widget *parent) - : Widget(parent), vline(":vertline.png") +namespace GUI { + +VerticalLine::VerticalLine(Widget *parent) + : Widget(parent) + , vline(":vertline.png") { } -void GUI::VerticalLine::repaintEvent(RepaintEvent *e) +void VerticalLine::repaintEvent(RepaintEvent* repaintEvent) { - (void)e; - GUI::Painter p(this); - p.drawImageStretched(0, 0, &vline, width(), height()); + if(height() < 2) + { + return; + } + + Painter p(*this); + p.drawImageStretched(0, (height() - vline.height()) / 2, + vline, width(), vline.height()); } + +} // GUI:: |