mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-26 04:58:49 +03:00
Increase the minimum modal size
This commit is contained in:
parent
aa2f6ce77d
commit
05547086fb
4 changed files with 25 additions and 9 deletions
|
@ -332,8 +332,7 @@ MainWindow::openMemberListDialog(const QString &room_id)
|
|||
{
|
||||
const auto roomToSearch = room_id.isEmpty() ? chat_page_->currentRoom() : "";
|
||||
|
||||
modal_->setWidget(new dialogs::MemberList(roomToSearch, this));
|
||||
modal_->show();
|
||||
showTransparentOverlayModal(new dialogs::MemberList(roomToSearch, this));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -16,8 +16,13 @@ using namespace dialogs;
|
|||
CreateRoom::CreateRoom(QWidget *parent)
|
||||
: QFrame(parent)
|
||||
{
|
||||
setMinimumSize(conf::modals::MIN_WIDGET_WIDTH, conf::modals::MIN_WIDGET_HEIGHT);
|
||||
QFont doubleFont;
|
||||
doubleFont.setPointSizeF(doubleFont.pointSizeF() * 2);
|
||||
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
setMinimumHeight(conf::modals::MIN_WIDGET_HEIGHT);
|
||||
setMinimumWidth(QFontMetrics(doubleFont).averageCharWidth() * 30 -
|
||||
2 * conf::modals::WIDGET_MARGIN);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->setSpacing(conf::modals::WIDGET_SPACING);
|
||||
|
|
|
@ -55,9 +55,6 @@ MemberList::MemberList(const QString &room_id, QWidget *parent)
|
|||
: QFrame(parent)
|
||||
, room_id_{room_id}
|
||||
{
|
||||
setMinimumSize(conf::modals::MIN_WIDGET_WIDTH, conf::modals::MIN_WIDGET_HEIGHT);
|
||||
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
|
@ -70,6 +67,15 @@ MemberList::MemberList(const QString &room_id, QWidget *parent)
|
|||
list_->setAttribute(Qt::WA_MacShowFocusRect, 0);
|
||||
list_->setSpacing(5);
|
||||
|
||||
QFont doubleFont;
|
||||
doubleFont.setPointSizeF(doubleFont.pointSizeF() * 2);
|
||||
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
setMinimumHeight(list_->sizeHint().height() * 2);
|
||||
setMinimumWidth(std::max(list_->sizeHint().width() + 4 * conf::modals::WIDGET_MARGIN,
|
||||
QFontMetrics(doubleFont).averageCharWidth() * 30 -
|
||||
2 * conf::modals::WIDGET_MARGIN));
|
||||
|
||||
QFont font;
|
||||
font.setPointSizeF(font.pointSizeF() * conf::modals::LABEL_MEDIUM_SIZE_RATIO);
|
||||
|
||||
|
|
|
@ -79,9 +79,6 @@ ReceiptItem::dateFormat(const QDateTime &then) const
|
|||
ReadReceipts::ReadReceipts(QWidget *parent)
|
||||
: QFrame(parent)
|
||||
{
|
||||
setMinimumSize(conf::modals::MIN_WIDGET_WIDTH, conf::modals::MIN_WIDGET_HEIGHT);
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->setSpacing(conf::modals::WIDGET_SPACING);
|
||||
layout->setMargin(conf::modals::WIDGET_MARGIN);
|
||||
|
@ -92,6 +89,15 @@ ReadReceipts::ReadReceipts(QWidget *parent)
|
|||
userList_->setAttribute(Qt::WA_MacShowFocusRect, 0);
|
||||
userList_->setSpacing(conf::modals::TEXT_SPACING);
|
||||
|
||||
QFont doubleFont;
|
||||
doubleFont.setPointSizeF(doubleFont.pointSizeF() * 2);
|
||||
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
setMinimumHeight(userList_->sizeHint().height() * 2);
|
||||
setMinimumWidth(std::max(userList_->sizeHint().width() + 4 * conf::modals::WIDGET_MARGIN,
|
||||
QFontMetrics(doubleFont).averageCharWidth() * 30 -
|
||||
2 * conf::modals::WIDGET_MARGIN));
|
||||
|
||||
QFont font;
|
||||
font.setPointSizeF(font.pointSizeF() * conf::modals::LABEL_MEDIUM_SIZE_RATIO);
|
||||
|
||||
|
|
Loading…
Reference in a new issue