diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-05-18 21:27:44 +0300 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-05-18 21:27:44 +0300 |
commit | 4ab42c68f464e62da3e46ca369753df7cd3eb628 (patch) | |
tree | fb207289750ae1498abc792fab8c671ff5bd0674 /src/dialogs/RoomSettings.cpp | |
parent | Generate missing translations strings (diff) | |
download | nheko-4ab42c68f464e62da3e46ca369753df7cd3eb628.tar.xz |
Fix crash on unfinished animation & center the edit modal
Diffstat (limited to 'src/dialogs/RoomSettings.cpp')
-rw-r--r-- | src/dialogs/RoomSettings.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/dialogs/RoomSettings.cpp b/src/dialogs/RoomSettings.cpp index 294969d0..ff784158 100644 --- a/src/dialogs/RoomSettings.cpp +++ b/src/dialogs/RoomSettings.cpp @@ -4,9 +4,11 @@ #include "MatrixClient.h" #include "Painter.h" #include "TextField.h" +#include "Theme.h" #include "Utils.h" #include "dialogs/RoomSettings.hpp" +#include <QApplication> #include <QComboBox> #include <QLabel> #include <QPainter> @@ -33,8 +35,10 @@ EditModal::EditModal(const QString &roomId, QWidget *parent) applyBtn_ = new FlatButton(tr("APPLY"), this); applyBtn_->setFontSize(conf::btn::fontSize); + applyBtn_->setRippleStyle(ui::RippleStyle::NoRipple); cancelBtn_ = new FlatButton(tr("CANCEL"), this); cancelBtn_->setFontSize(conf::btn::fontSize); + cancelBtn_->setRippleStyle(ui::RippleStyle::NoRipple); auto btnLayout = new QHBoxLayout; btnLayout->setContentsMargins(5, 20, 5, 5); @@ -131,6 +135,10 @@ EditModal::EditModal(const QString &roomId, QWidget *parent) } }); connect(cancelBtn_, &QPushButton::clicked, this, &EditModal::close); + + auto window = QApplication::activeWindow(); + auto center = window->frameGeometry().center(); + move(center.x() - (width() * 0.5), center.y() - (height() * 0.5)); } void |