mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-04 02:34:45 +00:00
explicitly declare signal handlers params
This commit is contained in:
parent
6359e59f48
commit
8b5ec57d0b
6 changed files with 20 additions and 8 deletions
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue