Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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());