diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-04-02 19:07:14 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-04-02 19:07:14 +0000 |
commit | 43d51d4a7c00bb425d004acf7eeb5e4aa4e969b0 (patch) | |
tree | 1a497ed7219d0450a0b33baf6a20d4b48f6b5404 /src/gui/window.cpp | |
parent | e89ecd460dd2aa14aa7fd01292628fb74cb34692 (diff) | |
download | mana-43d51d4a7c00bb425d004acf7eeb5e4aa4e969b0.tar.gz mana-43d51d4a7c00bb425d004acf7eeb5e4aa4e969b0.tar.bz2 mana-43d51d4a7c00bb425d004acf7eeb5e4aa4e969b0.tar.xz mana-43d51d4a7c00bb425d004acf7eeb5e4aa4e969b0.zip |
Added ConfigListener class to allow listening for changes to config options,
and added a GUI opacity slider to the setup window that utilizes this.
Diffstat (limited to 'src/gui/window.cpp')
-rw-r--r-- | src/gui/window.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp index ab37dae8..c24b50ab 100644 --- a/src/gui/window.cpp +++ b/src/gui/window.cpp @@ -73,6 +73,7 @@ Window::Window(const std::string& caption, bool modal, Window *parent): // Set GUI alpha level dBackground->setAlpha(guiAlpha); dBorders->setAlpha(guiAlpha); + config.addListener("guialpha", this); } Window::~Window() @@ -84,6 +85,7 @@ Window::~Window() //release_bitmap(dMid); //release_bitmap(dRight); + config.removeListener("guialpha", this); delete chrome; } @@ -196,3 +198,17 @@ void Window::mouseMotion(int mx, int my) setPosition(x, y); } } + +void Window::optionChanged(const std::string &name) +{ + if (name == "guialpha") + { + guiAlpha = config.getValue("guialpha", 0.8); + + if (dBackground->getAlpha() != guiAlpha) + { + dBackground->setAlpha(guiAlpha); + dBorders->setAlpha(guiAlpha); + } + } +} |