added usercard button to link to twitch's userbutton

This commit is contained in:
apa420 2019-06-02 19:42:49 +00:00 committed by pajlada
parent afe5e826a1
commit 74d55941a0

View file

@ -84,6 +84,8 @@ UserInfoPopup::UserInfoPopup()
.assign(&this->ui_.ignoreHighlights);
auto viewLogs = user.emplace<EffectLabel2>(this);
viewLogs->getLabel().setText("Online logs");
auto usercard = user.emplace<EffectLabel2>(this);
usercard->getLabel().setText("Usercard");
auto mod = user.emplace<Button>(this);
mod->setPixmap(app->resources->buttons.mod);
@ -103,6 +105,12 @@ UserInfoPopup::UserInfoPopup()
logs->show();
});
QObject::connect(usercard.getElement(), &Button::leftClicked, [this] {
QDesktopServices::openUrl("https://www.twitch.tv/popout/" +
this->channel_->getName() +
"/viewercard/" + this->userName_);
});
QObject::connect(mod.getElement(), &Button::leftClicked, [this] {
this->channel_->sendMessage("/mod " + this->userName_);
});