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 id: mouseArea
anchors.fill: parent anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
onPressed: { onPressed: mouse => {
if (mouse.button === Qt.RightButton) { if (mouse.button === Qt.RightButton) {
root.rightClickPressed(); root.rightClickPressed();
} else { } else {

View file

@ -35,12 +35,12 @@ Item {
enabled: !taskSwitcher.visible enabled: !taskSwitcher.visible
onPressed: { onPressed: mouse => {
startMouseX = oldMouseX = mouse.x; startMouseX = oldMouseX = mouse.x;
startMouseY = oldMouseY = mouse.y; startMouseY = oldMouseY = mouse.y;
} }
onPositionChanged: { onPositionChanged: mouse => {
if (root.taskSwitcher.visible || taskSwitcher.taskSwitcherState.currentlyBeingOpened) { if (root.taskSwitcher.visible || taskSwitcher.taskSwitcherState.currentlyBeingOpened) {
// update task switcher drag // 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 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 id: haptics
} }
onPressed: { onPressed: mouse => {
startMouseX = oldMouseX = mouse.y; startMouseX = oldMouseX = mouse.y;
startMouseY = oldMouseY = mouse.y; startMouseY = oldMouseY = mouse.y;
activeButton = icons.childAt(mouse.x, 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); let newButton = icons.childAt(mouse.x, mouse.y);
if (newButton != activeButton) { if (newButton != activeButton) {
activeButton = null; activeButton = null;

View file

@ -178,7 +178,13 @@ Item {
} }
// launch app handled by press animation // 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 { HoverHandler {
id: hoverHandler id: hoverHandler

View file

@ -115,7 +115,13 @@ MouseArea {
} }
} }
// launch app handled by press animation // 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 { ColumnLayout {
anchors { anchors {

View file

@ -47,7 +47,7 @@ MouseArea {
focus: true focus: true
onPressed: mouse.accepted = mouse.source !== Qt.MouseEventNotSynthesized onPressed: mouse => { mouse.accepted = mouse.source !== Qt.MouseEventNotSynthesized; }
onVerticalScrollBarPolicyChanged: { onVerticalScrollBarPolicyChanged: {
scrollBarCreationTimer.restart(); scrollBarCreationTimer.restart();
} }