mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-10-30 17:40:47 +03:00
Reenable top bar room settings menus on avatar or title clicks
Also fixes a bug with an empty room settings window introduced in the port.
This commit is contained in:
parent
640b0ee405
commit
77e241b9e5
6 changed files with 29 additions and 15 deletions
|
@ -126,6 +126,11 @@ Page {
|
||||||
|
|
||||||
color: colors.base
|
color: colors.base
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: timelineManager.openRoomSettings();
|
||||||
|
}
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
id: topLayout
|
id: topLayout
|
||||||
|
|
||||||
|
@ -164,6 +169,11 @@ Page {
|
||||||
height: avatarSize
|
height: avatarSize
|
||||||
url: chat.model.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
|
url: chat.model.roomAvatarUrl.replace("mxc://", "image://MxcImage/")
|
||||||
displayName: chat.model.roomName
|
displayName: chat.model.roomName
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: timelineManager.openRoomSettings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
@ -173,6 +183,11 @@ Page {
|
||||||
|
|
||||||
font.pointSize: fontMetrics.font.pointSize * 1.1
|
font.pointSize: fontMetrics.font.pointSize * 1.1
|
||||||
text: chat.model.roomName
|
text: chat.model.roomName
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: timelineManager.openRoomSettings();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
MatrixText {
|
MatrixText {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
|
@ -225,6 +225,9 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
connect(room_list_, &RoomList::roomChanged, this, [this](QString room_id) {
|
||||||
|
this->current_room_ = room_id;
|
||||||
|
});
|
||||||
connect(room_list_, &RoomList::roomChanged, text_input_, &TextInputWidget::stopTyping);
|
connect(room_list_, &RoomList::roomChanged, text_input_, &TextInputWidget::stopTyping);
|
||||||
connect(room_list_, &RoomList::roomChanged, splitter, &Splitter::showChatView);
|
connect(room_list_, &RoomList::roomChanged, splitter, &Splitter::showChatView);
|
||||||
connect(room_list_, &RoomList::roomChanged, text_input_, &TextInputWidget::focusLineEdit);
|
connect(room_list_, &RoomList::roomChanged, text_input_, &TextInputWidget::focusLineEdit);
|
||||||
|
|
|
@ -340,9 +340,7 @@ MainWindow::openUserProfile(const QString &user_id, const QString &room_id)
|
||||||
void
|
void
|
||||||
MainWindow::openRoomSettings(const QString &room_id)
|
MainWindow::openRoomSettings(const QString &room_id)
|
||||||
{
|
{
|
||||||
const auto roomToSearch = room_id.isEmpty() ? chat_page_->currentRoom() : "";
|
auto dialog = new dialogs::RoomSettings(room_id, this);
|
||||||
|
|
||||||
auto dialog = new dialogs::RoomSettings(roomToSearch, this);
|
|
||||||
|
|
||||||
showDialog(dialog);
|
showDialog(dialog);
|
||||||
}
|
}
|
||||||
|
@ -350,8 +348,7 @@ MainWindow::openRoomSettings(const QString &room_id)
|
||||||
void
|
void
|
||||||
MainWindow::openMemberListDialog(const QString &room_id)
|
MainWindow::openMemberListDialog(const QString &room_id)
|
||||||
{
|
{
|
||||||
const auto roomToSearch = room_id.isEmpty() ? chat_page_->currentRoom() : "";
|
auto dialog = new dialogs::MemberList(room_id, this);
|
||||||
auto dialog = new dialogs::MemberList(roomToSearch, this);
|
|
||||||
|
|
||||||
showDialog(dialog);
|
showDialog(dialog);
|
||||||
}
|
}
|
||||||
|
@ -359,11 +356,9 @@ MainWindow::openMemberListDialog(const QString &room_id)
|
||||||
void
|
void
|
||||||
MainWindow::openLeaveRoomDialog(const QString &room_id)
|
MainWindow::openLeaveRoomDialog(const QString &room_id)
|
||||||
{
|
{
|
||||||
auto roomToLeave = room_id.isEmpty() ? chat_page_->currentRoom() : room_id;
|
|
||||||
|
|
||||||
auto dialog = new dialogs::LeaveRoom(this);
|
auto dialog = new dialogs::LeaveRoom(this);
|
||||||
connect(dialog, &dialogs::LeaveRoom::leaving, this, [this, roomToLeave]() {
|
connect(dialog, &dialogs::LeaveRoom::leaving, this, [this, room_id]() {
|
||||||
chat_page_->leaveRoom(roomToLeave);
|
chat_page_->leaveRoom(room_id);
|
||||||
});
|
});
|
||||||
|
|
||||||
showDialog(dialog);
|
showDialog(dialog);
|
||||||
|
|
|
@ -68,14 +68,14 @@ public:
|
||||||
static MainWindow *instance() { return instance_; };
|
static MainWindow *instance() { return instance_; };
|
||||||
void saveCurrentWindowSize();
|
void saveCurrentWindowSize();
|
||||||
|
|
||||||
void openLeaveRoomDialog(const QString &room_id = "");
|
void openLeaveRoomDialog(const QString &room_id);
|
||||||
void openInviteUsersDialog(std::function<void(const QStringList &invitees)> callback);
|
void openInviteUsersDialog(std::function<void(const QStringList &invitees)> callback);
|
||||||
void openCreateRoomDialog(
|
void openCreateRoomDialog(
|
||||||
std::function<void(const mtx::requests::CreateRoom &request)> callback);
|
std::function<void(const mtx::requests::CreateRoom &request)> callback);
|
||||||
void openJoinRoomDialog(std::function<void(const QString &room_id)> callback);
|
void openJoinRoomDialog(std::function<void(const QString &room_id)> callback);
|
||||||
void openLogoutDialog();
|
void openLogoutDialog();
|
||||||
void openRoomSettings(const QString &room_id = "");
|
void openRoomSettings(const QString &room_id);
|
||||||
void openMemberListDialog(const QString &room_id = "");
|
void openMemberListDialog(const QString &room_id);
|
||||||
void openUserProfile(const QString &user_id, const QString &room_id);
|
void openUserProfile(const QString &user_id, const QString &room_id);
|
||||||
void openReadReceiptsDialog(const QString &event_id);
|
void openReadReceiptsDialog(const QString &event_id);
|
||||||
|
|
||||||
|
|
|
@ -260,6 +260,7 @@ public slots:
|
||||||
QString roomName() const;
|
QString roomName() const;
|
||||||
QString roomTopic() const;
|
QString roomTopic() const;
|
||||||
QString roomAvatarUrl() const;
|
QString roomAvatarUrl() const;
|
||||||
|
QString roomId() const { return room_id_; }
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void addPendingMessage(mtx::events::collections::TimelineEvents event);
|
void addPendingMessage(mtx::events::collections::TimelineEvents event);
|
||||||
|
|
|
@ -253,17 +253,17 @@ TimelineViewManager::openInviteUsersDialog()
|
||||||
void
|
void
|
||||||
TimelineViewManager::openMemberListDialog() const
|
TimelineViewManager::openMemberListDialog() const
|
||||||
{
|
{
|
||||||
MainWindow::instance()->openMemberListDialog();
|
MainWindow::instance()->openMemberListDialog(timeline_->roomId());
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
TimelineViewManager::openLeaveRoomDialog() const
|
TimelineViewManager::openLeaveRoomDialog() const
|
||||||
{
|
{
|
||||||
MainWindow::instance()->openLeaveRoomDialog();
|
MainWindow::instance()->openLeaveRoomDialog(timeline_->roomId());
|
||||||
}
|
}
|
||||||
void
|
void
|
||||||
TimelineViewManager::openRoomSettings() const
|
TimelineViewManager::openRoomSettings() const
|
||||||
{
|
{
|
||||||
MainWindow::instance()->openRoomSettings();
|
MainWindow::instance()->openRoomSettings(timeline_->roomId());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue