diff options
author | Stijn Buys <ingar@osirion.org> | 2010-09-18 18:50:55 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2010-09-18 18:50:55 +0000 |
commit | 9c91a9767b570fdc3c3e19e1f452f9a8257f9999 (patch) | |
tree | 9ac10114a3378134ea19dac3d7f7639532c3bf5a /src/ui/listitem.cc | |
parent | fc4809e41bc5694231046eb2fd4c324c4daba13f (diff) |
trade updates
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) |