From ef30aa36a6559d3d39033b81fe23e225e258e312 Mon Sep 17 00:00:00 2001 From: Majin Sniper Date: Sat, 14 Mar 2009 14:50:10 +0100 Subject: Fix cancel button in color config dialog Also save the committed gradient, not the one currently used. --- src/gui/palette.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp index 0298953c..e93c7744 100644 --- a/src/gui/palette.cpp +++ b/src/gui/palette.cpp @@ -127,7 +127,7 @@ Palette::~Palette() col != colEnd; ++col) { configName = &ColorTypeNames[col->type]; - config.setValue(*configName + "Gradient", col->grad); + config.setValue(*configName + "Gradient", col->comittedGrad); if (col->grad == STATIC) { config.setValue(*configName, toString(col->getRGB())); @@ -219,11 +219,12 @@ void Palette::rollback() i != iEnd; ++i) { - i->grad = i->committedGrad; - if (i->grad == STATIC) + if (i->grad != i->committedGrad) { - i->color = i->committedColor; + setGradient(i->type, i->committedGrad); } + setColor(i->type, i->committedColor.r, i->committedColor.g, + i->committedColor.b); } } -- cgit v1.2.3-70-g09d2