From 9c91a9767b570fdc3c3e19e1f452f9a8257f9999 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 18 Sep 2010 18:50:55 +0000 Subject: trade updates --- src/ui/listitem.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/ui/listitem.cc') diff --git a/src/ui/listitem.cc b/src/ui/listitem.cc index 3ff108f..dcd4e2a 100644 --- a/src/ui/listitem.cc +++ b/src/ui/listitem.cc @@ -22,8 +22,6 @@ ListItem::~ListItem() { void ListItem::draw_border() { - // FIXME glow if selected, not on_mouseover - if (has_mouse_focus()) { math::Color color(palette()->foreground()); float t = core::application()->time(); @@ -33,7 +31,23 @@ void ListItem::draw_border() color.a = 0.5f + t; paint::color(color); paint::border(global_location(), size()); + } else if ((static_cast(parent()))->selected() == this) { + paint::color(palette()->border()); + paint::border(global_location(), size()); + } +} + +void ListItem::draw() +{ + if (!text().size()) + return; + + if ( has_mouse_focus() || ((static_cast(parent()))->selected() == this)) { + paint::color(palette()->highlight()); + } else { + paint::color(palette()->foreground()); } + paint::label(global_location(), size(), font(), text(), alignment()); } bool ListItem::on_keypress(const int key, const unsigned int modifier) -- cgit v1.2.3