|
|
@ -1,11 +1,9 @@ |
|
|
|
#include <QHBoxLayout> |
|
|
|
#include <QHBoxLayout> |
|
|
|
|
|
|
|
#include <QPushButton> |
|
|
|
|
|
|
|
|
|
|
|
#include "InviteeItem.h" |
|
|
|
#include "InviteeItem.h" |
|
|
|
#include "ui/FlatButton.h" |
|
|
|
|
|
|
|
#include "ui/Theme.h" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constexpr int SidePadding = 10; |
|
|
|
constexpr int SidePadding = 10; |
|
|
|
constexpr int IconSize = 13; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
InviteeItem::InviteeItem(mtx::identifiers::User user, QWidget *parent) |
|
|
|
InviteeItem::InviteeItem(mtx::identifiers::User user, QWidget *parent) |
|
|
|
: QWidget{parent} |
|
|
|
: QWidget{parent} |
|
|
@ -15,23 +13,11 @@ InviteeItem::InviteeItem(mtx::identifiers::User user, QWidget *parent) |
|
|
|
topLayout_->setSpacing(0); |
|
|
|
topLayout_->setSpacing(0); |
|
|
|
topLayout_->setContentsMargins(SidePadding, 0, 3 * SidePadding, 0); |
|
|
|
topLayout_->setContentsMargins(SidePadding, 0, 3 * SidePadding, 0); |
|
|
|
|
|
|
|
|
|
|
|
QFont font; |
|
|
|
name_ = new QLabel(user_, this); |
|
|
|
font.setPixelSize(15); |
|
|
|
removeUserBtn_ = new QPushButton(tr("Remove"), this); |
|
|
|
|
|
|
|
|
|
|
|
name_ = new QLabel(user_, this); |
|
|
|
|
|
|
|
name_->setFont(font); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QIcon removeUserIcon; |
|
|
|
|
|
|
|
removeUserIcon.addFile(":/icons/icons/ui/remove-symbol.png"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
removeUserBtn_ = new FlatButton(this); |
|
|
|
|
|
|
|
removeUserBtn_->setIcon(removeUserIcon); |
|
|
|
|
|
|
|
removeUserBtn_->setIconSize(QSize(IconSize, IconSize)); |
|
|
|
|
|
|
|
removeUserBtn_->setFixedSize(QSize(IconSize, IconSize)); |
|
|
|
|
|
|
|
removeUserBtn_->setRippleStyle(ui::RippleStyle::NoRipple); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
topLayout_->addWidget(name_); |
|
|
|
topLayout_->addWidget(name_); |
|
|
|
topLayout_->addWidget(removeUserBtn_); |
|
|
|
topLayout_->addWidget(removeUserBtn_, 0, Qt::AlignRight); |
|
|
|
|
|
|
|
|
|
|
|
connect(removeUserBtn_, &FlatButton::clicked, this, &InviteeItem::removeItem); |
|
|
|
connect(removeUserBtn_, &QPushButton::clicked, this, &InviteeItem::removeItem); |
|
|
|
} |
|
|
|
} |
|
|
|