sidebar/notifs: fix interactions outside container
This commit is contained in:
parent
42f8acedca
commit
5f1ffb32f4
4 changed files with 22 additions and 0 deletions
|
|
@ -106,6 +106,7 @@ Item {
|
|||
id: notifList
|
||||
|
||||
props: root.props
|
||||
container: view
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ Item {
|
|||
id: root
|
||||
|
||||
required property Props props
|
||||
required property Flickable container
|
||||
|
||||
readonly property alias repeater: repeater
|
||||
readonly property int spacing: Appearance.spacing.small
|
||||
|
|
@ -59,6 +60,14 @@ Item {
|
|||
return y;
|
||||
}
|
||||
|
||||
containmentMask: QtObject {
|
||||
function contains(p: point): bool {
|
||||
if (!root.container.contains(notif.mapToItem(root.container, p)))
|
||||
return false;
|
||||
return notifInner.contains(p);
|
||||
}
|
||||
}
|
||||
|
||||
implicitWidth: root.width
|
||||
implicitHeight: notifInner.implicitHeight
|
||||
|
||||
|
|
@ -130,6 +139,7 @@ Item {
|
|||
|
||||
modelData: notif.modelData
|
||||
props: root.props
|
||||
container: root.container
|
||||
}
|
||||
|
||||
Behavior on x {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ StyledRect {
|
|||
|
||||
required property string modelData
|
||||
required property Props props
|
||||
required property Flickable container
|
||||
|
||||
readonly property list<var> notifs: Notifs.list.filter(n => n.appName === modelData)
|
||||
readonly property int notifCount: notifs.reduce((acc, n) => n.closed ? acc : acc + 1, 0)
|
||||
|
|
@ -231,6 +232,7 @@ StyledRect {
|
|||
props: root.props
|
||||
notifs: root.notifs
|
||||
expanded: root.expanded
|
||||
container: root.container
|
||||
onRequestToggleExpand: expand => root.toggleExpand(expand)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ Item {
|
|||
required property Props props
|
||||
required property list<var> notifs
|
||||
required property bool expanded
|
||||
required property Flickable container
|
||||
|
||||
readonly property real nonAnimHeight: {
|
||||
let h = -root.spacing;
|
||||
|
|
@ -60,6 +61,14 @@ Item {
|
|||
return y;
|
||||
}
|
||||
|
||||
containmentMask: QtObject {
|
||||
function contains(p: point): bool {
|
||||
if (!root.container.contains(notif.mapToItem(root.container, p)))
|
||||
return false;
|
||||
return notifInner.contains(p);
|
||||
}
|
||||
}
|
||||
|
||||
implicitWidth: root.width
|
||||
implicitHeight: notifInner.implicitHeight
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue