summaryrefslogtreecommitdiff
path: root/src/gui/window.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-04-02 19:07:14 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-04-02 19:07:14 +0000
commit43d51d4a7c00bb425d004acf7eeb5e4aa4e969b0 (patch)
tree1a497ed7219d0450a0b33baf6a20d4b48f6b5404 /src/gui/window.cpp
parente89ecd460dd2aa14aa7fd01292628fb74cb34692 (diff)
downloadmana-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.cpp16
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);
+ }
+ }
+}