diff options
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/theme.cpp | 12 | ||||
-rw-r--r-- | src/resources/theme.h | 6 |
2 files changed, 11 insertions, 7 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) diff --git a/src/resources/theme.h b/src/resources/theme.h index 3a5aa41a..f830c94f 100644 --- a/src/resources/theme.h +++ b/src/resources/theme.h @@ -24,8 +24,8 @@ #ifndef SKIN_H #define SKIN_H -#include "configlistener.h" #include "graphics.h" +#include "listener.h" #include "gui/palette.h" @@ -100,7 +100,7 @@ class Skin Image *mStickyImageDown; /**< Sticky Button Image */ }; -class Theme : public Palette, public ConfigListener +class Theme : public Palette, public Mana::Listener { public: static Theme *instance(); @@ -218,7 +218,7 @@ class Theme : public Palette, public ConfigListener */ void setMinimumOpacity(float minimumOpacity); - void optionChanged(const std::string &); + void event(Channels channel, const Mana::Event &event); private: Theme(); |