update only position of HoverActions when contentY of TimelineView

changes
This commit is contained in:
Andreas Gattringer
2024-07-11 14:06:58 +02:00
parent 733de1d0e1
commit aa00773a3b
2 changed files with 10 additions and 7 deletions

View File

@@ -44,8 +44,6 @@ QQC2.Control {
leftPadding: 0
rightPadding: 0
x: delegate ? delegate.contentItem.x + delegate.bubbleX : 0
y: delegate ? delegate.mapToItem(parent, 0, 0).y + delegate.bubbleY - height + Kirigami.Units.smallSpacing : 0
width: delegate ? delegate.bubbleWidth : Kirigami.Units.gridUnit * 4
visible: (root.hovered || root.showActions || showActionsTimer.running) && !Kirigami.Settings.isMobile
@@ -61,6 +59,15 @@ QQC2.Control {
interval: 200
}
function updatePosition() {
if (delegate) {
root.x = delegate.contentItem.x + delegate.bubbleX;
root.y = delegate.mapToItem(parent, 0, 0).y + delegate.bubbleY - height + Kirigami.Units.smallSpacing;
}
}
onDelegateChanged: updatePosition()
contentItem: RowLayout {
Item {
Layout.fillWidth: true

View File

@@ -294,11 +294,7 @@ QQC2.ScrollView {
onFocusChatBar: root.focusChatBar()
}
onContentYChanged: {
if (hoverActions.delegate) {
hoverActions.delegate.setHoverActionsToDelegate();
}
}
onContentYChanged: hoverActions.updatePosition()
Connections {
target: root.timelineModel