Add close buttons to all dialogs
This commit is contained in:
parent
2a2b52e07f
commit
b0e3a7c7fa
@ -95,8 +95,16 @@ MemberList::MemberList(const QString &room_id, QWidget *parent)
|
|||||||
topLabel_->setAlignment(Qt::AlignCenter);
|
topLabel_->setAlignment(Qt::AlignCenter);
|
||||||
topLabel_->setFont(font);
|
topLabel_->setFont(font);
|
||||||
|
|
||||||
|
auto okBtn = new QPushButton("OK", this);
|
||||||
|
|
||||||
|
auto buttonLayout = new QHBoxLayout();
|
||||||
|
buttonLayout->setSpacing(15);
|
||||||
|
buttonLayout->addStretch(1);
|
||||||
|
buttonLayout->addWidget(okBtn);
|
||||||
|
|
||||||
layout->addWidget(topLabel_);
|
layout->addWidget(topLabel_);
|
||||||
layout->addWidget(list_);
|
layout->addWidget(list_);
|
||||||
|
layout->addLayout(buttonLayout);
|
||||||
|
|
||||||
list_->clear();
|
list_->clear();
|
||||||
|
|
||||||
@ -125,6 +133,7 @@ MemberList::MemberList(const QString &room_id, QWidget *parent)
|
|||||||
|
|
||||||
auto closeShortcut = new QShortcut(QKeySequence(tr("ESC")), this);
|
auto closeShortcut = new QShortcut(QKeySequence(tr("ESC")), this);
|
||||||
connect(closeShortcut, &QShortcut::activated, this, &MemberList::close);
|
connect(closeShortcut, &QShortcut::activated, this, &MemberList::close);
|
||||||
|
connect(okBtn, &QPushButton::clicked, this, &MemberList::close);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QListWidgetItem>
|
#include <QListWidgetItem>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
|
#include <QPushButton>
|
||||||
#include <QShortcut>
|
#include <QShortcut>
|
||||||
#include <QStyleOption>
|
#include <QStyleOption>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
@ -119,11 +120,20 @@ ReadReceipts::ReadReceipts(QWidget *parent)
|
|||||||
topLabel_->setAlignment(Qt::AlignCenter);
|
topLabel_->setAlignment(Qt::AlignCenter);
|
||||||
topLabel_->setFont(font);
|
topLabel_->setFont(font);
|
||||||
|
|
||||||
|
auto okBtn = new QPushButton(tr("Close"), this);
|
||||||
|
|
||||||
|
auto buttonLayout = new QHBoxLayout();
|
||||||
|
buttonLayout->setSpacing(15);
|
||||||
|
buttonLayout->addStretch(1);
|
||||||
|
buttonLayout->addWidget(okBtn);
|
||||||
|
|
||||||
layout->addWidget(topLabel_);
|
layout->addWidget(topLabel_);
|
||||||
layout->addWidget(userList_);
|
layout->addWidget(userList_);
|
||||||
|
layout->addLayout(buttonLayout);
|
||||||
|
|
||||||
auto closeShortcut = new QShortcut(QKeySequence(tr("ESC")), this);
|
auto closeShortcut = new QShortcut(QKeySequence(tr("ESC")), this);
|
||||||
connect(closeShortcut, &QShortcut::activated, this, &ReadReceipts::close);
|
connect(closeShortcut, &QShortcut::activated, this, &ReadReceipts::close);
|
||||||
|
connect(okBtn, &QPushButton::clicked, this, &ReadReceipts::close);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -384,6 +384,13 @@ RoomSettings::RoomSettings(const QString &room_id, QWidget *parent)
|
|||||||
spinnerLayout->setMargin(0);
|
spinnerLayout->setMargin(0);
|
||||||
spinnerLayout->setSpacing(0);
|
spinnerLayout->setSpacing(0);
|
||||||
|
|
||||||
|
auto okBtn = new QPushButton("OK", this);
|
||||||
|
|
||||||
|
auto buttonLayout = new QHBoxLayout();
|
||||||
|
buttonLayout->setSpacing(15);
|
||||||
|
buttonLayout->addStretch(1);
|
||||||
|
buttonLayout->addWidget(okBtn);
|
||||||
|
|
||||||
layout->addWidget(avatar_, Qt::AlignCenter | Qt::AlignTop);
|
layout->addWidget(avatar_, Qt::AlignCenter | Qt::AlignTop);
|
||||||
layout->addLayout(textLayout);
|
layout->addLayout(textLayout);
|
||||||
layout->addLayout(btnLayout_);
|
layout->addLayout(btnLayout_);
|
||||||
@ -395,6 +402,7 @@ RoomSettings::RoomSettings(const QString &room_id, QWidget *parent)
|
|||||||
layout->addWidget(infoLabel, Qt::AlignLeft);
|
layout->addWidget(infoLabel, Qt::AlignLeft);
|
||||||
layout->addLayout(roomIdLayout);
|
layout->addLayout(roomIdLayout);
|
||||||
layout->addWidget(errorLabel_);
|
layout->addWidget(errorLabel_);
|
||||||
|
layout->addLayout(buttonLayout);
|
||||||
layout->addLayout(spinnerLayout);
|
layout->addLayout(spinnerLayout);
|
||||||
layout->addStretch(1);
|
layout->addStretch(1);
|
||||||
|
|
||||||
@ -422,6 +430,7 @@ RoomSettings::RoomSettings(const QString &room_id, QWidget *parent)
|
|||||||
|
|
||||||
auto closeShortcut = new QShortcut(QKeySequence(tr("ESC")), this);
|
auto closeShortcut = new QShortcut(QKeySequence(tr("ESC")), this);
|
||||||
connect(closeShortcut, &QShortcut::activated, this, &RoomSettings::close);
|
connect(closeShortcut, &QShortcut::activated, this, &RoomSettings::close);
|
||||||
|
connect(okBtn, &QPushButton::clicked, this, &RoomSettings::close);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -148,12 +148,20 @@ UserProfile::UserProfile(QWidget *parent)
|
|||||||
devicesLabel_->setFont(descriptionLabelFont);
|
devicesLabel_->setFont(descriptionLabelFont);
|
||||||
devicesLabel_->hide();
|
devicesLabel_->hide();
|
||||||
|
|
||||||
|
auto okBtn = new QPushButton("OK", this);
|
||||||
|
|
||||||
|
auto closeLayout = new QHBoxLayout();
|
||||||
|
closeLayout->setSpacing(15);
|
||||||
|
closeLayout->addStretch(1);
|
||||||
|
closeLayout->addWidget(okBtn);
|
||||||
|
|
||||||
auto vlayout = new QVBoxLayout{this};
|
auto vlayout = new QVBoxLayout{this};
|
||||||
vlayout->addWidget(avatar_);
|
vlayout->addWidget(avatar_);
|
||||||
vlayout->addLayout(textLayout);
|
vlayout->addLayout(textLayout);
|
||||||
vlayout->addLayout(btnLayout);
|
vlayout->addLayout(btnLayout);
|
||||||
vlayout->addWidget(devicesLabel_, Qt::AlignLeft);
|
vlayout->addWidget(devicesLabel_, Qt::AlignLeft);
|
||||||
vlayout->addWidget(devices_);
|
vlayout->addWidget(devices_);
|
||||||
|
vlayout->addLayout(closeLayout);
|
||||||
vlayout->addStretch(1);
|
vlayout->addStretch(1);
|
||||||
|
|
||||||
vlayout->setAlignment(avatar_, Qt::AlignCenter | Qt::AlignTop);
|
vlayout->setAlignment(avatar_, Qt::AlignCenter | Qt::AlignTop);
|
||||||
@ -178,6 +186,7 @@ UserProfile::UserProfile(QWidget *parent)
|
|||||||
|
|
||||||
auto closeShortcut = new QShortcut(QKeySequence(tr("ESC")), this);
|
auto closeShortcut = new QShortcut(QKeySequence(tr("ESC")), this);
|
||||||
connect(closeShortcut, &QShortcut::activated, this, &UserProfile::close);
|
connect(closeShortcut, &QShortcut::activated, this, &UserProfile::close);
|
||||||
|
connect(okBtn, &QPushButton::clicked, this, &UserProfile::close);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user