summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-08-02 03:30:03 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-08-02 03:30:23 +0200
commit33032808e024b6dade5b751f15f4878edd507787 (patch)
treef451fba79080bdeb0c4d9f10c215cff3653491e7 /src/resources
parent7e8ba785e95385d32024e151697d2e6d4ec61ef3 (diff)
downloadmana-client-33032808e024b6dade5b751f15f4878edd507787.tar.gz
mana-client-33032808e024b6dade5b751f15f4878edd507787.tar.bz2
mana-client-33032808e024b6dade5b751f15f4878edd507787.tar.xz
mana-client-33032808e024b6dade5b751f15f4878edd507787.zip
Dynamically scaling background for login screen
Hacked Graphics::drawRescaledImage a bit to make it work...
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/theme.cpp6
-rw-r--r--src/resources/theme.h5
2 files changed, 10 insertions, 1 deletions
diff --git a/src/resources/theme.cpp b/src/resources/theme.cpp
index dde7bb3c..036cd4a3 100644
--- a/src/resources/theme.cpp
+++ b/src/resources/theme.cpp
@@ -82,8 +82,12 @@ Skin::~Skin()
void Skin::updateAlpha(float minimumOpacityAllowed)
{
const float alpha = std::max(minimumOpacityAllowed,
- config.getFloatValue("guialpha"));
+ config.getFloatValue("guialpha"));
+ setAlpha(alpha);
+}
+void Skin::setAlpha(float alpha)
+{
for_each(mBorder.grid, mBorder.grid + 9,
std::bind2nd(std::mem_fun(&Image::setAlpha), alpha));
diff --git a/src/resources/theme.h b/src/resources/theme.h
index 98904518..426f1a7e 100644
--- a/src/resources/theme.h
+++ b/src/resources/theme.h
@@ -89,6 +89,11 @@ class Skin
*/
void updateAlpha(float minimumOpacityAllowed = 0.0f);
+ /**
+ * Sets the alpha, overriding GUI opacity level.
+ */
+ void setAlpha(float alpha);
+
int instances;
private: