notifs: pause expire on press
This commit is contained in:
parent
88c628a777
commit
d2b6d2d258
1 changed files with 8 additions and 1 deletions
|
|
@ -50,17 +50,24 @@ StyledRect {
|
||||||
preventStealing: true
|
preventStealing: true
|
||||||
|
|
||||||
onEntered: root.modelData.timer.stop()
|
onEntered: root.modelData.timer.stop()
|
||||||
onExited: root.modelData.timer.start()
|
onExited: {
|
||||||
|
if (!pressed)
|
||||||
|
root.modelData.timer.start();
|
||||||
|
}
|
||||||
|
|
||||||
drag.target: parent
|
drag.target: parent
|
||||||
drag.axis: Drag.XAxis
|
drag.axis: Drag.XAxis
|
||||||
|
|
||||||
onPressed: event => {
|
onPressed: event => {
|
||||||
|
root.modelData.timer.stop();
|
||||||
startY = event.y;
|
startY = event.y;
|
||||||
if (event.button === Qt.MiddleButton)
|
if (event.button === Qt.MiddleButton)
|
||||||
root.modelData.notification.dismiss();
|
root.modelData.notification.dismiss();
|
||||||
}
|
}
|
||||||
onReleased: event => {
|
onReleased: event => {
|
||||||
|
if (!containsMouse)
|
||||||
|
root.modelData.timer.start();
|
||||||
|
|
||||||
if (Math.abs(root.x) < Config.notifs.sizes.width * Config.notifs.clearThreshold)
|
if (Math.abs(root.x) < Config.notifs.sizes.width * Config.notifs.clearThreshold)
|
||||||
root.x = 0;
|
root.x = 0;
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue