diff options
author | Stijn Buys <ingar@osirion.org> | 2008-10-07 20:35:52 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-10-07 20:35:52 +0000 |
commit | bc50666e86d5739ccde633eb630cc75b3e0fcb71 (patch) | |
tree | afad7eb043d6773a7b2a426f4d7b1f600301b5cd /src/ui/button.cc | |
parent | f54bd48a884e4e3c95818f042a4b2418a6e070a4 (diff) |
libui updates
Diffstat (limited to 'src/ui/button.cc')
-rw-r--r-- | src/ui/button.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/ui/button.cc b/src/ui/button.cc index 0910995..e06e883 100644 --- a/src/ui/button.cc +++ b/src/ui/button.cc @@ -41,9 +41,18 @@ void Button::set_command(std::string const &command) button_command.assign(command); } -void Button::draw() +void Button::draw_border() { - Label::draw(); + if (!border()) + return; + + if (palette()) { + if (has_focus()) + render::gl::color(palette()->foreground()); + else + render::gl::color(palette()->border()); + } + render::primitives::border(global_location(), size()); } void Button::draw_text() @@ -61,12 +70,12 @@ void Button::draw_text() render::primitives::text_centered(global_location(), size(), text()); } -void Button::event_keypress(unsigned int key, unsigned int modifier) +void Button::keypress(unsigned int key, unsigned int modifier) { } -void Button::event_keyrelease(unsigned int key, unsigned int modifier) +void Button::keyrelease(unsigned int key, unsigned int modifier) { if (key == 512 + SDL_BUTTON_LEFT) { core::cmd() << button_command << std::endl; @@ -75,4 +84,3 @@ void Button::event_keyrelease(unsigned int key, unsigned int modifier) } - |