summaryrefslogtreecommitdiff
path: root/src/gui/widgets/scrollarea.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/scrollarea.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/scrollarea.cpp')
-rw-r--r--src/gui/widgets/scrollarea.cpp29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index 6cf27bb6..eed0ff33 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -26,6 +26,7 @@
#include "resources/image.h"
#include "resources/resourcemanager.h"
+#include "gui/skin.h"
#include "utils/dtor.h"
@@ -182,6 +183,23 @@ void ScrollArea::logic()
}
}
+void ScrollArea::updateAlpha()
+{
+ float alpha = std::max(config.getValue("guialpha", 0.8),
+ (double)SkinLoader::instance()->getMinimumOpacity());
+
+ if (alpha != mAlpha)
+ {
+ mAlpha = alpha;
+ for (int a = 0; a < 9; a++)
+ {
+ background.grid[a]->setAlpha(mAlpha);
+ vMarker.grid[a]->setAlpha(mAlpha);
+ vMarkerHi.grid[a]->setAlpha(mAlpha);
+ }
+ }
+}
+
void ScrollArea::draw(gcn::Graphics *graphics)
{
if (mVBarVisible)
@@ -209,16 +227,7 @@ void ScrollArea::draw(gcn::Graphics *graphics)
mScrollbarWidth));
}
- if (config.getValue("guialpha", 0.8) != mAlpha)
- {
- mAlpha = config.getValue("guialpha", 0.8);
- for (int a = 0; a < 9; a++)
- {
- background.grid[a]->setAlpha(mAlpha);
- vMarker.grid[a]->setAlpha(mAlpha);
- vMarkerHi.grid[a]->setAlpha(mAlpha);
- }
- }
+ updateAlpha();
drawChildren(graphics);
}