From 59a2630be74898c5d8c13dbf0489e5caa94063fd Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Sat, 12 Jun 2021 12:00:59 -0400 Subject: [PATCH] Simplify room details access This removes the redundant room name property --- resources/qml/InviteDialog.qml | 1 - resources/qml/RoomMembers.qml | 5 ++--- resources/qml/TopBar.qml | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/resources/qml/InviteDialog.qml b/resources/qml/InviteDialog.qml index 8ba0f262..2932e398 100644 --- a/resources/qml/InviteDialog.qml +++ b/resources/qml/InviteDialog.qml @@ -56,7 +56,6 @@ ApplicationWindow { id: inviteeEntry placeholderText: qsTr("@joe:matrix.org", "Example user id. The name 'joe' can be localized however you want.") - backgroundColor: colors.window Layout.fillWidth: true onAccepted: if (text !== "") addInvite() Component.onCompleted: forceActiveFocus() diff --git a/resources/qml/RoomMembers.qml b/resources/qml/RoomMembers.qml index 8060a6cc..8addd704 100644 --- a/resources/qml/RoomMembers.qml +++ b/resources/qml/RoomMembers.qml @@ -7,10 +7,9 @@ import im.nheko 1.0 ApplicationWindow { id: roomMembersRoot - property string roomName: Rooms.currentRoom.roomName property MemberList members - title: qsTr("Members of ") + roomName + title: qsTr("Members of ") + members.roomName x: MainWindow.x + (MainWindow.width / 2) - (width / 2) y: MainWindow.y + (MainWindow.height / 2) - (height / 2) height: 650 @@ -40,7 +39,7 @@ ApplicationWindow { Label { font.pixelSize: 24 - text: members.memberCount + (members.memberCount === 1 ? qsTr(" person in ") : qsTr(" people in ")) + roomName + text: members.memberCount + (members.memberCount === 1 ? qsTr(" person in ") : qsTr(" people in ")) + members.roomName Layout.alignment: Qt.AlignHCenter } diff --git a/resources/qml/TopBar.qml b/resources/qml/TopBar.qml index 6cf747c5..aa5c5d18 100644 --- a/resources/qml/TopBar.qml +++ b/resources/qml/TopBar.qml @@ -111,12 +111,12 @@ Rectangle { Platform.MenuItem { visible: room ? room.permissions.canInvite() : false text: qsTr("Invite users") - onTriggered: TimelineManager.timeline.openInviteUsers() + onTriggered: Rooms.currentRoom.openInviteUsers() } Platform.MenuItem { text: qsTr("Members") - onTriggered: Rooms.currentRoom.openRoomMembers(room.roomId()) + onTriggered: Rooms.currentRoom.openRoomMembers() } Platform.MenuItem {