From 4458420ebe4546b7fdc9c1c9b327e237ced2cd0e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 19 May 2013 23:04:08 +0300 Subject: improve setup colors tab. --- src/gui/setup_colors.cpp | 38 ++++++++++---------------------------- 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; -- cgit v1.2.3-60-g2f50