mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 21:18:48 +03:00
Merge pull request #678 from LorenDB/closeRoom
Close currently open room when it is tapped again
This commit is contained in:
commit
21b2db6745
2 changed files with 14 additions and 5 deletions
|
@ -33,8 +33,8 @@ Page {
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
function onCurrentRoomChanged() {
|
function onCurrentRoomChanged() {
|
||||||
roomlist.positionViewAtIndex(Rooms.roomidToIndex(Rooms.currentRoom.roomId), ListView.Contain);
|
if (Rooms.currentRoom)
|
||||||
console.log("Test" + Rooms.currentRoom.roomId + " " + Rooms.roomidToIndex(Rooms.currentRoom.roomId));
|
roomlist.positionViewAtIndex(Rooms.roomidToIndex(Rooms.currentRoom.roomId), ListView.Contain);
|
||||||
}
|
}
|
||||||
|
|
||||||
target: Rooms
|
target: Rooms
|
||||||
|
@ -190,7 +190,12 @@ Page {
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
margin: -Nheko.paddingSmall
|
margin: -Nheko.paddingSmall
|
||||||
onSingleTapped: Rooms.setCurrentRoom(roomId)
|
onSingleTapped: {
|
||||||
|
if (!Rooms.currentRoom || Rooms.currentRoom.roomId !== roomId)
|
||||||
|
Rooms.setCurrentRoom(roomId);
|
||||||
|
else
|
||||||
|
Rooms.resetCurrentRoom();
|
||||||
|
}
|
||||||
onLongPressed: {
|
onLongPressed: {
|
||||||
if (!isInvite)
|
if (!isInvite)
|
||||||
roomContextMenu.show(roomId, tags);
|
roomContextMenu.show(roomId, tags);
|
||||||
|
|
|
@ -85,9 +85,13 @@ Item {
|
||||||
target: timelineView
|
target: timelineView
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageView {
|
Loader {
|
||||||
|
active: room || roomPreview
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
implicitHeight: msgView.height - typingIndicator.height
|
sourceComponent: MessageView {
|
||||||
|
implicitHeight: msgView.height - typingIndicator.height
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
|
|
Loading…
Reference in a new issue