perf(chatScroll): Create message quick context items only when message row is hovered

This commit is contained in:
Alex Jbanca 2023-01-12 16:32:51 +02:00 committed by Alex Jbanca
parent c26035e245
commit 8cb4420d49
2 changed files with 17 additions and 7 deletions

View File

@ -23,7 +23,7 @@ Control {
Invitation = 7
}
property alias quickActions: quickActionsPanel.items
property list<Item> quickActions
property var statusChatInput
property alias linksComponent: linksLoader.sourceComponent
property alias transcationComponent: transactionBubbleLoader.sourceComponent
@ -365,13 +365,18 @@ Control {
}
}
StatusMessageQuickActions {
id: quickActionsPanel
Loader {
active: root.hovered && !root.hideQuickActions
anchors.right: parent.right
anchors.rightMargin: 20
anchors.top: parent.top
anchors.topMargin: -8
visible: root.hovered && !root.hideQuickActions
sourceComponent: Component {
StatusMessageQuickActions {
id: quickActionsPanel
items: root.quickActions
}
}
}
}

View File

@ -727,7 +727,7 @@ Loader {
quickActions: [
Loader {
active: !root.isInPinnedPopup
active: !root.isInPinnedPopup && delegate.hovered
sourceComponent: StatusFlatRoundButton {
width: d.chatButtonSize
height: d.chatButtonSize
@ -741,7 +741,7 @@ Loader {
}
},
Loader {
active: !root.isInPinnedPopup
active: !root.isInPinnedPopup && delegate.hovered
sourceComponent: StatusFlatRoundButton {
objectName: "replyToMessageButton"
width: d.chatButtonSize
@ -758,7 +758,7 @@ Loader {
}
},
Loader {
active: !root.isInPinnedPopup && root.isText && !root.editModeOn && root.amISender
active: !root.isInPinnedPopup && root.isText && !root.editModeOn && root.amISender && delegate.hovered
visible: active
sourceComponent: StatusFlatRoundButton {
objectName: "editMessageButton"
@ -774,6 +774,9 @@ Loader {
},
Loader {
active: {
if(!delegate.hovered)
return false;
if (!root.messageStore)
return false
@ -819,6 +822,8 @@ Loader {
},
Loader {
active: {
if(!delegate.hovered)
return false;
if (root.isInPinnedPopup)
return false;
if (!root.messageStore)