From deb11367cb937bd93728fe0fd66e52ccffba56ac Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Sun, 10 Sep 2023 18:59:48 +0300 Subject: [PATCH] ChatBox: Fix jittery ChatBar ChatBar animated its implicit height, and there is no way for us to force it animating on integer values only. It is contained in a Layout type, and QtQuick.Layouts are known to round up size of their items and position them on an integer scale. All in all, is caused bottom of chat bar (action icons row and the whole bottom edge) to flicker during height animation. --- src/qml/Component/ChatBox/ChatBox.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qml/Component/ChatBox/ChatBox.qml b/src/qml/Component/ChatBox/ChatBox.qml index 59a235812..a551fb2cf 100644 --- a/src/qml/Component/ChatBox/ChatBox.qml +++ b/src/qml/Component/ChatBox/ChatBox.qml @@ -65,9 +65,10 @@ ColumnLayout { visible: root.currentRoom.canSendEvent("m.room.message") Layout.fillWidth: true - Layout.minimumHeight: Math.max(Kirigami.Units.gridUnit * 2, implicitHeight + Kirigami.Units.largeSpacing) + Layout.minimumHeight: Math.max(Kirigami.Units.gridUnit * 2, Math.round(implicitHeight) + Kirigami.Units.largeSpacing) // lineSpacing is height+leading, so subtract leading once since leading only exists between lines. Layout.maximumHeight: chatBarFontMetrics.lineSpacing * 8 - chatBarFontMetrics.leading + textField.topPadding + textField.bottomPadding + Layout.preferredHeight: Math.round(implicitHeight) currentRoom: root.currentRoom