2017-12-11 00:59:50 +03:00
|
|
|
#include <QHBoxLayout>
|
2020-05-25 14:03:49 +03:00
|
|
|
#include <QLabel>
|
2018-09-21 10:55:24 +03:00
|
|
|
#include <QPushButton>
|
2017-12-11 00:59:50 +03:00
|
|
|
|
|
|
|
#include "InviteeItem.h"
|
|
|
|
|
|
|
|
constexpr int SidePadding = 10;
|
|
|
|
|
|
|
|
InviteeItem::InviteeItem(mtx::identifiers::User user, QWidget *parent)
|
|
|
|
: QWidget{parent}
|
2018-03-18 12:05:39 +03:00
|
|
|
, user_{QString::fromStdString(user.to_string())}
|
2017-12-11 00:59:50 +03:00
|
|
|
{
|
|
|
|
auto topLayout_ = new QHBoxLayout(this);
|
|
|
|
topLayout_->setSpacing(0);
|
|
|
|
topLayout_->setContentsMargins(SidePadding, 0, 3 * SidePadding, 0);
|
|
|
|
|
2018-09-21 10:55:24 +03:00
|
|
|
name_ = new QLabel(user_, this);
|
|
|
|
removeUserBtn_ = new QPushButton(tr("Remove"), this);
|
2017-12-11 00:59:50 +03:00
|
|
|
|
|
|
|
topLayout_->addWidget(name_);
|
2018-09-21 10:55:24 +03:00
|
|
|
topLayout_->addWidget(removeUserBtn_, 0, Qt::AlignRight);
|
2017-12-11 00:59:50 +03:00
|
|
|
|
2018-09-21 10:55:24 +03:00
|
|
|
connect(removeUserBtn_, &QPushButton::clicked, this, &InviteeItem::removeItem);
|
2017-12-11 00:59:50 +03:00
|
|
|
}
|