Simplify room details access

This removes the redundant room name property
This commit is contained in:
Loren Burkholder 2021-06-12 12:00:59 -04:00
parent 908629bec0
commit 59a2630be7
3 changed files with 4 additions and 6 deletions

View file

@ -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()

View file

@ -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
}

View file

@ -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 {