diff options
author | Ira Rice <irarice@gmail.com> | 2009-01-30 12:32:48 -0700 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-01-30 12:32:48 -0700 |
commit | e2e23a5889c6b4a9a94e27c04ad8e5f60c7137b9 (patch) | |
tree | df1deed68e3b1052839448993abec66fefce24e7 /src/gui/radiobutton.cpp | |
parent | 3cd6930d1417ae9cf087de8d3a9f40f053e75bf0 (diff) | |
download | mana-e2e23a5889c6b4a9a94e27c04ad8e5f60c7137b9.tar.gz mana-e2e23a5889c6b4a9a94e27c04ad8e5f60c7137b9.tar.bz2 mana-e2e23a5889c6b4a9a94e27c04ad8e5f60c7137b9.tar.xz mana-e2e23a5889c6b4a9a94e27c04ad8e5f60c7137b9.zip |
Found a few more gui elements that didn't get exposed to transparency
updating.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/radiobutton.cpp')
-rw-r--r-- | src/gui/radiobutton.cpp | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/gui/radiobutton.cpp b/src/gui/radiobutton.cpp index 245112a7..de8d4d9d 100644 --- a/src/gui/radiobutton.cpp +++ b/src/gui/radiobutton.cpp @@ -21,12 +21,14 @@ #include "radiobutton.h" +#include "../configuration.h" #include "../graphics.h" #include "../resources/image.h" #include "../resources/resourcemanager.h" int RadioButton::instances = 0; +float RadioButton::mAlpha = config.getValue("guialpha", 0.8); Image *RadioButton::radioNormal; Image *RadioButton::radioChecked; Image *RadioButton::radioDisabled; @@ -43,6 +45,10 @@ RadioButton::RadioButton(const std::string& caption, const std::string& group, radioChecked = resman->getImage("graphics/gui/radioin.png"); radioDisabled = resman->getImage("graphics/gui/radioout.png"); radioDisabledChecked = resman->getImage("graphics/gui/radioin.png"); + radioNormal->setAlpha(mAlpha); + radioChecked->setAlpha(mAlpha); + radioDisabled->setAlpha(mAlpha); + radioDisabledChecked->setAlpha(mAlpha); } instances++; @@ -63,32 +69,37 @@ RadioButton::~RadioButton() void RadioButton::drawBox(gcn::Graphics* graphics) { + if (config.getValue("guialpha", 0.8) != mAlpha) + { + mAlpha = config.getValue("guialpha", 0.8); + radioNormal->setAlpha(mAlpha); + radioChecked->setAlpha(mAlpha); + radioDisabled->setAlpha(mAlpha); + radioDisabledChecked->setAlpha(mAlpha); + } + Image *box = NULL; - if (isSelected()) { - if (isEnabled()) { + if (isSelected()) + { + if (isEnabled()) box = radioChecked; - } else { + else box = radioDisabledChecked; - } - } else if (isEnabled()) { + } + else if (isEnabled()) box = radioNormal; - } else { + else box = radioDisabled; - } - if (box != NULL) { + if (box != NULL) static_cast<Graphics*>(graphics)->drawImage(box, 2, 2); - } } void RadioButton::draw(gcn::Graphics* graphics) { - - graphics->pushClipArea(gcn::Rectangle(1, - 1, - getWidth() - 1, - getHeight() - 1)); + graphics->pushClipArea(gcn::Rectangle(1, 1, getWidth() - 1, + getHeight() - 1)); drawBox(graphics); |