diff options
author | Ira Rice <irarice@gmail.com> | 2009-03-14 20:54:35 -0600 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-14 20:54:35 -0600 |
commit | 6d6fd0cec10601a51cab67e623a579a14af775fc (patch) | |
tree | bbe8182819b363f0ae22e6422d8a802eeac3f250 /src/gui/setup_colors.cpp | |
parent | 8fb5276dcc5c527a3daf99c18826d6d9bf9802be (diff) | |
download | mana-client-6d6fd0cec10601a51cab67e623a579a14af775fc.tar.gz mana-client-6d6fd0cec10601a51cab67e623a579a14af775fc.tar.bz2 mana-client-6d6fd0cec10601a51cab67e623a579a14af775fc.tar.xz mana-client-6d6fd0cec10601a51cab67e623a579a14af775fc.zip |
Made the slider editable when pulse gradient is selected.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/setup_colors.cpp')
-rw-r--r-- | src/gui/setup_colors.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/gui/setup_colors.cpp b/src/gui/setup_colors.cpp index 79c4fcb5..760fdc1f 100644 --- a/src/gui/setup_colors.cpp +++ b/src/gui/setup_colors.cpp @@ -275,11 +275,15 @@ void Setup_Colors::action(const gcn::ActionEvent &event) break; } - if (grad != Palette::STATIC) + if (grad != Palette::STATIC && grad != Palette::PULSE) { // If nonstatic color, don't display the current, but the committed // color at the sliders col = &guiPalette->getCommittedColor(type); } + else if (grad == Palette::PULSE) + { + col = &guiPalette->getTestColor(type); + } setEntry(mRedSlider, mRedText, col->r); setEntry(mGreenSlider, mGreenText, col->g); @@ -381,7 +385,7 @@ void Setup_Colors::updateGradType() (grad == Palette::PULSE) ? _("Pulse") : (grad == Palette::RAINBOW) ? _("Rainbow") : _("Spectrum")); - bool enable = (grad == Palette::STATIC); + bool enable = (grad == Palette::STATIC || grad == Palette::PULSE); mRedText->setEnabled(enable); mRedSlider->setEnabled(enable); mGreenText->setEnabled(enable); @@ -407,4 +411,11 @@ void Setup_Colors::updateColor() static_cast<int>(mGreenSlider->getValue()), static_cast<int>(mBlueSlider->getValue())); } + else if (grad == Palette::PULSE) + { + guiPalette->setTestColor(type, gcn::Color( + static_cast<int>(mRedSlider->getValue()), + static_cast<int>(mGreenSlider->getValue()), + static_cast<int>(mBlueSlider->getValue()))); + } } |