Toggle off palette cell after adding to score

This commit is contained in:
Eism 2022-01-13 12:05:26 +02:00
parent 8f9835fa51
commit 007dc2f8cf
2 changed files with 13 additions and 14 deletions

View file

@ -70,6 +70,10 @@ FocusableControl {
}
}
mouseArea.onPressed: {
ui.tooltip.hide(root)
}
onNavigationTriggered: root.clicked(null)
states: [

View file

@ -486,13 +486,6 @@ GridView {
//property int cellRow: paletteView.ncolumns == 0 ? 0 : Math.floor(model.index / paletteView.ncolumns)
//property int cellCol: model.index - (cellRow * paletteView.ncolumns)
onActiveFocusChanged: {
if (activeFocus) {
paletteTree.currentTreeItem = this;
paletteView.updateSelection(false);
}
}
readonly property bool dragged: Drag.active && !dragDropReorderTimer.running
property bool paletteDrag: false
property bool internalDrag: false
@ -515,7 +508,7 @@ GridView {
navigation.column: 1
navigation.onActiveChanged: {
if (navigation.active) {
if (navigation.highlight) {
paletteView.currentIndex = paletteCell.rowIndex;
paletteView.updateSelection(true);
}
@ -535,15 +528,13 @@ GridView {
// leftClickArea
mouseArea.drag.target: draggedIcon
mouseArea.onPressed: {
paletteView.currentIndex = paletteCell.rowIndex;
paletteView.updateSelection(true);
paletteCell.forceActiveFocus();
paletteCell.beginDrag();
paletteCell.beginDrag()
}
onClicked: {
if (paletteView.paletteController.applyPaletteElement(paletteCell.modelIndex, ui.keyboardModifiers())) {
paletteView.selectionModel.setCurrentIndex(paletteCell.modelIndex, ItemSelectionModel.Current);
if (!paletteView.paletteController.applyPaletteElement(paletteCell.modelIndex, ui.keyboardModifiers())) {
paletteView.currentIndex = paletteCell.rowIndex;
paletteView.updateSelection(true);
}
}
@ -597,6 +588,10 @@ GridView {
dropData = null;
}
if (Boolean(paletteView)) {
paletteView.selectionModel.clearSelection()
}
}
function beginDrag() {