summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaximilian Philipps <Turmfalke2007@web.de>2009-08-01 12:34:03 +0200
committerJared Adams <jaxad0127@gmail.com>2009-08-01 08:31:22 -0600
commit907b4a126e16c56d7b372ea7fa0ed750e4302133 (patch)
tree0ad101fcb5e3d578977d19d276ce08b0e4417d5c
parentede286e65f1ccbf4ddfddba7be66467272440a13 (diff)
downloadmana-907b4a126e16c56d7b372ea7fa0ed750e4302133.tar.gz
mana-907b4a126e16c56d7b372ea7fa0ed750e4302133.tar.bz2
mana-907b4a126e16c56d7b372ea7fa0ed750e4302133.tar.xz
mana-907b4a126e16c56d7b372ea7fa0ed750e4302133.zip
makes the colour for buttons and disabled buttons configurable
-rw-r--r--src/gui/palette.cpp2
-rw-r--r--src/gui/palette.h2
-rw-r--r--src/gui/setup_colors.cpp2
-rw-r--r--src/gui/widgets/button.cpp5
4 files changed, 10 insertions, 1 deletions
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp
index 4d1233e8..c1b9dd7f 100644
--- a/src/gui/palette.cpp
+++ b/src/gui/palette.cpp
@@ -82,6 +82,8 @@ Palette::Palette() :
addColor(SHADOW, 0x000000, STATIC, indent + _("Text Shadow"));
addColor(OUTLINE, 0x000000, STATIC, indent + _("Text Outline"));
addColor(PROGRESS_BAR, 0xffffff, STATIC, indent + _("Progress Bar Labels"));
+ addColor(BUTTON, 0x000000, STATIC, indent + _("Buttons"));
+ addColor(BUTTON_DISABLED, 0x000000, STATIC, indent + _("Disabled Buttons"));
addColor(BACKGROUND, 0xffffff, STATIC, _("Background"));
diff --git a/src/gui/palette.h b/src/gui/palette.h
index 1dec2a60..094bbd03 100644
--- a/src/gui/palette.h
+++ b/src/gui/palette.h
@@ -57,6 +57,8 @@ class Palette : public gcn::ListModel
ENTRY(SHADOW)\
ENTRY(OUTLINE)\
ENTRY(PROGRESS_BAR)\
+ ENTRY(BUTTON)\
+ ENTRY(BUTTON_DISABLED)\
ENTRY(BACKGROUND)\
ENTRY(HIGHLIGHT)\
ENTRY(TAB_HIGHLIGHT)\
diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp
index 110ef534..7ad13cba 100644
--- a/src/gui/setup_colors.cpp
+++ b/src/gui/setup_colors.cpp
@@ -262,6 +262,8 @@ void Setup_Colors::valueChanged(const gcn::SelectionEvent &event)
mTextPreview->setOutline(true);
mTextPreview->setShadow(false);
break;
+ case Palette::BUTTON:
+ case Palette::BUTTON_DISABLED:
case Palette::TAB_HIGHLIGHT:
mTextPreview->setFont(gui->getFont());
mTextPreview->setTextColor(col);
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 71579bd4..2357b263 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -152,7 +152,10 @@ void Button::draw(gcn::Graphics *graphics)
static_cast<Graphics*>(graphics)->
drawImageRect(0, 0, getWidth(), getHeight(), button[mode]);
- graphics->setColor(guiPalette->getColor(Palette::TEXT));
+ if (mode == BUTTON_DISABLED)
+ graphics->setColor(guiPalette->getColor(Palette::BUTTON_DISABLED));
+ else
+ graphics->setColor(guiPalette->getColor(Palette::BUTTON));
int textX;
int textY = getHeight() / 2 - getFont()->getHeight() / 2;