diff options
author | Stijn Buys <ingar@osirion.org> | 2013-08-31 17:04:24 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-08-31 17:04:24 +0000 |
commit | 2ccf933af280efc249b47728b3b3fd6cf1beb90f (patch) | |
tree | d78d2ce5596e221b3c2246ccc58bb6d57b480fc6 /src/ui/listitem.cc | |
parent | cba3a6db5371f3454321c74cdee3ee002d5d4762 (diff) |
Use a different cursor for clickable ui elements.
Diffstat (limited to 'src/ui/listitem.cc')
-rw-r--r-- | src/ui/listitem.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ui/listitem.cc b/src/ui/listitem.cc index a5d033a..634cbaf 100644 --- a/src/ui/listitem.cc +++ b/src/ui/listitem.cc @@ -7,6 +7,7 @@ #include "audio/audio.h" #include "core/application.h" #include "ui/listitem.h" +#include "ui/ui.h" #include "ui/paint.h" namespace ui { @@ -25,7 +26,7 @@ ListItem::~ListItem() { void ListItem::draw_border() { - if (has_mouse_focus()) { + if (enabled() && has_mouse_focus()) { math::Color color(palette()->foreground()); float t = core::application()->time(); t = t - floorf(t); @@ -54,7 +55,13 @@ void ListItem::draw() } else { Paint::set_color(palette()->foreground()); } + Paint::draw_label(global_location(), size(), font(), text(), alignment()); + + if (enabled() && has_mouse_focus()) { + root()->set_pointer("action", Palette::Highlight); + } + } void ListItem::on_mouseover(const math::Vector2f &cursor) |