diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-05-19 23:04:08 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-05-21 00:02:09 +0300 |
commit | 4458420ebe4546b7fdc9c1c9b327e237ced2cd0e (patch) | |
tree | 0d0541a3b810e5697c8d30e17ab270bd7823d47d /src | |
parent | b3d0587b122e94acee6003f1c4b350a8e55d43a5 (diff) | |
download | manaplus-4458420ebe4546b7fdc9c1c9b327e237ced2cd0e.tar.gz manaplus-4458420ebe4546b7fdc9c1c9b327e237ced2cd0e.tar.bz2 manaplus-4458420ebe4546b7fdc9c1c9b327e237ced2cd0e.tar.xz manaplus-4458420ebe4546b7fdc9c1c9b327e237ced2cd0e.zip |
improve setup colors tab.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/setup_colors.cpp | 38 | ||||
-rw-r--r-- | src/gui/setup_colors.h | 4 |
2 files changed, 12 insertions, 30 deletions
diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp index 62dba3038..59961f434 100644 --- a/src/gui/setup_colors.cpp +++ b/src/gui/setup_colors.cpp @@ -104,17 +104,18 @@ Setup_Colors::Setup_Colors(const Widget2 *const widget) : // TRANSLATORS: color type std::string longText = _("Static"); - if (getFont()->getWidth(_("Pulse")) > getFont()->getWidth(longText)) + gcn::Font *const font = getFont(); + if (getFont()->getWidth(_("Pulse")) > font->getWidth(longText)) { // TRANSLATORS: color type longText = _("Pulse"); } - if (getFont()->getWidth(_("Rainbow")) > getFont()->getWidth(longText)) + if (getFont()->getWidth(_("Rainbow")) > font->getWidth(longText)) { // TRANSLATORS: color type longText = _("Rainbow"); } - if (getFont()->getWidth(_("Spectrum")) > getFont()->getWidth(longText)) + if (getFont()->getWidth(_("Spectrum")) > font->getWidth(longText)) { // TRANSLATORS: color type longText = _("Spectrum"); @@ -389,25 +390,6 @@ void Setup_Colors::cancel() setEntry(mBlueSlider, mBlueText, col->b); } -#if 0 -void Setup_Colors::listen(const TextField *tf) -{ - if (!tf) - return; - - if (tf == mGradDelayText) - mGradDelaySlider->setValue(tf->getValue()); - else if (tf == mRedText) - mRedSlider->setValue(tf->getValue()); - else if (tf == mGreenText) - mGreenSlider->setValue(tf->getValue()); - else if (tf == mBlueText) - mBlueSlider->setValue(tf->getValue()); - - updateColor(); -} -#endif - void Setup_Colors::updateGradType() { if (mSelected == -1 || !userPalette) @@ -418,12 +400,12 @@ void Setup_Colors::updateGradType() const Palette::GradientType grad = userPalette->getGradientType(type); mGradTypeText->setCaption( - // TRANSLATORS: color type - (grad == Palette::STATIC) ? _("Static") : - // TRANSLATORS: color type - (grad == Palette::PULSE) ? _("Pulse") : - // TRANSLATORS: color type - (grad == Palette::RAINBOW) ? _("Rainbow") : _("Spectrum")); + // TRANSLATORS: color type + (grad == Palette::STATIC) ? _("Static") : + // TRANSLATORS: color type + (grad == Palette::PULSE) ? _("Pulse") : + // TRANSLATORS: color type + (grad == Palette::RAINBOW) ? _("Rainbow") : _("Spectrum")); const bool enable = (grad == Palette::STATIC || grad == Palette::PULSE); const bool delayEnable = true; diff --git a/src/gui/setup_colors.h b/src/gui/setup_colors.h index 62241f6e3..bb743469c 100644 --- a/src/gui/setup_colors.h +++ b/src/gui/setup_colors.h @@ -47,9 +47,9 @@ class Setup_Colors final : public SetupTab, ~Setup_Colors(); - void apply(); + void apply() override; - void cancel(); + void cancel() override; void action(const gcn::ActionEvent &event) override; |