diff options
Diffstat (limited to 'src/ui/listitem.cc')
-rw-r--r-- | src/ui/listitem.cc | 18 |
1 files changed, 16 insertions, 2 deletions
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<ListView *>(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<ListView *>(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) |