effects/desktopgrid: Fix TapHandler.onTapped handler

The button is provided alongside the event point now.
This commit is contained in:
Vlad Zahorodnii 2023-03-01 19:12:21 +02:00
parent 3aa16bd1ca
commit 77a1aea281

View file

@ -135,10 +135,10 @@ FocusScope {
TapHandler { TapHandler {
acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen acceptedPointerTypes: PointerDevice.GenericPointer | PointerDevice.Pen
acceptedButtons: Qt.MiddleButton | Qt.RightButton acceptedButtons: Qt.MiddleButton | Qt.RightButton
onTapped: { onTapped: (eventPoint, button) => {
if (eventPoint.event.button === Qt.MiddleButton) { if (button === Qt.MiddleButton) {
window.closeWindow(); window.closeWindow();
} else if (eventPoint.event.button === Qt.RightButton) { } else if (button === Qt.RightButton) {
if (window.desktops.length > 0) { if (window.desktops.length > 0) {
window.desktops = []; window.desktops = [];
} else { } else {