From e5d64f76b7dc31b3ad75542f3a7e25978ae25c1c Mon Sep 17 00:00:00 2001 From: miruka Date: Fri, 5 Jun 2020 05:48:25 -0400 Subject: [PATCH] Limit max height of room settings topic area --- src/gui/Pages/Chat/RoomPane/SettingsView.qml | 28 +++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/gui/Pages/Chat/RoomPane/SettingsView.qml b/src/gui/Pages/Chat/RoomPane/SettingsView.qml index 939f58e8..3032492d 100644 --- a/src/gui/Pages/Chat/RoomPane/SettingsView.qml +++ b/src/gui/Pages/Chat/RoomPane/SettingsView.qml @@ -1,11 +1,15 @@ // SPDX-License-Identifier: LGPL-3.0-or-later import QtQuick 2.12 +import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import "../../../Base" import "../../../Base/ButtonLayout" HFlickableColumnPage { + id: settingsView + + property var saveFuture: null readonly property bool anyChange: @@ -113,17 +117,23 @@ HFlickableColumnPage { Layout.fillWidth: true - HTextArea { - // TODO: limit height + ScrollView { + clip: true width: parent.width - placeholderText: qsTr("This room is about...") - defaultText: chat.roomInfo.plain_topic - enabled: chat.roomInfo.can_set_topic + height: + Math.min(topicAreaIn.implicitHeight, settingsView.height / 2) - focusItemOnTab: - encryptCheckBox.checked ? - requireInviteCheckbox : - encryptCheckBox + HTextArea { + id: topicAreaIn + placeholderText: qsTr("This room is about...") + defaultText: chat.roomInfo.plain_topic + enabled: chat.roomInfo.can_set_topic + + focusItemOnTab: + encryptCheckBox.checked ? + requireInviteCheckbox : + encryptCheckBox + } } }