Added vip and unvip buttons (#1996)

Co-authored-by: fourtf <tf.four@gmail.com>
This commit is contained in:
apa420
2020-09-27 00:20:15 +02:00
committed by GitHub
parent 53b18d03c6
commit b4ef4fe54d
7 changed files with 19 additions and 0 deletions
+12
View File
@@ -186,6 +186,12 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically)
auto unmod = user.emplace<Button>(this);
unmod->setPixmap(getResources().buttons.unmod);
unmod->setScaleIndependantSize(30, 30);
auto vip = user.emplace<Button>(this);
vip->setPixmap(getResources().buttons.vip);
vip->setScaleIndependantSize(30, 30);
auto unvip = user.emplace<Button>(this);
unvip->setPixmap(getResources().buttons.unvip);
unvip->setScaleIndependantSize(30, 30);
user->addStretch(1);
@@ -203,6 +209,12 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically)
QObject::connect(unmod.getElement(), &Button::leftClicked, [this] {
this->channel_->sendMessage("/unmod " + this->userName_);
});
QObject::connect(vip.getElement(), &Button::leftClicked, [this] {
this->channel_->sendMessage("/vip " + this->userName_);
});
QObject::connect(unvip.getElement(), &Button::leftClicked, [this] {
this->channel_->sendMessage("/unvip " + this->userName_);
});
// userstate
this->userStateChanged_.connect([this, mod, unmod]() mutable {