Don't change color type when alpha slider is modified on ColorPopup

Bug reported here: https://twitter.com/chefkoch104/status/879664806864748544
This commit is contained in:
David Capello 2017-06-29 15:01:11 -03:00
parent 71b7ee12ec
commit a92f476e3a
2 changed files with 15 additions and 11 deletions

View File

@ -66,7 +66,7 @@ public:
private:
void onClick(Event& ev) override {
m_colorPopup->setColorWithSignal(m_color);
m_colorPopup->setColorWithSignal(m_color, ChangeType);
}
void onPaint(PaintEvent& ev) override {
@ -273,7 +273,8 @@ ColorPopup::~ColorPopup()
{
}
void ColorPopup::setColor(const app::Color& color, SetColorOptions options)
void ColorPopup::setColor(const app::Color& color,
const SetColorOptions options)
{
m_color = color;
@ -361,12 +362,12 @@ void ColorPopup::onMakeFixed()
void ColorPopup::onPaletteViewIndexChange(int index, ui::MouseButtons buttons)
{
setColorWithSignal(app::Color::fromIndex(index));
setColorWithSignal(app::Color::fromIndex(index), ChangeType);
}
void ColorPopup::onColorSlidersChange(ColorSlidersChangeEvent& ev)
{
setColorWithSignal(ev.color());
setColorWithSignal(ev.color(), DontChangeType);
findBestfitIndex(ev.color());
}
@ -376,7 +377,7 @@ void ColorPopup::onColorHexEntryChange(const app::Color& color)
// is writting in the text field.
m_disableHexUpdate = true;
setColorWithSignal(color);
setColorWithSignal(color, ChangeType);
findBestfitIndex(color);
m_disableHexUpdate = false;
@ -406,7 +407,7 @@ void ColorPopup::onSimpleColorClick()
doc::rgba_geta(c));
}
setColorWithSignal(color);
setColorWithSignal(color, ChangeType);
}
void ColorPopup::onColorTypeClick()
@ -447,7 +448,7 @@ void ColorPopup::onColorTypeClick()
break;
}
setColorWithSignal(newColor);
setColorWithSignal(newColor, ChangeType);
}
void ColorPopup::onPaletteChange()
@ -475,9 +476,10 @@ void ColorPopup::findBestfitIndex(const app::Color& color)
}
}
void ColorPopup::setColorWithSignal(const app::Color& color)
void ColorPopup::setColorWithSignal(const app::Color& color,
const SetColorOptions options)
{
setColor(color, ChangeType);
setColor(color, options);
// Fire ColorChange signal
ColorChange(color);

View File

@ -36,7 +36,8 @@ namespace app {
ColorPopup(const ColorButtonOptions& options);
~ColorPopup();
void setColor(const app::Color& color, SetColorOptions options);
void setColor(const app::Color& color,
const SetColorOptions options);
app::Color getColor() const;
// Signals
@ -58,7 +59,8 @@ namespace app {
private:
void selectColorType(app::Color::Type type);
void setColorWithSignal(const app::Color& color);
void setColorWithSignal(const app::Color& color,
const SetColorOptions options);
void findBestfitIndex(const app::Color& color);
class SimpleColors;