From 8b5ec57d0b9114bdc646ef5f5469d7bd5ad0cc63 Mon Sep 17 00:00:00 2001 From: Yari Polla Date: Mon, 6 Mar 2023 14:09:54 +0100 Subject: [PATCH] explicitly declare signal handlers params --- .../mobileshell/qml/components/ExtendedAbstractButton.qml | 2 +- .../qml/navigationpanel/NavigationGestureArea.qml | 4 ++-- .../mobileshell/qml/navigationpanel/NavigationPanel.qml | 4 ++-- .../halcyon/package/contents/ui/FavoritesAppDelegate.qml | 8 +++++++- .../halcyon/package/contents/ui/GridAppDelegate.qml | 8 +++++++- .../contents/systemdialog/private/ScrollView.qml | 2 +- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/components/mobileshell/qml/components/ExtendedAbstractButton.qml b/components/mobileshell/qml/components/ExtendedAbstractButton.qml index 6cc31757..c94fafea 100644 --- a/components/mobileshell/qml/components/ExtendedAbstractButton.qml +++ b/components/mobileshell/qml/components/ExtendedAbstractButton.qml @@ -38,7 +38,7 @@ QQC2.AbstractButton { id: mouseArea anchors.fill: parent acceptedButtons: Qt.LeftButton | Qt.RightButton - onPressed: { + onPressed: mouse => { if (mouse.button === Qt.RightButton) { root.rightClickPressed(); } else { diff --git a/components/mobileshell/qml/navigationpanel/NavigationGestureArea.qml b/components/mobileshell/qml/navigationpanel/NavigationGestureArea.qml index 4a16f486..e08d9b95 100644 --- a/components/mobileshell/qml/navigationpanel/NavigationGestureArea.qml +++ b/components/mobileshell/qml/navigationpanel/NavigationGestureArea.qml @@ -35,12 +35,12 @@ Item { enabled: !taskSwitcher.visible - onPressed: { + onPressed: mouse => { startMouseX = oldMouseX = mouse.x; startMouseY = oldMouseY = mouse.y; } - onPositionChanged: { + onPositionChanged: mouse => { if (root.taskSwitcher.visible || taskSwitcher.taskSwitcherState.currentlyBeingOpened) { // update task switcher drag let offsetY = (mouse.y - oldMouseY) * 0.5; // we want to make the gesture take a longer swipe than it being pixel perfect diff --git a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml index 95f9d8ee..ae8086a8 100644 --- a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml +++ b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml @@ -65,7 +65,7 @@ Item { id: haptics } - onPressed: { + onPressed: mouse => { startMouseX = oldMouseX = mouse.y; startMouseY = oldMouseY = mouse.y; activeButton = icons.childAt(mouse.x, mouse.y); @@ -74,7 +74,7 @@ Item { } } - onPositionChanged: { + onPositionChanged: mouse => { let newButton = icons.childAt(mouse.x, mouse.y); if (newButton != activeButton) { activeButton = null; diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml index 65d9b341..fb0dc619 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesAppDelegate.qml @@ -178,7 +178,13 @@ Item { } // launch app handled by press animation - onClicked: (mouse.button === Qt.RightButton) ? openContextMenu() : launchAppRequested = true; + onClicked: mouse => { + if (mouse.button === Qt.RightButton) { + openContextMenu(); + } else { + launchAppRequested = true; + } + } HoverHandler { id: hoverHandler diff --git a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml index 1a4786c8..acce4ac2 100644 --- a/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml +++ b/containments/homescreens/halcyon/package/contents/ui/GridAppDelegate.qml @@ -115,7 +115,13 @@ MouseArea { } } // launch app handled by press animation - onClicked: (mouse.button === Qt.RightButton) ? openContextMenu() : launchAppRequested = true + onClicked: mouse => { + if (mouse.button === Qt.RightButton) { + openContextMenu(); + } else { + launchAppRequested = true; + } + } ColumnLayout { anchors { diff --git a/look-and-feel/contents/systemdialog/private/ScrollView.qml b/look-and-feel/contents/systemdialog/private/ScrollView.qml index a1fb5c7d..18905772 100644 --- a/look-and-feel/contents/systemdialog/private/ScrollView.qml +++ b/look-and-feel/contents/systemdialog/private/ScrollView.qml @@ -47,7 +47,7 @@ MouseArea { focus: true - onPressed: mouse.accepted = mouse.source !== Qt.MouseEventNotSynthesized + onPressed: mouse => { mouse.accepted = mouse.source !== Qt.MouseEventNotSynthesized; } onVerticalScrollBarPolicyChanged: { scrollBarCreationTimer.restart(); }