Reuse the profile modal & adjust its spacing relative to the font size

This commit is contained in:
Konstantinos Sideris 2018-07-21 14:33:35 +03:00
parent 54c7eb374a
commit 6c65213c83
3 changed files with 59 additions and 22 deletions

View file

@ -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();
}