matrixion/src/InviteeItem.cpp

25 lines
738 B
C++
Raw Normal View History

2017-12-11 00:59:50 +03:00
#include <QHBoxLayout>
2020-05-25 14:03:49 +03:00
#include <QLabel>
#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);
name_ = new QLabel(user_, this);
removeUserBtn_ = new QPushButton(tr("Remove"), this);
2017-12-11 00:59:50 +03:00
topLayout_->addWidget(name_);
topLayout_->addWidget(removeUserBtn_, 0, Qt::AlignRight);
2017-12-11 00:59:50 +03:00
connect(removeUserBtn_, &QPushButton::clicked, this, &InviteeItem::removeItem);
2017-12-11 00:59:50 +03:00
}