summary refs log tree commit diff
path: root/src/InviteeItem.cpp
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-17 16:37:25 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-07-17 16:37:25 +0300
commit0e814da91c8e041897a4c3f7e6e9234bbc7c6f7a (patch)
tree21f655d30630fe77ba48d07e4b357e2b6c6a5730 /src/InviteeItem.cpp
parentMerge pull request #372 from bebehei/notification (diff)
downloadnheko-0e814da91c8e041897a4c3f7e6e9234bbc7c6f7a.tar.xz
Move all files under src/
Diffstat (limited to 'src/InviteeItem.cpp')
-rw-r--r--src/InviteeItem.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/InviteeItem.cpp b/src/InviteeItem.cpp
new file mode 100644
index 00000000..6e9be0d5
--- /dev/null
+++ b/src/InviteeItem.cpp
@@ -0,0 +1,37 @@
+#include <QHBoxLayout>
+
+#include "InviteeItem.h"
+#include "ui/FlatButton.h"
+#include "ui/Theme.h"
+
+constexpr int SidePadding = 10;
+constexpr int IconSize    = 13;
+
+InviteeItem::InviteeItem(mtx::identifiers::User user, QWidget *parent)
+  : QWidget{parent}
+  , user_{QString::fromStdString(user.to_string())}
+{
+        auto topLayout_ = new QHBoxLayout(this);
+        topLayout_->setSpacing(0);
+        topLayout_->setContentsMargins(SidePadding, 0, 3 * SidePadding, 0);
+
+        QFont font;
+        font.setPixelSize(15);
+
+        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(removeUserBtn_);
+
+        connect(removeUserBtn_, &FlatButton::clicked, this, &InviteeItem::removeItem);
+}