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>2010-10-03 19:57:17 +0000
committerStijn Buys <ingar@osirion.org>2010-10-03 19:57:17 +0000
commit75906b43ecb9a04fdab365bd8b1a00fbdbc66918 (patch)
tree1a065487f09c694d93612b4f99489b878b0f8a95 /src/ui/iconbutton.cc
parent25af16fac3127523d532d4b4797eec7947ed5a72 (diff)
ui updates, removed impulse and jumpgte g_devel conditions, jumpdrive crash bugfix
Diffstat (limited to 'src/ui/iconbutton.cc')
-rw-r--r--src/ui/iconbutton.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/ui/iconbutton.cc b/src/ui/iconbutton.cc
index 87203ee..204918e 100644
--- a/src/ui/iconbutton.cc
+++ b/src/ui/iconbutton.cc
@@ -24,7 +24,7 @@ IconButton::IconButton(Widget *parent, const char *icon, const char *command) :
set_border(false);
set_command(command);
set_icon(icon);
- iconbutton_enabled = true;
+ set_highlight(false);
}
IconButton::~IconButton()
@@ -58,19 +58,14 @@ void IconButton::set_icon(const char *icon)
iconbutton_icon.clear();
}
-void IconButton::set_icon(const std::string &icon)
+void IconButton::set_highlight(const bool highlight)
{
- iconbutton_icon.assign(icon);
+ iconbutton_highlight = highlight;
}
-void IconButton::enable(bool enabled)
-{
- iconbutton_enabled = enabled;
-}
-
-void IconButton::disable(bool disabled)
+void IconButton::set_icon(const std::string &icon)
{
- iconbutton_enabled = !disabled;
+ iconbutton_icon.assign(icon);
}
void IconButton::draw()
@@ -80,7 +75,7 @@ void IconButton::draw()
if (disabled()) {
Paint::set_color(palette()->disabled());
- } else if (has_mouse_focus()) {
+ } else if (highlight() || has_mouse_focus()) {
Paint::set_color(palette()->highlight());
} else {
Paint::set_color(palette()->foreground());