notifs: close on middle button
This commit is contained in:
parent
60254019c8
commit
78ce9835ca
1 changed files with 9 additions and 3 deletions
|
|
@ -30,14 +30,20 @@ StyledRect {
|
|||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
preventStealing: true
|
||||
cursorShape: pressed ? Qt.ClosedHandCursor : undefined
|
||||
acceptedButtons: Qt.LeftButton | Qt.MiddleButton
|
||||
|
||||
onEntered: root.modelData.timer.stop()
|
||||
onExited: root.modelData.timer.start()
|
||||
onEntered: root.modelData?.timer.stop()
|
||||
onExited: root.modelData?.timer.start()
|
||||
|
||||
drag.target: parent
|
||||
drag.axis: Drag.XAxis
|
||||
|
||||
onPressed: event => startY = event.y
|
||||
onPressed: event => {
|
||||
startY = event.y;
|
||||
if (event.button === Qt.MiddleButton)
|
||||
root.modelData.notification.dismiss();
|
||||
}
|
||||
onReleased: event => {
|
||||
if (Math.abs(root.x) < NotifsConfig.sizes.width * NotifsConfig.clearThreshold)
|
||||
root.x = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue