Compare commits

..

3 Commits

Author SHA1 Message Date
Tobias Fella
30dd6297ee Make sure we're switching out of the space home page when leaving the currently opened space 2024-03-29 11:57:06 +01:00
Tobias Fella
ce02183f82 Fix plural handling in space member strings 2024-03-29 11:56:29 +01:00
Tobias Fella
7c74a6cbe1 Improve space management strings 2024-03-29 11:56:06 +01:00
3 changed files with 8 additions and 3 deletions

View File

@@ -97,7 +97,7 @@ Item {
Layout.fillWidth: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
text: root.memberCount + (root.topic !== "" ? i18nc("number of room members", " members - ") + root.topic : i18nc("number of room members", " members"))
text: root.topic.length > 0 ? i18ncp("number of room members", "%1 member - ", "%1 members - ", root.memberCount) + root.topic : i18ncp("number of room members", "%1 member", "%1 members", root.memberCount)
elide: Text.ElideRight
font: Kirigami.Theme.smallFont
textFormat: Text.PlainText
@@ -106,7 +106,7 @@ Item {
}
QQC2.ToolButton {
visible: root.isSpace && root.canAddChildren
text: i18nc("@button", "Add new child")
text: i18nc("@button", "Add new room")
icon.name: "list-add"
display: QQC2.AbstractButton.IconOnly
onClicked: root.createRoom()

View File

@@ -55,7 +55,7 @@ Kirigami.Page {
}
QQC2.Button {
visible: root.currentRoom.canSendState("m.space.child")
text: i18nc("@button", "Add new child")
text: i18nc("@button", "Add new room")
icon.name: "list-add"
onClicked: _private.createRoom(root.currentRoom.id)
}

View File

@@ -375,6 +375,11 @@ void RoomManager::leaveRoom(NeoChatRoom *room)
m_currentRoom = m_lastCurrentRoom;
m_lastCurrentRoom = nullptr;
Q_EMIT currentRoomChanged();
if (m_currentRoom->isSpace()) {
Q_EMIT replaceSpaceHome(m_currentRoom);
} else {
Q_EMIT replaceRoom(m_currentRoom, {});
}
}
room->forget();