summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-07-21 18:56:20 -0400
committerLoren Burkholder <computersemiexpert@outlook.com>2021-07-21 18:56:20 -0400
commit44be4c1f4a4e1ef60fbb6c1f51adc93e5a555f14 (patch)
tree491b79ebb9a07394be4a5623967c6c4c348104ec /resources
parentOpen room members when member info label clicked (diff)
downloadnheko-44be4c1f4a4e1ef60fbb6c1f51adc93e5a555f14.tar.xz
Move various room auxiliary functions to TimelineManager
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/RoomMembers.qml5
-rw-r--r--resources/qml/RoomSettings.qml2
-rw-r--r--resources/qml/Root.qml2
-rw-r--r--resources/qml/TopBar.qml10
4 files changed, 9 insertions, 10 deletions
diff --git a/resources/qml/RoomMembers.qml b/resources/qml/RoomMembers.qml
index 3758cb0b..5bf847ca 100644
--- a/resources/qml/RoomMembers.qml
+++ b/resources/qml/RoomMembers.qml
@@ -41,7 +41,7 @@ ApplicationWindow {
             displayName: members.roomName
             Layout.alignment: Qt.AlignHCenter
             url: members.avatarUrl.replace("mxc://", "image://MxcImage/")
-            onClicked: Rooms.currentRoom.openRoomSettings(members.roomId)
+            onClicked: TimelineManager.openRoomSettings(members.roomId)
         }
 
         ElidedLabel {
@@ -57,7 +57,7 @@ ApplicationWindow {
             hoverEnabled: true
             ToolTip.visible: hovered
             ToolTip.text: qsTr("Invite more people")
-            onClicked: Rooms.currentRoom.openInviteUsers()
+            onClicked: TimelineManager.openInviteUsers(members.roomId)
         }
 
         ScrollView {
@@ -121,7 +121,6 @@ ApplicationWindow {
                 footer: Item {
                     width: parent.width
                     visible: (members.numUsersLoaded < members.memberCount) && members.loadingMoreMembers
-
                     // use the default height if it's visible, otherwise no height at all
                     height: membersLoadingSpinner.height
                     anchors.margins: Nheko.paddingMedium
diff --git a/resources/qml/RoomSettings.qml b/resources/qml/RoomSettings.qml
index 8746d4d3..b4936f3e 100644
--- a/resources/qml/RoomSettings.qml
+++ b/resources/qml/RoomSettings.qml
@@ -107,7 +107,7 @@ ApplicationWindow {
                 Layout.alignment: Qt.AlignHCenter
 
                 TapHandler {
-                    onTapped: Rooms.currentRoom.openRoomMembers(roomSettings.roomId)
+                    onTapped: TimelineManager.openRoomMembers(roomSettings.roomId)
                 }
 
                 CursorShape {
diff --git a/resources/qml/Root.qml b/resources/qml/Root.qml
index f71c18e2..8e226639 100644
--- a/resources/qml/Root.qml
+++ b/resources/qml/Root.qml
@@ -133,7 +133,7 @@ Page {
     }
 
     Connections {
-        target: Rooms.currentRoom
+        target: TimelineManager
         onOpenRoomMembersDialog: {
             var membersDialog = roomMembersComponent.createObject(timelineRoot, {
                 "members": members,
diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml
index 48491f84..8543d02a 100644
--- a/resources/qml/TopBar.qml
+++ b/resources/qml/TopBar.qml
@@ -24,7 +24,7 @@ Rectangle {
     TapHandler {
         onSingleTapped: {
             if (room)
-                room.openRoomSettings();
+                TimelineManager.openRoomSettings(room.roomId);
 
             eventPoint.accepted = true;
         }
@@ -66,7 +66,7 @@ Rectangle {
             displayName: roomName
             onClicked: {
                 if (room)
-                    room.openRoomSettings();
+                    TimelineManager.openRoomSettings(room.roomId);
 
             }
         }
@@ -111,12 +111,12 @@ Rectangle {
                 Platform.MenuItem {
                     visible: room ? room.permissions.canInvite() : false
                     text: qsTr("Invite users")
-                    onTriggered: Rooms.currentRoom.openInviteUsers()
+                    onTriggered: TimelineManager.openInviteUsers(room.roomId)
                 }
 
                 Platform.MenuItem {
                     text: qsTr("Members")
-                    onTriggered: Rooms.currentRoom.openRoomMembers()
+                    onTriggered: TimelineManager.openRoomMembers(room.roomId)
                 }
 
                 Platform.MenuItem {
@@ -126,7 +126,7 @@ Rectangle {
 
                 Platform.MenuItem {
                     text: qsTr("Settings")
-                    onTriggered: room.openRoomSettings()
+                    onTriggered: TimelineManager.openRoomSettings(room.roomId)
                 }
 
             }