Fix problem selecting transparent color from the ColorBar with middle button

When we move the mouse with the middle mouse button, we must trigger
onPaletteViewIndexChange() delegate in any case (the middle button
doesn't change the m_currentEntry).
This commit is contained in:
David Capello 2015-05-21 16:25:41 -03:00
parent 2ff0f1e2a4
commit 27485b7ff6

View File

@ -316,10 +316,11 @@ bool PaletteView::onProcessMessage(Message* msg)
StatusBar::instance()->showColor(0, "",
app::Color::fromIndex(idx), 255);
MouseButtons buttons = mouseMsg->buttons();
if (hasCapture() && (idx != m_currentEntry || msg->type() == kMouseDownMessage)) {
MouseButtons buttons = mouseMsg->buttons();
if (hasCapture() && ((idx != m_currentEntry) ||
(msg->type() == kMouseDownMessage) ||
((buttons & kButtonMiddle) == kButtonMiddle))) {
if ((buttons & kButtonMiddle) == 0) {
if (!msg->ctrlPressed())
deselect();