diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-20 03:08:42 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-20 03:08:42 +0300 |
commit | f9abb45a7776fa158daef508f8287da267de002b (patch) | |
tree | ceba4b28986574e772078ab286c00f988e489739 /src | |
parent | e2620fcbbe0ae5ac43565879f4b7243c367c84cf (diff) | |
download | plus-f9abb45a7776fa158daef508f8287da267de002b.tar.gz plus-f9abb45a7776fa158daef508f8287da267de002b.tar.bz2 plus-f9abb45a7776fa158daef508f8287da267de002b.tar.xz plus-f9abb45a7776fa158daef508f8287da267de002b.zip |
Allow chage gui opacity in settings on the fly.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/setup_visual.cpp | 14 | ||||
-rw-r--r-- | src/gui/setup_visual.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/setup_visual.cpp b/src/gui/setup_visual.cpp index cc713effa..1cf35e4f2 100644 --- a/src/gui/setup_visual.cpp +++ b/src/gui/setup_visual.cpp @@ -31,6 +31,7 @@ #include "gui/widgets/layouthelper.h" #include "gui/widgets/scrollarea.h" #include "gui/widgets/setupitem.h" +#include "gui/widgets/slider.h" #include "resources/image.h" @@ -72,3 +73,16 @@ void Setup_Visual::apply() Image::setEnableAlpha(config.getFloatValue("guialpha") != 1.0f); Client::applyGrabMode(); } + +void Setup_Visual::action(const gcn::ActionEvent &event) +{ + if (event.getId() == "guialphaEvent") + { + Slider *slider = static_cast<Slider*>(event.getSource()); + if (slider) + { + config.setValue("guialpha", slider->getValue()); + Image::setEnableAlpha(config.getFloatValue("guialpha") != 1.0f); + } + } +} diff --git a/src/gui/setup_visual.h b/src/gui/setup_visual.h index b8715f409..c76002c06 100644 --- a/src/gui/setup_visual.h +++ b/src/gui/setup_visual.h @@ -36,6 +36,7 @@ class Setup_Visual : public SetupTabScroll void apply(); + void action(const gcn::ActionEvent &event A_UNUSED); }; #endif |