From 2ccf933af280efc249b47728b3b3fd6cf1beb90f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 31 Aug 2013 17:04:24 +0000 Subject: Use a different cursor for clickable ui elements. --- src/ui/listitem.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/ui/listitem.cc') 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) -- cgit v1.2.3