From cc6693af8aa97c113b1abbc05fe5a18b09759bac Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Mon, 9 Aug 2021 19:24:46 -0400 Subject: [PATCH 1/3] Close currently open room when it is tapped again --- resources/qml/RoomList.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml index 98532606..cee4b30e 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml @@ -190,7 +190,12 @@ Page { TapHandler { margin: -Nheko.paddingSmall - onSingleTapped: Rooms.setCurrentRoom(roomId) + onSingleTapped: { + if (!Rooms.currentRoom || Rooms.currentRoom.roomId !== roomId) + Rooms.setCurrentRoom(roomId); + else + Rooms.resetCurrentRoom(); + } onLongPressed: { if (!isInvite) roomContextMenu.show(roomId, tags); From 308207c28927bf69246dccff540e353cacb41d17 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Tue, 10 Aug 2021 22:16:22 -0400 Subject: [PATCH 2/3] Remove unnecessary debugging log --- resources/qml/RoomList.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml index cee4b30e..66cbac5a 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml @@ -34,7 +34,6 @@ Page { Connections { function onCurrentRoomChanged() { roomlist.positionViewAtIndex(Rooms.roomidToIndex(Rooms.currentRoom.roomId), ListView.Contain); - console.log("Test" + Rooms.currentRoom.roomId + " " + Rooms.roomidToIndex(Rooms.currentRoom.roomId)); } target: Rooms From 9a0c1c27edb2bcd0ab8e6fb4b59039c66218b935 Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Tue, 10 Aug 2021 22:16:27 -0400 Subject: [PATCH 3/3] Remove warnings on closing room --- resources/qml/RoomList.qml | 3 ++- resources/qml/TimelineView.qml | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml index 66cbac5a..576383e2 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml @@ -33,7 +33,8 @@ Page { Connections { function onCurrentRoomChanged() { - roomlist.positionViewAtIndex(Rooms.roomidToIndex(Rooms.currentRoom.roomId), ListView.Contain); + if (Rooms.currentRoom) + roomlist.positionViewAtIndex(Rooms.roomidToIndex(Rooms.currentRoom.roomId), ListView.Contain); } target: Rooms diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml index 6fc9d51b..5e99ee5c 100644 --- a/resources/qml/TimelineView.qml +++ b/resources/qml/TimelineView.qml @@ -85,9 +85,13 @@ Item { target: timelineView } - MessageView { + Loader { + active: room || roomPreview Layout.fillWidth: true - implicitHeight: msgView.height - typingIndicator.height + sourceComponent: MessageView { + implicitHeight: msgView.height - typingIndicator.height + } + } Loader {