explicitly declare signal handlers params

This commit is contained in:
Yari Polla 2023-03-06 14:09:54 +01:00
parent 6359e59f48
commit 8b5ec57d0b
6 changed files with 20 additions and 8 deletions

View file

@ -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 {

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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 {

View file

@ -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();
}