forked from Shinonome/dots-hyprland
notifications: middle click to dismiss
This commit is contained in:
@@ -76,12 +76,13 @@ Item { // Notification group area
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
interactive: !expanded
|
interactive: !expanded
|
||||||
automaticallyReset: false
|
automaticallyReset: false
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
|
||||||
|
|
||||||
onClicked: (mouse) => {
|
onClicked: (mouse) => {
|
||||||
if (mouse.button === Qt.RightButton) {
|
if (mouse.button === Qt.RightButton)
|
||||||
root.toggleExpanded();
|
root.toggleExpanded();
|
||||||
}
|
else if (mouse.button === Qt.MiddleButton)
|
||||||
|
root.destroyWithAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
onDraggingChanged: () => {
|
onDraggingChanged: () => {
|
||||||
|
|||||||
@@ -61,10 +61,16 @@ Item { // Notification item area
|
|||||||
DragManager { // Drag manager
|
DragManager { // Drag manager
|
||||||
id: dragManager
|
id: dragManager
|
||||||
anchors.fill: root
|
anchors.fill: root
|
||||||
anchors.leftMargin: -notificationIcon.implicitWidth
|
anchors.leftMargin: root.expanded ? -notificationIcon.implicitWidth : 0
|
||||||
interactive: expanded
|
interactive: expanded
|
||||||
automaticallyReset: false
|
automaticallyReset: false
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton | Qt.MiddleButton
|
||||||
|
|
||||||
|
onClicked: (mouse) => {
|
||||||
|
if (mouse.button === Qt.MiddleButton) {
|
||||||
|
root.destroyWithAnimation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onPressAndHold: (mouse) => {
|
onPressAndHold: (mouse) => {
|
||||||
if (mouse.button === Qt.LeftButton) {
|
if (mouse.button === Qt.LeftButton) {
|
||||||
|
|||||||
Reference in New Issue
Block a user