Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-10-08 18:28:21 +0000
committerStijn Buys <ingar@osirion.org>2008-10-08 18:28:21 +0000
commit4331f5c17901f46693dcb5c2df96276f6851be25 (patch)
tree903f70d18c7842121c5409a5ec121e0a565fd5ef /src/ui/button.cc
parente3b810e1fe8ced1e0245f8d999bdc9136cfcdc70 (diff)
libui updates, paint namespace, font and palette fixes, button sound
Diffstat (limited to 'src/ui/button.cc')
-rw-r--r--src/ui/button.cc28
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");
}
}