From cd16b3513c78c9d57b919fd0f18692a521444242 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 1 Dec 2020 15:31:49 +0100 Subject: [PATCH] Add topic in room title Fix #83 --- imports/NeoChat/Page/RoomPage.qml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/imports/NeoChat/Page/RoomPage.qml b/imports/NeoChat/Page/RoomPage.qml index ad646ee79..ded781ac7 100644 --- a/imports/NeoChat/Page/RoomPage.qml +++ b/imports/NeoChat/Page/RoomPage.qml @@ -29,7 +29,29 @@ Kirigami.ScrollablePage { signal switchRoomUp() signal switchRoomDown() - title: currentRoom.name + titleDelegate: Component { + RowLayout { + Layout.fillWidth: true + Layout.maximumWidth: implicitWidth + 1 // The +1 is to make sure we do not trigger eliding at max width + Layout.minimumWidth: 0 + Kirigami.Heading { + level: 1 + text: currentRoom.name + opacity: page.isCurrentPage ? 1 : 0.4 + maximumLineCount: 1 + Layout.leftMargin: Kirigami.Units.largeSpacing + Layout.alignment: Qt.AlignBottom + } + QQC2.Label { + Layout.alignment: Qt.AlignBottom + text: currentRoom.topic + Layout.fillWidth: true + //wrapMode: Text.WordWrap + elide: Text.ElideRight + color: Kirigami.Theme.disabledTextColor + } + } + } focus: true Keys.onTabPressed: {