Change the minimum width for modals

This commit is contained in:
Konstantinos Sideris 2018-09-30 13:37:38 +03:00
parent 9038c950ae
commit 8f89ad15f7
5 changed files with 8 additions and 10 deletions

View file

@ -58,8 +58,9 @@ const QRegExp url_regex(
// Window geometry. // Window geometry.
namespace window { namespace window {
constexpr int height = 600; constexpr int height = 600;
constexpr int width = 1066; constexpr int width = 1066;
constexpr int minModalWidth = 340;
constexpr int minHeight = height; constexpr int minHeight = height;
constexpr int minWidth = 950; constexpr int minWidth = 950;

View file

@ -24,8 +24,7 @@ CreateRoom::CreateRoom(QWidget *parent)
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
setMinimumHeight(conf::modals::MIN_WIDGET_HEIGHT); setMinimumHeight(conf::modals::MIN_WIDGET_HEIGHT);
setMinimumWidth(QFontMetrics(largeFont).averageCharWidth() * 30 - setMinimumWidth(conf::window::minModalWidth);
2 * conf::modals::WIDGET_MARGIN);
auto layout = new QVBoxLayout(this); auto layout = new QVBoxLayout(this);
layout->setSpacing(conf::modals::WIDGET_SPACING); layout->setSpacing(conf::modals::WIDGET_SPACING);

View file

@ -25,7 +25,7 @@ InviteUsers::InviteUsers(QWidget *parent)
setWindowModality(Qt::WindowModal); setWindowModality(Qt::WindowModal);
setAttribute(Qt::WA_DeleteOnClose, true); setAttribute(Qt::WA_DeleteOnClose, true);
setMinimumWidth(conf::modals::MIN_WIDGET_WIDTH); setMinimumWidth(conf::window::minModalWidth);
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
auto layout = new QVBoxLayout(this); auto layout = new QVBoxLayout(this);

View file

@ -50,7 +50,7 @@ EditModal::EditModal(const QString &roomId, QWidget *parent)
QFont largeFont; QFont largeFont;
largeFont.setPointSizeF(largeFont.pointSizeF() * 1.4); largeFont.setPointSizeF(largeFont.pointSizeF() * 1.4);
setMinimumWidth(QFontMetrics(largeFont).averageCharWidth() * 30 - 2 * WIDGET_MARGIN); setMinimumWidth(conf::window::minModalWidth);
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
auto layout = new QVBoxLayout(this); auto layout = new QVBoxLayout(this);
@ -172,7 +172,7 @@ RoomSettings::RoomSettings(const QString &room_id, QWidget *parent)
QFont largeFont; QFont largeFont;
largeFont.setPointSizeF(largeFont.pointSizeF() * 1.5); largeFont.setPointSizeF(largeFont.pointSizeF() * 1.5);
setMinimumWidth(QFontMetrics(largeFont).averageCharWidth() * 30 - 2 * WIDGET_MARGIN); setMinimumWidth(conf::window::minModalWidth);
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
auto layout = new QVBoxLayout(this); auto layout = new QVBoxLayout(this);
@ -181,7 +181,6 @@ RoomSettings::RoomSettings(const QString &room_id, QWidget *parent)
QFont font; QFont font;
font.setWeight(QFont::Medium); font.setWeight(QFont::Medium);
font.setPointSizeF(font.pointSizeF() * 1.2);
auto settingsLabel = new QLabel(tr("Settings").toUpper(), this); auto settingsLabel = new QLabel(tr("Settings").toUpper(), this);
settingsLabel->setFont(font); settingsLabel->setFont(font);

View file

@ -175,8 +175,7 @@ UserProfile::UserProfile(QWidget *parent)
largeFont.setPointSizeF(largeFont.pointSizeF() * 1.5); largeFont.setPointSizeF(largeFont.pointSizeF() * 1.5);
setMinimumWidth( setMinimumWidth(
std::max(devices_->sizeHint().width() + 4 * WIDGET_MARGIN, std::max(devices_->sizeHint().width() + 4 * WIDGET_MARGIN, conf::window::minModalWidth));
QFontMetrics(largeFont).averageCharWidth() * 30 - 2 * WIDGET_MARGIN));
setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
vlayout->setSpacing(WIDGET_SPACING); vlayout->setSpacing(WIDGET_SPACING);