mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-24 13:32:22 +00:00
perf(chatScroll): Optimize StatusTextMessage size and hover binding for the delegate
This commit is contained in:
parent
2723ef1293
commit
27bb6bf665
@ -20,13 +20,12 @@ Item {
|
|||||||
signal linkActivated(string link)
|
signal linkActivated(string link)
|
||||||
|
|
||||||
implicitWidth: chatText.implicitWidth
|
implicitWidth: chatText.implicitWidth
|
||||||
implicitHeight: chatText.effectiveHeight + d.showMoreHeight
|
implicitHeight: chatText.height + d.showMoreHeight / 2
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
id: d
|
id: d
|
||||||
property bool readMore: false
|
property bool readMore: false
|
||||||
property bool isQuote: false
|
property bool isQuote: false
|
||||||
readonly property bool veryLongChatText: chatText.length > 1000
|
|
||||||
readonly property int showMoreHeight: showMoreButtonLoader.visible ? showMoreButtonLoader.height : 0
|
readonly property int showMoreHeight: showMoreButtonLoader.visible ? showMoreButtonLoader.height : 0
|
||||||
|
|
||||||
readonly property string text: {
|
readonly property string text: {
|
||||||
@ -77,8 +76,8 @@ Item {
|
|||||||
id: chatText
|
id: chatText
|
||||||
objectName: "StatusTextMessage_chatText"
|
objectName: "StatusTextMessage_chatText"
|
||||||
|
|
||||||
readonly property int effectiveHeight: d.veryLongChatText && !d.readMore
|
readonly property int effectiveHeight: showMoreButtonLoader.active && !d.readMore
|
||||||
? Math.min(chatText.implicitHeight, 200)
|
? 200
|
||||||
: chatText.implicitHeight
|
: chatText.implicitHeight
|
||||||
|
|
||||||
width: parent.width
|
width: parent.width
|
||||||
@ -86,7 +85,6 @@ Item {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: d.isQuote ? 8 : 0
|
anchors.leftMargin: d.isQuote ? 8 : 0
|
||||||
opacity: !showMoreOpacityMask.active && !horizontalOpacityMask.active ? 1 : 0
|
opacity: !showMoreOpacityMask.active && !horizontalOpacityMask.active ? 1 : 0
|
||||||
clip: true
|
|
||||||
text: d.text
|
text: d.text
|
||||||
selectedTextColor: Theme.palette.directColor1
|
selectedTextColor: Theme.palette.directColor1
|
||||||
selectionColor: Theme.palette.primaryColor3
|
selectionColor: Theme.palette.primaryColor3
|
||||||
@ -164,7 +162,7 @@ Item {
|
|||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: showMoreButtonLoader
|
id: showMoreButtonLoader
|
||||||
active: root.allowShowMore && d.veryLongChatText
|
active: root.allowShowMore && chatText.implicitHeight > 200
|
||||||
visible: active
|
visible: active
|
||||||
anchors.verticalCenter: chatText.bottom
|
anchors.verticalCenter: chatText.bottom
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
@ -461,7 +461,7 @@ Loader {
|
|||||||
topPadding: showHeader ? Style.current.halfPadding : 2
|
topPadding: showHeader ? Style.current.halfPadding : 2
|
||||||
bottomPadding: showHeader && nextMessageHasHeader() ? Style.current.halfPadding : 2
|
bottomPadding: showHeader && nextMessageHasHeader() ? Style.current.halfPadding : 2
|
||||||
disableHover: root.disableHover ||
|
disableHover: root.disableHover ||
|
||||||
(root.chatLogView && root.chatLogView.flickingVertically) ||
|
(root.chatLogView && root.chatLogView.moving) ||
|
||||||
(root.messageContextMenu && root.messageContextMenu.opened) ||
|
(root.messageContextMenu && root.messageContextMenu.opened) ||
|
||||||
Global.profilePopupOpened ||
|
Global.profilePopupOpened ||
|
||||||
Global.popupOpened
|
Global.popupOpened
|
||||||
|
Loading…
x
Reference in New Issue
Block a user