mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 03:00:46 +03:00
Open room members when member info label clicked
This commit is contained in:
parent
d33538316c
commit
b17002929c
5 changed files with 16 additions and 6 deletions
|
@ -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…
Reference in a new issue