mirror-chatterino2/widgets/userpopupwidget.cpp
Rasmus Karlsson b010d90689 Implement basic user popup
What needs more work:
 - Make sure popup is gone if you click away
 - Add timeouts etc and make them work (relies on Channel being able to
         send messages)
2017-03-23 23:24:47 +01:00

42 lines
938 B
C++

#include "userpopupwidget.h"
#include "channel.h"
#include "ui_userpopup.h"
#include <QDebug>
namespace chatterino {
namespace widgets {
UserPopupWidget::UserPopupWidget(std::shared_ptr<Channel> &&_channel)
: QWidget(nullptr)
, ui(new Ui::UserPopup)
, channel(std::move(_channel))
{
this->ui->setupUi(this);
this->resize(0, 0);
this->setWindowFlags(Qt::FramelessWindowHint);
// Close button
connect(this->ui->btnClose, &QPushButton::clicked, [=]() {
this->hide(); //
});
connect(this->ui->btnPurge, &QPushButton::clicked, [=]() {
qDebug() << "xD: " << this->channel->getName();
/*
this->channel->sendMessage(
QString(".timeout %1 0").arg(this->ui->lblUsername->text()));
*/
});
}
void
UserPopupWidget::setName(const QString &name)
{
this->ui->lblUsername->setText(name);
}
} // namespace widgets
} // namespace chatterino