summary refs log tree commit diff
path: root/src/dialogs/CreateRoom.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dialogs/CreateRoom.cpp')
-rw-r--r--src/dialogs/CreateRoom.cpp38
1 files changed, 13 insertions, 25 deletions
diff --git a/src/dialogs/CreateRoom.cpp b/src/dialogs/CreateRoom.cpp

index 51f38fa8..bfd1e751 100644 --- a/src/dialogs/CreateRoom.cpp +++ b/src/dialogs/CreateRoom.cpp
@@ -1,12 +1,11 @@ #include <QComboBox> #include <QLabel> -#include <QStyleOption> +#include <QPushButton> #include <QVBoxLayout> #include "dialogs/CreateRoom.h" #include "Config.h" -#include "ui/FlatButton.h" #include "ui/TextField.h" #include "ui/Theme.h" #include "ui/ToggleButton.h" @@ -16,6 +15,11 @@ using namespace dialogs; CreateRoom::CreateRoom(QWidget *parent) : QFrame(parent) { + setAutoFillBackground(true); + setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint); + setWindowModality(Qt::WindowModal); + setAttribute(Qt::WA_DeleteOnClose, true); + QFont doubleFont; doubleFont.setPointSizeF(doubleFont.pointSizeF() * 2); @@ -29,21 +33,15 @@ CreateRoom::CreateRoom(QWidget *parent) layout->setMargin(conf::modals::WIDGET_MARGIN); auto buttonLayout = new QHBoxLayout(); - buttonLayout->setSpacing(0); - buttonLayout->setMargin(0); - - QFont buttonFont; - buttonFont.setPointSizeF(buttonFont.pointSizeF() * conf::modals::BUTTON_TEXT_SIZE_RATIO); - - confirmBtn_ = new FlatButton("CREATE", this); - confirmBtn_->setFont(buttonFont); + buttonLayout->setSpacing(15); - cancelBtn_ = new FlatButton(tr("CANCEL"), this); - cancelBtn_->setFont(buttonFont); + confirmBtn_ = new QPushButton(tr("Create room"), this); + cancelBtn_ = new QPushButton(tr("Cancel"), this); + cancelBtn_->setDefault(true); buttonLayout->addStretch(1); - buttonLayout->addWidget(confirmBtn_); buttonLayout->addWidget(cancelBtn_); + buttonLayout->addWidget(confirmBtn_); QFont font; font.setPixelSize(conf::headerFontSize); @@ -104,15 +102,14 @@ CreateRoom::CreateRoom(QWidget *parent) request_.topic = topicInput_->text().toStdString(); request_.room_alias_name = aliasInput_->text().toStdString(); - emit closing(true, request_); + emit createRoom(request_); clearFields(); }); connect(cancelBtn_, &QPushButton::clicked, this, [this]() { - emit closing(false, request_); - clearFields(); + emit close(); }); connect(visibilityCombo_, @@ -151,15 +148,6 @@ CreateRoom::clearFields() } void -CreateRoom::paintEvent(QPaintEvent *) -{ - QStyleOption opt; - opt.init(this); - QPainter p(this); - style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); -} - -void CreateRoom::showEvent(QShowEvent *event) { nameInput_->setFocus();