summaryrefslogtreecommitdiff
path: root/src/gui/widgets/scrollarea.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-03-16 14:14:29 +0300
committerAndrei Karas <akaras@inbox.ru>2014-03-16 14:14:29 +0300
commit46087564d4184b28740b0c45c1bac199ab1942ec (patch)
tree0591b36aba2ae392eb569828930f030850cbc769 /src/gui/widgets/scrollarea.cpp
parentcf9b1182f06b1336f0d1071c267ea36c990430fa (diff)
downloadmanaverse-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/scrollarea.cpp')
-rw-r--r--src/gui/widgets/scrollarea.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index 47b8b0985..571297ace 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -195,7 +195,6 @@ void ScrollArea::init(std::string skinName)
// +++ here probably need move background from static
if (skinName == "")
skinName = "scroll_background.xml";
- Theme *const theme = Theme::instance();
if (theme)
{
theme->loadRect(background, skinName, "scroll_background.xml");
@@ -207,8 +206,9 @@ void ScrollArea::init(std::string skinName)
for (int i = 0; i < 2; i ++)
{
- Skin *const skin = Theme::instance()->load(
- buttonFiles[i], "scrollbuttons.xml");
+ Skin *skin = nullptr;
+ if (theme)
+ skin = theme->load(buttonFiles[i], "scrollbuttons.xml");
if (skin)
{
const ImageRect &rect = skin->getBorder();
@@ -230,7 +230,8 @@ void ScrollArea::init(std::string skinName)
for (int f = UP; f < BUTTONS_DIR; f ++)
buttons[f][i] = nullptr;
}
- Theme::instance()->unload(skin);
+ if (theme)
+ theme->unload(skin);
}
}
mScrollbarWidth = mScrollbarSize;
@@ -290,7 +291,7 @@ void ScrollArea::logic()
void ScrollArea::updateAlpha()
{
const float alpha = std::max(client->getGuiAlpha(),
- Theme::instance()->getMinimumOpacity());
+ theme->getMinimumOpacity());
if (alpha != mAlpha)
{