summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tab.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2009-09-03 20:37:08 +0200
committerBertram <bertram@cegetel.net>2009-09-03 20:37:08 +0200
commitecf588b5ef86804b0074c54b6371cda9e8f346c2 (patch)
treebff015ac332d0bfd359ebd932236f37003a578e6 /src/gui/widgets/tab.cpp
parentefb541eeef2ad839c885c494c3a065f1f7d5dc03 (diff)
downloadmana-ecf588b5ef86804b0074c54b6371cda9e8f346c2.tar.gz
mana-ecf588b5ef86804b0074c54b6371cda9e8f346c2.tar.bz2
mana-ecf588b5ef86804b0074c54b6371cda9e8f346c2.tar.xz
mana-ecf588b5ef86804b0074c54b6371cda9e8f346c2.zip
Resolved Mantis #847: Login stage Windows won't go less than the default gui opacity.
Of course, in-game, the wanted opacity still shows up.
Diffstat (limited to 'src/gui/widgets/tab.cpp')
-rw-r--r--src/gui/widgets/tab.cpp35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/gui/widgets/tab.cpp b/src/gui/widgets/tab.cpp
index 3e49263e..99a95d96 100644
--- a/src/gui/widgets/tab.cpp
+++ b/src/gui/widgets/tab.cpp
@@ -30,6 +30,7 @@
#include "resources/image.h"
#include "resources/resourcemanager.h"
+#include "gui/skin.h"
#include "utils/dtor.h"
@@ -116,6 +117,26 @@ void Tab::init()
mInstances++;
}
+void Tab::updateAlpha()
+{
+ float alpha = std::max(config.getValue("guialpha", 0.8),
+ (double)SkinLoader::instance()->getMinimumOpacity());
+
+ // TODO We don't need to do this for every tab on every draw
+ // Maybe use a config listener to do it as the value changes.
+ if (alpha != mAlpha)
+ {
+ mAlpha = alpha;
+ for (int a = 0; a < 9; a++)
+ {
+ for (int t = 0; t < TAB_COUNT; t++)
+ {
+ tabImg[t].grid[a]->setAlpha(mAlpha);
+ }
+ }
+ }
+}
+
void Tab::draw(gcn::Graphics *graphics)
{
int mode = TAB_STANDARD;
@@ -139,19 +160,7 @@ void Tab::draw(gcn::Graphics *graphics)
}
}
- // TODO We don't need to do this for every tab on every draw
- // Maybe use a config listener to do it as the value changes.
- if (config.getValue("guialpha", 0.8) != mAlpha)
- {
- mAlpha = config.getValue("guialpha", 0.8);
- for (int a = 0; a < 9; a++)
- {
- for (int t = 0; t < TAB_COUNT; t++)
- {
- tabImg[t].grid[a]->setAlpha(mAlpha);
- }
- }
- }
+ updateAlpha();
// draw tab
static_cast<Graphics*>(graphics)->