Fix message hover buttons (React, Edit, Reply) not moving with scroll

Fix #296
This commit is contained in:
Carl Schwan
2021-03-18 01:56:27 +01:00
parent 8e5ca78249
commit b349c2376d
2 changed files with 7 additions and 4 deletions

View File

@@ -46,8 +46,9 @@ Item {
// show hover actions
onHoveredChanged: {
if (hovered && !Kirigami.Settings.isMobile) {
hoverComponent.x = Qt.binding(() => column.mapToItem(page, hoverComponentX, hoverComponentY).x);
hoverComponent.y = Qt.binding(() => column.mapToItem(page, hoverComponentX, hoverComponentY).y);
hoverComponent.parent = controlContainer;
hoverComponent.x = Qt.binding(() => controlContainer.width - hoverComponent.childWidth)
hoverComponent.y = -Kirigami.Units.largeSpacing * 4
hoverComponent.hovered = Qt.binding(() => controlContainer.hovered);
hoverComponent.showEdit = author.id === Controller.activeConnection.localUserId && (model.eventType === "emote" || model.eventType === "message");

View File

@@ -129,7 +129,7 @@ Kirigami.ScrollablePage {
}
// hover actions on a delegate, activated in TimelineContainer.qml
Item {
QQC2.Popup {
id: hoverActions
property bool showEdit
property bool hovered: false
@@ -143,7 +143,9 @@ Kirigami.ScrollablePage {
property alias childWidth: hoverActionsRow.width
property alias childHeight: hoverActionsRow.height
RowLayout {
background: Item {}
contentItem: RowLayout {
id: hoverActionsRow
z: 4
spacing: 0