mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Change the minimum width for modals
This commit is contained in:
parent
9038c950ae
commit
8f89ad15f7
5 changed files with 8 additions and 10 deletions
|
@ -58,8 +58,9 @@ const QRegExp url_regex(
|
|||
|
||||
// Window geometry.
|
||||
namespace window {
|
||||
constexpr int height = 600;
|
||||
constexpr int width = 1066;
|
||||
constexpr int height = 600;
|
||||
constexpr int width = 1066;
|
||||
constexpr int minModalWidth = 340;
|
||||
|
||||
constexpr int minHeight = height;
|
||||
constexpr int minWidth = 950;
|
||||
|
|
|
@ -24,8 +24,7 @@ CreateRoom::CreateRoom(QWidget *parent)
|
|||
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
setMinimumHeight(conf::modals::MIN_WIDGET_HEIGHT);
|
||||
setMinimumWidth(QFontMetrics(largeFont).averageCharWidth() * 30 -
|
||||
2 * conf::modals::WIDGET_MARGIN);
|
||||
setMinimumWidth(conf::window::minModalWidth);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
layout->setSpacing(conf::modals::WIDGET_SPACING);
|
||||
|
|
|
@ -25,7 +25,7 @@ InviteUsers::InviteUsers(QWidget *parent)
|
|||
setWindowModality(Qt::WindowModal);
|
||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
|
||||
setMinimumWidth(conf::modals::MIN_WIDGET_WIDTH);
|
||||
setMinimumWidth(conf::window::minModalWidth);
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
|
|
|
@ -50,7 +50,7 @@ EditModal::EditModal(const QString &roomId, QWidget *parent)
|
|||
|
||||
QFont largeFont;
|
||||
largeFont.setPointSizeF(largeFont.pointSizeF() * 1.4);
|
||||
setMinimumWidth(QFontMetrics(largeFont).averageCharWidth() * 30 - 2 * WIDGET_MARGIN);
|
||||
setMinimumWidth(conf::window::minModalWidth);
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
|
@ -172,7 +172,7 @@ RoomSettings::RoomSettings(const QString &room_id, QWidget *parent)
|
|||
QFont largeFont;
|
||||
largeFont.setPointSizeF(largeFont.pointSizeF() * 1.5);
|
||||
|
||||
setMinimumWidth(QFontMetrics(largeFont).averageCharWidth() * 30 - 2 * WIDGET_MARGIN);
|
||||
setMinimumWidth(conf::window::minModalWidth);
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
|
||||
auto layout = new QVBoxLayout(this);
|
||||
|
@ -181,7 +181,6 @@ RoomSettings::RoomSettings(const QString &room_id, QWidget *parent)
|
|||
|
||||
QFont font;
|
||||
font.setWeight(QFont::Medium);
|
||||
font.setPointSizeF(font.pointSizeF() * 1.2);
|
||||
auto settingsLabel = new QLabel(tr("Settings").toUpper(), this);
|
||||
settingsLabel->setFont(font);
|
||||
|
||||
|
|
|
@ -175,8 +175,7 @@ UserProfile::UserProfile(QWidget *parent)
|
|||
largeFont.setPointSizeF(largeFont.pointSizeF() * 1.5);
|
||||
|
||||
setMinimumWidth(
|
||||
std::max(devices_->sizeHint().width() + 4 * WIDGET_MARGIN,
|
||||
QFontMetrics(largeFont).averageCharWidth() * 30 - 2 * WIDGET_MARGIN));
|
||||
std::max(devices_->sizeHint().width() + 4 * WIDGET_MARGIN, conf::window::minModalWidth));
|
||||
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
|
||||
|
||||
vlayout->setSpacing(WIDGET_SPACING);
|
||||
|
|
Loading…
Reference in a new issue