From 1716502eff3e5108f05aba8acbabd5c9287d624c Mon Sep 17 00:00:00 2001 From: Konstantinos Sideris Date: Wed, 19 Sep 2018 22:42:26 +0300 Subject: Improvements on the system theme --- src/dialogs/UserProfile.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/dialogs/UserProfile.cpp') diff --git a/src/dialogs/UserProfile.cpp b/src/dialogs/UserProfile.cpp index 15e0a46c..54929e03 100644 --- a/src/dialogs/UserProfile.cpp +++ b/src/dialogs/UserProfile.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -48,6 +49,11 @@ DeviceItem::DeviceItem(DeviceInfo device, QWidget *parent) UserProfile::UserProfile(QWidget *parent) : QWidget(parent) { + setAutoFillBackground(true); + setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint); + setWindowModality(Qt::WindowModal); + setAttribute(Qt::WA_DeleteOnClose, true); + QIcon banIcon, kickIcon, ignoreIcon, startChatIcon; banIcon.addFile(":/icons/icons/ui/do-not-disturb-rounded-sign.png"); @@ -134,6 +140,7 @@ UserProfile::UserProfile(QWidget *parent) devices_->setSelectionMode(QAbstractItemView::NoSelection); devices_->setAttribute(Qt::WA_MacShowFocusRect, 0); devices_->setSpacing(DEVICE_SPACING); + devices_->setMinimumHeight(devices_->sizeHint().height() * 1.2); devices_->hide(); QFont descriptionLabelFont; @@ -170,6 +177,9 @@ UserProfile::UserProfile(QWidget *parent) vlayout->setContentsMargins(WIDGET_MARGIN, TOP_WIDGET_MARGIN, WIDGET_MARGIN, WIDGET_MARGIN); qRegisterMetaType>(); + + auto closeShortcut = new QShortcut(QKeySequence(tr("ESC")), this); + connect(closeShortcut, &QShortcut::activated, this, &UserProfile::close); } void @@ -292,12 +302,3 @@ UserProfile::updateDeviceList(const QString &user_id, const std::vectorshow(); devices_->show(); } - -void -UserProfile::paintEvent(QPaintEvent *) -{ - QStyleOption opt; - opt.init(this); - QPainter p(this); - style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); -} -- cgit 1.5.1