From aa00773a3beb6fa46c3ad6751df26e4ca87ca31f Mon Sep 17 00:00:00 2001 From: Andreas Gattringer Date: Thu, 11 Jul 2024 14:06:58 +0200 Subject: [PATCH] update only position of HoverActions when contentY of TimelineView changes --- src/qml/HoverActions.qml | 11 +++++++++-- src/qml/TimelineView.qml | 6 +----- 2 files changed, 10 insertions(+), 7 deletions(-) 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