summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2021-08-11 18:13:38 -0400
committerGitHub <noreply@github.com>2021-08-11 18:13:38 -0400
commit21b2db6745c22328af3ddb8e9cc84c5264405a80 (patch)
treeaf9dc5bc9f1a3d63ea639d77f87c44da4710e304
parentFix typo in coeurl (diff)
parentRemove warnings on closing room (diff)
downloadnheko-21b2db6745c22328af3ddb8e9cc84c5264405a80.tar.xz
Merge pull request #678 from LorenDB/closeRoom
Close currently open room when it is tapped again
-rw-r--r--resources/qml/RoomList.qml11
-rw-r--r--resources/qml/TimelineView.qml8
2 files changed, 14 insertions, 5 deletions
diff --git a/resources/qml/RoomList.qml b/resources/qml/RoomList.qml

index 98532606..576383e2 100644 --- a/resources/qml/RoomList.qml +++ b/resources/qml/RoomList.qml
@@ -33,8 +33,8 @@ Page { Connections { function onCurrentRoomChanged() { - roomlist.positionViewAtIndex(Rooms.roomidToIndex(Rooms.currentRoom.roomId), ListView.Contain); - console.log("Test" + Rooms.currentRoom.roomId + " " + Rooms.roomidToIndex(Rooms.currentRoom.roomId)); + if (Rooms.currentRoom) + roomlist.positionViewAtIndex(Rooms.roomidToIndex(Rooms.currentRoom.roomId), ListView.Contain); } target: Rooms @@ -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); 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 {