summary refs log tree commit diff
path: root/src/dialogs/RoomSettings.cpp
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-18 21:27:44 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-18 21:27:44 +0300
commit4ab42c68f464e62da3e46ca369753df7cd3eb628 (patch)
treefb207289750ae1498abc792fab8c671ff5bd0674 /src/dialogs/RoomSettings.cpp
parentGenerate missing translations strings (diff)
downloadnheko-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.cpp8
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