Space Home Page

Add a space homepage with the ability to both create new room and add existing rooms to the space. This uses a tree model for the space hierarchy and will go to any number of levels. The user should only see the add options if they have appropriate permissions.

This MR also combines the create space and room pages and adds a lot of optional functionality for managing space children.

![image](/uploads/1764b0319241ff870dc39b18b39f5d51/image.png)
This commit is contained in:
James Graham
2023-09-28 17:36:23 +00:00
parent 08711fc927
commit ecdad9f965
24 changed files with 1486 additions and 80 deletions

View File

@@ -38,7 +38,7 @@ QQC2.ScrollView {
/**
* @brief The title that should be displayed for this component if available.
*/
readonly property string title: i18nc("@action:title", "Room information")
readonly property string title: root.room.isSpace ? i18nc("@action:title", "Space Members") : i18nc("@action:title", "Room information")
// HACK: Hide unnecessary horizontal scrollbar (https://bugreports.qt.io/browse/QTBUG-83890)
QQC2.ScrollBar.horizontal.policy: QQC2.ScrollBar.AlwaysOff
@@ -57,6 +57,7 @@ QQC2.ScrollView {
active: true
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.smallSpacing
visible: !root.room.isSpace
sourceComponent: root.room.isDirectChat() ? directChatDrawerHeader : groupChatDrawerHeader
onItemChanged: if (item) {
userList.positionViewAtBeginning();
@@ -64,6 +65,7 @@ QQC2.ScrollView {
}
Kirigami.ListSectionHeader {
visible: !root.room.isSpace
label: i18n("Options")
activeFocusOnTab: false
@@ -75,7 +77,7 @@ QQC2.ScrollView {
icon.name: "tools"
text: i18n("Open developer tools")
visible: Config.developerTools
visible: Config.developerTools && !root.room.isSpace
Layout.fillWidth: true
@@ -86,7 +88,7 @@ QQC2.ScrollView {
Delegates.RoundedItemDelegate {
id: searchButton
visible: !root.room.isSpace
icon.name: "search"
text: i18n("Search in this room")
@@ -104,7 +106,7 @@ QQC2.ScrollView {
Delegates.RoundedItemDelegate {
id: favouriteButton
visible: !root.room.isSpace
icon.name: root.room && root.room.isFavourite ? "rating" : "rating-unrated"
text: root.room && root.room.isFavourite ? i18n("Remove room from favorites") : i18n("Make room favorite")
@@ -115,7 +117,7 @@ QQC2.ScrollView {
Delegates.RoundedItemDelegate {
id: locationsButton
visible: !root.room.isSpace
icon.name: "map-flat"
text: i18n("Show locations for this room")
@@ -240,7 +242,9 @@ QQC2.ScrollView {
Component {
id: groupChatDrawerHeader
GroupChatDrawerHeader {}
GroupChatDrawerHeader {
room: root.room
}
}
Component {