summaryrefslogtreecommitdiff
path: root/src/gui/setup_colors.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-19 23:04:08 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-21 00:02:09 +0300
commit4458420ebe4546b7fdc9c1c9b327e237ced2cd0e (patch)
tree0d0541a3b810e5697c8d30e17ab270bd7823d47d /src/gui/setup_colors.cpp
parentb3d0587b122e94acee6003f1c4b350a8e55d43a5 (diff)
downloadmanaverse-4458420ebe4546b7fdc9c1c9b327e237ced2cd0e.tar.gz
manaverse-4458420ebe4546b7fdc9c1c9b327e237ced2cd0e.tar.bz2
manaverse-4458420ebe4546b7fdc9c1c9b327e237ced2cd0e.tar.xz
manaverse-4458420ebe4546b7fdc9c1c9b327e237ced2cd0e.zip
improve setup colors tab.
Diffstat (limited to 'src/gui/setup_colors.cpp')
-rw-r--r--src/gui/setup_colors.cpp38
1 files changed, 10 insertions, 28 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;