summaryrefslogtreecommitdiff
path: root/plugingui/combobox.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-03-13 21:03:14 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2013-03-13 21:03:14 +0100
commit37471a3486a566159bcf0c7ebd68f9064287d0fa (patch)
tree42cc7114a13ff564575bbdd5f9c920f190f079b4 /plugingui/combobox.cc
parentb59d65d3c5606b33727cc445555704bb0e203b55 (diff)
Use new painter clear function.
Diffstat (limited to 'plugingui/combobox.cc')
-rw-r--r--plugingui/combobox.cc26
1 files changed, 19 insertions, 7 deletions
diff --git a/plugingui/combobox.cc b/plugingui/combobox.cc
index 20779e8..31c81c6 100644
--- a/plugingui/combobox.cc
+++ b/plugingui/combobox.cc
@@ -95,18 +95,30 @@ void GUI::ComboBox::registerValueChangedHandler(void (*handler)(void *),
void GUI::ComboBox::repaintEvent(GUI::RepaintEvent *e)
{
Painter p(this);
-
- int h = 16;
+
+ p.clear();
std::string _text = selectedName();
p.setColour(Colour(0, 0.4));
- p.drawFilledRectangle(3,3,width()-3,h-3);
+ p.drawFilledRectangle(3, 3, width() - 3, height() - 3);
+
+ p.setColour(Colour(1, 1, 1));
+ p.drawRectangle(0, 0, width() - 1, height() - 1);
+
+ p.setColour(Colour(0.6, 0.6, 0.6));
+ p.drawRectangle(2, 2, width() - 3, height() - 3);
+
+ p.setColour(Colour(1, 1, 1));
+ p.drawText(BORDER - 4, (height()+font.textHeight()) / 2 + 1, font, _text);
+
+ p.setColour(Colour(1, 1, 1, 0.8));
+ p.drawRectangle(width() - height() + 1, 1, width() - 2, height() - 2);
- p.setColour(Colour(1,1,1));
- p.drawRectangle(0,0,width()-1,h-1);
- p.drawRectangle(2,2,width()-3,h-3);
- p.drawText(BORDER - 4, h/2+5 + 1, font, _text);
+ int n = height();
+ p.setColour(Colour(1, 1, 1, 1));
+ p.drawLine(width() - n, 1, width() - 1 - n/2, n);
+ p.drawLine(width() - n + n/2, n, width() - 1, 1);
}
void GUI::ComboBox::scrollEvent(ScrollEvent *e)