Commit c475619e authored by Ivan Yossi's avatar Ivan Yossi 👌

Improve selection behaviour on layer docker when pressing thumbnail

BUG:408002
BACKPORT:krita/4.2
parent fc514817
......@@ -805,12 +805,20 @@ bool NodeDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const Q
} else if (mouseEvent->modifiers() == (Qt::ControlModifier | Qt::ShiftModifier | Qt::AltModifier)) {
action = SELECTION_INTERSECT;
hasCorrectModifier = true;
} else {
d->view->setItemsExpandable(false);
d->view->setSelectionMode(QAbstractItemView::ExtendedSelection);
QItemSelectionModel *selectionModel = d->view->selectionModel();
selectionModel->select(index, QItemSelectionModel::ToggleCurrent);
return false;
}
if (hasCorrectModifier) {
model->setData(index, QVariant(int(action)), KisNodeModel::SelectOpaqueRole);
}
d->view->setCurrentIndex(index);
return true; //If not here then the item is !expanded when reaching return false;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment