From a6b154c20777fe38f6fa31b8ed5eb8b1bfb97c8f Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 7 Sep 2019 15:42:23 -0400 Subject: [PATCH] Composer scrollbar: invisible unless really needed --- src/qml/Base/HScrollableTextArea.qml | 11 +++++++---- src/qml/Chat/Composer.qml | 8 ++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/qml/Base/HScrollableTextArea.qml b/src/qml/Base/HScrollableTextArea.qml index a25227d0..b7ca0221 100644 --- a/src/qml/Base/HScrollableTextArea.qml +++ b/src/qml/Base/HScrollableTextArea.qml @@ -2,15 +2,18 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 ScrollView { + id: scrollView + clip: true + ScrollBar.vertical.visible: contentHeight > height + + + default property alias textAreaData: textArea.data + property alias backgroundColor: textAreaBackground.color property alias placeholderText: textArea.placeholderText property alias text: textArea.text property alias area: textArea - default property alias textAreaData: textArea.data - - id: scrollView - clip: true TextArea { id: textArea diff --git a/src/qml/Chat/Composer.qml b/src/qml/Chat/Composer.qml index eadaf75e..c86b13e6 100644 --- a/src/qml/Chat/Composer.qml +++ b/src/qml/Chat/Composer.qml @@ -63,16 +63,16 @@ Rectangle { } HScrollableTextArea { - Layout.fillHeight: true - Layout.fillWidth: true - Layout.topMargin: Math.max(0, composer.Layout.minimumHeight - 34) - id: areaScrollView placeholderText: qsTr("Type a message...") backgroundColor: "transparent" area.tabStopDistance: 4 * 4 // 4 spaces area.focus: true + Layout.fillHeight: true + Layout.fillWidth: true + + function setTyping(typing) { py.callClientCoro( writingUserId,