From e49691fe3be0293a0d375a26e7f0941a44d8bd4c Mon Sep 17 00:00:00 2001 From: Jussi Kuokkanen Date: Thu, 17 Sep 2020 16:49:56 +0300 Subject: [PATCH 1/5] use Rectangle for typing users so it doesn't overlap with the timeline --- resources/qml/TimelineView.qml | 39 +++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 12 deletions(-) diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index dd9c4029..1c16ddc6 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -324,18 +324,33 @@ Page { id: footerContent anchors.left: parent.left anchors.right: parent.right - - Label { - id: typingDisplay - anchors.left: parent.left - anchors.right: parent.right - anchors.leftMargin: 10 - anchors.rightMargin: 10 - - color: colors.text - text: chat.model ? chat.model.formatTypingUsers(chat.model.typingUsers, colors.window) : "" - textFormat: Text.RichText - } + Rectangle { + id: typingRect + Connections { + target: chat.model + onTypingUsersChanged: { + if (chat.model && chat.model.formatTypingUsers(chat.model.typingUsers, + colors.window) === "") + typingRect.color = "transparent" + else + typingRect.color = colors.window + } + } + anchors.left: parent.left + anchors.right: parent.right + anchors.leftMargin: 10 + anchors.rightMargin: 10 + color: "transparent" + height: fontMetrics.height + Label { + id: typingDisplay + anchors.left: parent.left + anchors.right: parent.right + color: colors.text + text: chat.model ? chat.model.formatTypingUsers(chat.model.typingUsers, colors.window) : "" + textFormat: Text.RichText + } + } Rectangle { anchors.left: parent.left From c4635680318e8116b058a4791a44d48b5220b903 Mon Sep 17 00:00:00 2001 From: Jussi Kuokkanen Date: Thu, 17 Sep 2020 17:50:39 +0300 Subject: [PATCH 2/5] simplify check for no typing users --- resources/qml/TimelineView.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 71a287bb..202c09e9 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -439,8 +439,7 @@ Page { Connections { target: chat.model onTypingUsersChanged: { - if (chat.model && chat.model.formatTypingUsers(chat.model.typingUsers, - colors.window) === "") + if (chat.model && chat.model.typingUsers < 1) typingRect.color = "transparent" else typingRect.color = colors.window From 1f71f7227a8c299fe6e093a317fd96f467be14d9 Mon Sep 17 00:00:00 2001 From: Jussi Kuokkanen Date: Thu, 17 Sep 2020 17:52:40 +0300 Subject: [PATCH 3/5] make Rectangle to fill the gap between input widget and typing users --- resources/qml/TimelineView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 202c09e9..7c74794b 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -450,7 +450,7 @@ Page { anchors.leftMargin: 10 anchors.rightMargin: 10 color: "transparent" - height: fontMetrics.height + height: fontMetrics.height + 10 Label { id: typingDisplay anchors.left: parent.left From 8741e5f36a0bb2619fca3aa1edc8bfecdcb836b0 Mon Sep 17 00:00:00 2001 From: Lurkki14 <44469719+Lurkki14@users.noreply.github.com> Date: Fri, 18 Sep 2020 14:55:48 +0300 Subject: [PATCH 4/5] Set typing Rectangle color directly instead of Connection Co-authored-by: DeepBlueV7.X --- resources/qml/TimelineView.qml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 7c74794b..15a3bf04 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -436,20 +436,11 @@ Page { anchors.right: parent.right Rectangle { id: typingRect - Connections { - target: chat.model - onTypingUsersChanged: { - if (chat.model && chat.model.typingUsers < 1) - typingRect.color = "transparent" - else - typingRect.color = colors.window - } - } anchors.left: parent.left anchors.right: parent.right anchors.leftMargin: 10 anchors.rightMargin: 10 - color: "transparent" + color: (chat.model && chat.model.typingUsers.length > 0) ? colors.window : "transparent" height: fontMetrics.height + 10 Label { id: typingDisplay From 13658d536e30be03d353e9d17e72108d4abe5ad9 Mon Sep 17 00:00:00 2001 From: Jussi Kuokkanen Date: Fri, 18 Sep 2020 16:18:31 +0300 Subject: [PATCH 5/5] make typing Rectangle extents cleaner --- resources/qml/TimelineView.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 15a3bf04..aa4d6846 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -438,14 +438,14 @@ Page { id: typingRect anchors.left: parent.left anchors.right: parent.right - anchors.leftMargin: 10 - anchors.rightMargin: 10 color: (chat.model && chat.model.typingUsers.length > 0) ? colors.window : "transparent" - height: fontMetrics.height + 10 + height: chatFooter.height Label { id: typingDisplay anchors.left: parent.left + anchors.leftMargin: 10 anchors.right: parent.right + anchors.rightMargin: 10 color: colors.text text: chat.model ? chat.model.formatTypingUsers(chat.model.typingUsers, colors.window) : "" textFormat: Text.RichText