diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-16 14:14:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-16 14:14:29 +0300 |
commit | 46087564d4184b28740b0c45c1bac199ab1942ec (patch) | |
tree | 0591b36aba2ae392eb569828930f030850cbc769 /src/gui/widgets/button.cpp | |
parent | cf9b1182f06b1336f0d1071c267ea36c990430fa (diff) | |
download | ManaVerse-46087564d4184b28740b0c45c1bac199ab1942ec.tar.gz ManaVerse-46087564d4184b28740b0c45c1bac199ab1942ec.tar.bz2 ManaVerse-46087564d4184b28740b0c45c1bac199ab1942ec.tar.xz ManaVerse-46087564d4184b28740b0c45c1bac199ab1942ec.zip |
Improve theme usage.
Removed instance method.
Diffstat (limited to 'src/gui/widgets/button.cpp')
-rw-r--r-- | src/gui/widgets/button.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index 308c75413..8ac4251cf 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -337,13 +337,10 @@ void Button::init() if (mInstances == 0) { - if (Theme::instance()) + if (theme) { for (int mode = 0; mode < BUTTON_COUNT; mode ++) - { - button[mode] = Theme::instance()->load( - data[mode], "button.xml"); - } + button[mode] = theme->load(data[mode], "button.xml"); } updateAlpha(); @@ -359,9 +356,8 @@ Button::~Button() mInstances--; - if (mInstances == 0 && Theme::instance()) + if (mInstances == 0 && theme) { - Theme *const theme = Theme::instance(); for (int mode = 0; mode < BUTTON_COUNT; mode ++) theme->unload(button[mode]); } @@ -420,7 +416,7 @@ void Button::loadImageSet(const std::string &imageName) void Button::updateAlpha() { const float alpha = std::max(client->getGuiAlpha(), - Theme::instance()->getMinimumOpacity()); + theme->getMinimumOpacity()); if (mAlpha != alpha) { |