Change the minimum width for modals

pull/1/head
Konstantinos Sideris 6 years ago
parent 9038c950ae
commit 8f89ad15f7
  1. 5
      src/Config.h
  2. 3
      src/dialogs/CreateRoom.cpp
  3. 2
      src/dialogs/InviteUsers.cpp
  4. 5
      src/dialogs/RoomSettings.cpp
  5. 3
      src/dialogs/UserProfile.cpp

@ -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…
Cancel
Save