From cb51ef44e8f3b6461e608171eb3468bc15a696da Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 7 Jun 2016 22:21:47 +0200 Subject: Update all use of thinlistbox_*.png to new TexturedBox. --- plugingui/listboxthin.cc | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) (limited to 'plugingui/listboxthin.cc') diff --git a/plugingui/listboxthin.cc b/plugingui/listboxthin.cc index 03b2594..5d8ab49 100644 --- a/plugingui/listboxthin.cc +++ b/plugingui/listboxthin.cc @@ -29,7 +29,8 @@ #include "painter.h" #include "font.h" -namespace GUI { +namespace GUI +{ ListBoxThin::ListBoxThin(Widget *parent) : Widget(parent) @@ -38,30 +39,11 @@ ListBoxThin::ListBoxThin(Widget *parent) , valueChangedNotifier(basic.valueChangedNotifier) , basic(this) { - box.topLeft = new Image(":thinlistbox_tl.png"); - box.top = new Image(":thinlistbox_t.png"); - box.topRight = new Image(":thinlistbox_tr.png"); - box.left = new Image(":thinlistbox_l.png"); - box.right = new Image(":thinlistbox_r.png"); - box.bottomLeft = new Image(":thinlistbox_bl.png"); - box.bottom = new Image(":thinlistbox_b.png"); - box.bottomRight = new Image(":thinlistbox_br.png"); - box.center = new Image(":thinlistbox_c.png"); - - basic.move(box.left->width(), box.top->height()); + basic.move(1, 1); } ListBoxThin::~ListBoxThin() { - delete box.topLeft; - delete box.top; - delete box.topRight; - delete box.left; - delete box.right; - delete box.bottomLeft; - delete box.bottom; - delete box.bottomRight; - delete box.center; } void ListBoxThin::addItem(std::string name, std::string value) @@ -107,14 +89,15 @@ void ListBoxThin::repaintEvent(RepaintEvent* repaintEvent) return; } - p.drawBox(0, 0, box, w, h); + box.setSize(w,h); + p.drawImage(0, 0, box); } void ListBoxThin::resize(int width, int height) { Widget::resize(width, height); - basic.resize(width - (box.left->width() + box.right->width()), - height - (box.top->height() + box.bottom->height())); + basic.resize(width - (1 + 1), + height - (1 + 1)); } } // GUI:: -- cgit v1.2.3