diff options
Diffstat (limited to 'src/ui/button.cc')
-rw-r--r-- | src/ui/button.cc | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/ui/button.cc b/src/ui/button.cc index e06e883..d6384c9 100644 --- a/src/ui/button.cc +++ b/src/ui/button.cc @@ -4,8 +4,9 @@ the terms of the GNU General Public License version 2 */ +#include "audio/audio.h" #include "auxiliary/functions.h" -#include "render/primitives.h" +#include "ui/paint.h" #include "sys/sys.h" #include "ui/button.h" #include "core/commandbuffer.h" @@ -46,13 +47,11 @@ void Button::draw_border() 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()); + if (has_focus()) + paint::color(palette()->foreground()); + else + paint::color(palette()->border()); + paint::border(global_location(), size()); } void Button::draw_text() @@ -60,14 +59,12 @@ void Button::draw_text() if (!text().size()) return; - if (palette()) { - if (has_focus()) - render::gl::color(palette()->highlight()); - else - render::gl::color(palette()->foreground()); - } + if (has_focus()) + paint::color(palette()->highlight()); + else + paint::color(palette()->foreground()); - render::primitives::text_centered(global_location(), size(), text()); + paint::text_centered(global_location(), size(), text(), font()); } void Button::keypress(unsigned int key, unsigned int modifier) @@ -79,6 +76,7 @@ void Button::keyrelease(unsigned int key, unsigned int modifier) { if (key == 512 + SDL_BUTTON_LEFT) { core::cmd() << button_command << std::endl; + audio::play("ui/button"); } } |