diff --git a/src/qml/HoverActions.qml b/src/qml/HoverActions.qml index f1f6eba20..d45a54c49 100644 --- a/src/qml/HoverActions.qml +++ b/src/qml/HoverActions.qml @@ -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 diff --git a/src/qml/TimelineView.qml b/src/qml/TimelineView.qml index 01227664b..a4d21781f 100644 --- a/src/qml/TimelineView.qml +++ b/src/qml/TimelineView.qml @@ -294,11 +294,7 @@ QQC2.ScrollView { onFocusChatBar: root.focusChatBar() } - onContentYChanged: { - if (hoverActions.delegate) { - hoverActions.delegate.setHoverActionsToDelegate(); - } - } + onContentYChanged: hoverActions.updatePosition() Connections { target: root.timelineModel