summaryrefslogtreecommitdiff
path: root/plugingui/lineedit.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-03-30 17:44:20 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2013-03-30 17:44:20 +0100
commit4b7414b3f6869f2bdeb097e4f997498bae9f0aee (patch)
tree53e9741d7d40f1ff6f77d47fc308b18168dca330 /plugingui/lineedit.cc
parenta1fba9ba11a13f94c524f2ac78206b3fdfb3be74 (diff)
New box rendering of all widgets. Minor tweaks still missing.
Diffstat (limited to 'plugingui/lineedit.cc')
-rw-r--r--plugingui/lineedit.cc24
1 files changed, 16 insertions, 8 deletions
diff --git a/plugingui/lineedit.cc b/plugingui/lineedit.cc
index 35056a3..bc61070 100644
--- a/plugingui/lineedit.cc
+++ b/plugingui/lineedit.cc
@@ -28,8 +28,6 @@
#include <stdio.h>
-#include "painter.h"
-
#include "window.h"
#define BORDER 10
@@ -39,6 +37,16 @@ GUI::LineEdit::LineEdit(Widget *parent)
{
pos = 0;
setReadOnly(false);
+
+ box.topLeft = new Image(":widget_tl.png");
+ box.top = new Image(":widget_t.png");
+ box.topRight = new Image(":widget_tr.png");
+ box.left = new Image(":widget_l.png");
+ box.right = new Image(":widget_r.png");
+ box.bottomLeft = new Image(":widget_bl.png");
+ box.bottom = new Image(":widget_b.png");
+ box.bottomRight = new Image(":widget_br.png");
+ box.center = new Image(":widget_c.png");
}
void GUI::LineEdit::setReadOnly(bool ro)
@@ -132,15 +140,15 @@ void GUI::LineEdit::keyEvent(GUI::KeyEvent *e)
void GUI::LineEdit::repaintEvent(GUI::RepaintEvent *e)
{
Painter p(this);
-
+
p.clear();
- p.setColour(Colour(0, 0.4));
- p.drawFilledRectangle(3,3,width()-3,height()-3);
+ int w = width();
+ int h = height();
+ if(w == 0 || h == 0) return;
+ p.drawBox(0, 0, &box, w, h);
- p.setColour(Colour(1,1,1));
- p.drawRectangle(0,0,width()-1,height()-1);
- p.drawRectangle(2,2,width()-3,height()-3);
+ p.setColour(GUI::Colour(1,1,1,1));
p.drawText(BORDER - 4, height()/2+5 + 1, font, _text);
if(readOnly()) return;