From 68c9b533d4063ca9ef01d39a9b57ce8f296ad02f Mon Sep 17 00:00:00 2001 From: Alexandra Betouni Date: Fri, 16 Jul 2021 20:00:06 +0300 Subject: [PATCH] [#2598] Fixed New messages have their buttons getting overlapped by messages above Closes #2598 --- .../Chat/ChatColumn/ChatMessages.qml | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml b/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml index cb2ab9ec0b..5c90172d06 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn/ChatMessages.qml @@ -33,7 +33,7 @@ SplitView { ScrollView { id: root contentItem: chatLogView - + SplitView.fillWidth: true SplitView.minimumWidth: 200 @@ -41,6 +41,8 @@ SplitView { ScrollBar.vertical.policy: chatLogView.contentHeight > chatLogView.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff ScrollBar.horizontal.policy: ScrollBar.AlwaysOff + property int countOnStartUp: 0 + ListView { id: chatLogView anchors.fill: parent @@ -261,6 +263,14 @@ SplitView { icon: StandardIcon.Critical } + Timer { + id: modelLoadingDelayTimer + interval: 1000 + onTriggered: { + root.countOnStartUp = messageListDelegate.count; + } + } + DelegateModelGeneralized { id: messageListDelegate lessThan: [ @@ -301,7 +311,12 @@ SplitView { pinnedBy: model.pinnedBy gapFrom: model.gapFrom gapTo: model.gapTo - + Component.onCompleted: { + if ((root.countOnStartUp > 0) && (root.countOnStartUp - 1) < index) { + //new message, increment z order + z = index; + } + } // This is used in order to have access to the previous message and determine the timestamp // we can't rely on the index because the sequence of messages is not ordered on the nim side prevMessageIndex: { @@ -321,6 +336,9 @@ SplitView { scrollToBottom: chatLogView.scrollToBottom timeout: model.timeout } + Component.onCompleted: { + modelLoadingDelayTimer.start(); + } } } @@ -343,9 +361,6 @@ SplitView { id: userListComponent UserList { } } - - - } /*##^##