diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index b6216fe..a93f0c9 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -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 diff --git a/src/dialogs/CreateRoom.cpp b/src/dialogs/CreateRoom.cpp index 27407d4..51f38fa 100644 --- a/src/dialogs/CreateRoom.cpp +++ b/src/dialogs/CreateRoom.cpp @@ -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); diff --git a/src/dialogs/MemberList.cpp b/src/dialogs/MemberList.cpp index 5995d40..b353229 100644 --- a/src/dialogs/MemberList.cpp +++ b/src/dialogs/MemberList.cpp @@ -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); diff --git a/src/dialogs/ReadReceipts.cpp b/src/dialogs/ReadReceipts.cpp index b0c18bb..400963b 100644 --- a/src/dialogs/ReadReceipts.cpp +++ b/src/dialogs/ReadReceipts.cpp @@ -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);