diff options
author | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-07-21 14:33:35 +0300 |
---|---|---|
committer | Konstantinos Sideris <sideris.konstantin@gmail.com> | 2018-07-21 14:33:35 +0300 |
commit | 6c65213c83c2516aed1d1ee160fef8bcb9a092b2 (patch) | |
tree | 642f6114c2a9c832989cc532481881609960fab9 /src/MainWindow.cpp | |
parent | Lower the complexity of the group filtering algorithm (#380) (diff) | |
download | nheko-6c65213c83c2516aed1d1ee160fef8bcb9a092b2.tar.xz |
Reuse the profile modal & adjust its spacing relative to the font size
Diffstat (limited to 'src/MainWindow.cpp')
-rw-r--r-- | src/MainWindow.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index fe63456a..43de4fe8 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -312,13 +312,17 @@ MainWindow::hasActiveUser() void MainWindow::openUserProfile(const QString &user_id, const QString &room_id) { - userProfileDialog_ = QSharedPointer<dialogs::UserProfile>(new dialogs::UserProfile(this)); + if (!userProfileDialog_) + userProfileDialog_ = + QSharedPointer<dialogs::UserProfile>(new dialogs::UserProfile(this)); + userProfileDialog_->init(user_id, room_id); - userProfileModal_ = - QSharedPointer<OverlayModal>(new OverlayModal(this, userProfileDialog_.data())); - userProfileModal_->setContentAlignment(Qt::AlignTop | Qt::AlignHCenter); + if (!userProfileModal_) + userProfileModal_ = + QSharedPointer<OverlayModal>(new OverlayModal(this, userProfileDialog_.data())); + userProfileModal_->setContentAlignment(Qt::AlignTop | Qt::AlignHCenter); userProfileModal_->show(); } |