summaryrefslogtreecommitdiff
path: root/src/resources/theme.cpp
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2010-11-13 17:00:46 -0500
committerChuck Miller <shadowmil@gmail.com>2010-11-13 17:39:15 -0500
commitf8d22e47ac3b6392d68f1a8a45383798f5751101 (patch)
treee29b42821ec8f6e579f2cfd4d2a20bc8c248b930 /src/resources/theme.cpp
parent8e7e63a2473eedd36eeef726e45dacc9d17d157a (diff)
downloadmana-f8d22e47ac3b6392d68f1a8a45383798f5751101.tar.gz
mana-f8d22e47ac3b6392d68f1a8a45383798f5751101.tar.bz2
mana-f8d22e47ac3b6392d68f1a8a45383798f5751101.tar.xz
mana-f8d22e47ac3b6392d68f1a8a45383798f5751101.zip
Replace config listeners with the event system
Reviewed-by: Jared Adams
Diffstat (limited to 'src/resources/theme.cpp')
-rw-r--r--src/resources/theme.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/resources/theme.cpp b/src/resources/theme.cpp
index aa28af36..8de275ae 100644
--- a/src/resources/theme.cpp
+++ b/src/resources/theme.cpp
@@ -111,7 +111,7 @@ Theme::Theme():
{
initDefaultThemePath();
- config.addListener("guialpha", this);
+ listen(CHANNEL_CONFIG);
loadColors();
mColors[HIGHLIGHT].ch = 'H';
@@ -130,7 +130,6 @@ Theme::Theme():
Theme::~Theme()
{
delete_all(mSkins);
- config.removeListener("guialpha", this);
delete_all(mProgressColors);
}
@@ -209,9 +208,14 @@ void Theme::updateAlpha()
iter->second->updateAlpha(mMinimumOpacity);
}
-void Theme::optionChanged(const std::string &)
+void Theme::event(Channels channel, const Mana::Event &event)
{
- updateAlpha();
+ if (channel == CHANNEL_CONFIG &&
+ event.getName() == EVENT_CONFIGOPTIONCHANGED &&
+ event.getString("option") == "guialpha")
+ {
+ updateAlpha();
+ }
}
Skin *Theme::readSkin(const std::string &filename)