Open room members when member info label clicked

pull/650/head
Loren Burkholder 4 years ago
parent d33538316c
commit b17002929c
  1. 12
      resources/qml/RoomSettings.qml
  2. 2
      src/MemberList.cpp
  3. 2
      src/MemberList.h
  4. 4
      src/timeline/TimelineModel.cpp
  5. 2
      src/timeline/TimelineModel.h

@ -4,7 +4,7 @@
import "./ui"
import Qt.labs.platform 1.1 as Platform
import QtQuick 2.9
import QtQuick 2.15
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.2
import QtQuick.Window 2.3
@ -105,6 +105,16 @@ ApplicationWindow {
MatrixText {
text: qsTr("%1 member(s)").arg(roomSettings.memberCount)
Layout.alignment: Qt.AlignHCenter
TapHandler {
onTapped: Rooms.currentRoom.openRoomMembers(roomSettings.roomId)
}
CursorShape {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
}
}
}

@ -22,7 +22,7 @@
#include "timeline/TimelineViewManager.h"
#include "ui/Avatar.h"
MemberList::MemberList(const QString &room_id, QWidget *parent)
MemberList::MemberList(const QString &room_id, QObject *parent)
: QAbstractListModel{parent}
, room_id_{room_id}
{

@ -25,7 +25,7 @@ public:
DisplayName,
AvatarUrl,
};
MemberList(const QString &room_id, QWidget *parent = nullptr);
MemberList(const QString &room_id, QObject *parent = nullptr);
QHash<int, QByteArray> roleNames() const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override

@ -1067,9 +1067,9 @@ TimelineModel::openUserProfile(QString userid)
}
void
TimelineModel::openRoomMembers()
TimelineModel::openRoomMembers(QString room_id)
{
MemberList *memberList = new MemberList(roomId());
MemberList *memberList = new MemberList(room_id == QString() ? roomId() : room_id, this);
emit openRoomMembersDialog(memberList);
}

@ -239,7 +239,7 @@ public:
Q_INVOKABLE void forwardMessage(QString eventId, QString roomId);
Q_INVOKABLE void viewDecryptedRawMessage(QString id) const;
Q_INVOKABLE void openUserProfile(QString userid);
Q_INVOKABLE void openRoomMembers();
Q_INVOKABLE void openRoomMembers(QString room_id = QString());
Q_INVOKABLE void openRoomSettings(QString room_id = QString());
Q_INVOKABLE void openInviteUsers(QString roomId = QString());
Q_INVOKABLE void editAction(QString id);

Loading…
Cancel
Save