diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-15 17:01:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-15 17:01:46 +0300 |
commit | 382067b05c4fe97bcf0da0143405375ec295f7c6 (patch) | |
tree | f668cd2595ac0c85f0942f88729d3ff1956676fa /src/gui/widgets/setupitem.cpp | |
parent | ee8191705826d978b7793497fdd307536c709bff (diff) | |
parent | 9b329556e748050c4300174e9bdc72b15e5b8cc5 (diff) | |
download | plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.gz plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.bz2 plus-382067b05c4fe97bcf0da0143405375ec295f7c6.tar.xz plus-382067b05c4fe97bcf0da0143405375ec295f7c6.zip |
Merge branch 'master' into stable
Diffstat (limited to 'src/gui/widgets/setupitem.cpp')
-rw-r--r-- | src/gui/widgets/setupitem.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index b9ea91f76..2cb7f60d1 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -1139,3 +1139,41 @@ void SetupItemSound::action(const gcn::ActionEvent &event) SetupItemSliderList::action(event); } } + +SetupItemSliderInt::SetupItemSliderInt(const std::string &restrict text, + const std::string &restrict description, + const std::string &restrict keyName, + SetupTabScroll *restrict const parent, + const std::string &restrict eventName, + gcn::ListModel *restrict const model, + const int min, + const int width, + const bool onTheFly, + const bool mainConfig) : + SetupItemSliderList(text, description, keyName, parent, eventName, + model, width, onTheFly, mainConfig), + mMin(min) +{ + createControls(); +} + +void SetupItemSliderInt::addMoreControls() +{ + toWidget(); +} + +void SetupItemSliderInt::fromWidget() +{ + if (!mSlider) + return; + + mValue = toString(mSlider->getSelected() + mMin); +} + +void SetupItemSliderInt::toWidget() +{ + if (!mSlider) + return; + + mSlider->setSelected(atoi(mValue.c_str()) - mMin); +} |