diff options
author | Maximilian Philipps <Turmfalke2007@web.de> | 2009-08-01 12:34:03 +0200 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-08-01 08:31:22 -0600 |
commit | 907b4a126e16c56d7b372ea7fa0ed750e4302133 (patch) | |
tree | 0ad101fcb5e3d578977d19d276ce08b0e4417d5c | |
parent | ede286e65f1ccbf4ddfddba7be66467272440a13 (diff) | |
download | mana-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.cpp | 2 | ||||
-rw-r--r-- | src/gui/palette.h | 2 | ||||
-rw-r--r-- | src/gui/setup_colors.cpp | 2 | ||||
-rw-r--r-- | src/gui/widgets/button.cpp | 5 |
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; |