summaryrefslogtreecommitdiff
path: root/src/gui/slider.cpp
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-01-30 10:56:54 -0700
committerIra Rice <irarice@gmail.com>2009-01-30 10:56:54 -0700
commitd57be9d49c55bc0b85eb8f539ff2029518cfafc0 (patch)
treedf3726aab3d3a4227330496e3b54803a713b1e7d /src/gui/slider.cpp
parentcc37b4a9153379d5c5529ba85305d36efba2cd85 (diff)
downloadmana-d57be9d49c55bc0b85eb8f539ff2029518cfafc0.tar.gz
mana-d57be9d49c55bc0b85eb8f539ff2029518cfafc0.tar.bz2
mana-d57be9d49c55bc0b85eb8f539ff2029518cfafc0.tar.xz
mana-d57be9d49c55bc0b85eb8f539ff2029518cfafc0.zip
Exposed most gui elements to take alpha values. There are still a few
spots that could also be fixed up as well, but require other methods to fix them (the filled color rectangles on the progress bars, as well as the text on them as well, as an example). Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/slider.cpp')
-rw-r--r--src/gui/slider.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/slider.cpp b/src/gui/slider.cpp
index 37136012..9bfa840f 100644
--- a/src/gui/slider.cpp
+++ b/src/gui/slider.cpp
@@ -21,6 +21,7 @@
#include "slider.h"
+#include "../configuration.h"
#include "../graphics.h"
#include "../resources/image.h"
@@ -28,6 +29,7 @@
Image *Slider::hStart, *Slider::hMid, *Slider::hEnd, *Slider::hGrip;
Image *Slider::vStart, *Slider::vMid, *Slider::vEnd, *Slider::vGrip;
+float Slider::mAlpha = config.getValue("guialpha", 0.8);
int Slider::mInstances = 0;
Slider::Slider(double scaleEnd):
@@ -107,6 +109,20 @@ void Slider::draw(gcn::Graphics *graphics)
int x = 0;
int y = (h - hStart->getHeight()) / 2;
+ if (config.getValue("guialpha", 0.8) != mAlpha)
+ {
+ mAlpha = config.getValue("guialpha", 0.8);
+ hStart->setAlpha(mAlpha);
+ hMid->setAlpha(mAlpha);
+ hEnd->setAlpha(mAlpha);
+ hGrip->setAlpha(mAlpha);
+
+ vStart->setAlpha(mAlpha);
+ vMid->setAlpha(mAlpha);
+ vEnd->setAlpha(mAlpha);
+ vGrip->setAlpha(mAlpha);
+ }
+
static_cast<Graphics*>(graphics)->drawImage(hStart, x, y);
w -= hStart->getWidth() + hEnd->getWidth();