2017-11-12 17:21:50 +01:00
|
|
|
#include "widgets/helper/splitheader.hpp"
|
2018-04-28 15:20:18 +02:00
|
|
|
|
|
|
|
#include "application.hpp"
|
2018-02-05 15:11:50 +01:00
|
|
|
#include "providers/twitch/twitchchannel.hpp"
|
|
|
|
#include "providers/twitch/twitchserver.hpp"
|
2018-01-17 16:52:51 +01:00
|
|
|
#include "singletons/resourcemanager.hpp"
|
2017-12-31 00:50:07 +01:00
|
|
|
#include "singletons/thememanager.hpp"
|
2018-01-13 04:05:38 +01:00
|
|
|
#include "util/layoutcreator.hpp"
|
2017-09-15 17:23:49 +02:00
|
|
|
#include "util/urlfetch.hpp"
|
2018-06-11 15:04:54 +02:00
|
|
|
#include "widgets/label.hpp"
|
2017-11-12 17:21:50 +01:00
|
|
|
#include "widgets/split.hpp"
|
|
|
|
#include "widgets/splitcontainer.hpp"
|
2017-12-23 22:17:38 +01:00
|
|
|
#include "widgets/tooltipwidget.hpp"
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2017-01-15 16:38:30 +01:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QDrag>
|
|
|
|
#include <QMimeData>
|
|
|
|
#include <QPainter>
|
|
|
|
|
2018-01-19 14:48:17 +01:00
|
|
|
#ifdef USEWEBENGINE
|
|
|
|
#include "widgets/streamview.hpp"
|
|
|
|
#endif
|
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
using namespace chatterino::providers::twitch;
|
|
|
|
|
2017-04-14 17:52:22 +02:00
|
|
|
namespace chatterino {
|
|
|
|
namespace widgets {
|
2017-01-18 21:30:23 +01:00
|
|
|
|
2018-01-13 04:05:38 +01:00
|
|
|
SplitHeader::SplitHeader(Split *_split)
|
|
|
|
: BaseWidget(_split)
|
|
|
|
, split(_split)
|
2017-01-01 02:30:42 +01:00
|
|
|
{
|
2018-04-28 15:20:18 +02:00
|
|
|
auto app = getApp();
|
2017-12-23 22:17:38 +01:00
|
|
|
|
2018-01-13 04:05:38 +01:00
|
|
|
util::LayoutCreator<SplitHeader> layoutCreator(this);
|
|
|
|
auto layout = layoutCreator.emplace<QHBoxLayout>().withoutMargin();
|
|
|
|
{
|
|
|
|
// dropdown label
|
2018-01-17 16:52:51 +01:00
|
|
|
auto dropdown = layout.emplace<RippleEffectButton>(this).assign(&this->dropdownButton);
|
2018-01-13 04:05:38 +01:00
|
|
|
dropdown->setMouseTracking(true);
|
2018-06-06 10:46:23 +02:00
|
|
|
dropdown->setPixmap(*app->resources->splitHeaderContext->getPixmap());
|
2018-01-13 04:05:38 +01:00
|
|
|
this->addDropdownItems(dropdown.getElement());
|
2018-01-17 16:52:51 +01:00
|
|
|
QObject::connect(dropdown.getElement(), &RippleEffectButton::clicked, this, [this] {
|
2018-01-13 04:05:38 +01:00
|
|
|
QTimer::singleShot(80, [&] {
|
|
|
|
this->dropdownMenu.move(
|
2018-01-17 16:52:51 +01:00
|
|
|
this->dropdownButton->mapToGlobal(QPoint(0, this->dropdownButton->height())));
|
2018-01-13 04:05:38 +01:00
|
|
|
this->dropdownMenu.show();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// channel name label
|
2018-06-11 15:04:54 +02:00
|
|
|
auto title = layout.emplace<Label>().assign(&this->titleLabel);
|
2018-01-27 21:13:22 +01:00
|
|
|
title->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
|
2018-06-11 15:04:54 +02:00
|
|
|
title->setCentered(true);
|
|
|
|
title->setHasOffset(false);
|
2018-01-14 22:24:21 +01:00
|
|
|
|
2018-05-24 08:58:34 +02:00
|
|
|
// mode button
|
|
|
|
auto mode = layout.emplace<RippleEffectLabel>(this).assign(&this->modeButton);
|
|
|
|
|
2018-05-24 10:07:31 +02:00
|
|
|
mode->hide();
|
2018-05-24 08:58:34 +02:00
|
|
|
|
|
|
|
// QObject::connect(mode.getElement(), &RippleEffectButton::clicked, this, [this]
|
|
|
|
// {
|
|
|
|
// //
|
|
|
|
// });
|
|
|
|
|
2018-01-13 04:05:38 +01:00
|
|
|
// moderation mode
|
2018-01-17 16:52:51 +01:00
|
|
|
auto moderator = layout.emplace<RippleEffectButton>(this).assign(&this->moderationButton);
|
|
|
|
|
|
|
|
QObject::connect(moderator.getElement(), &RippleEffectButton::clicked, this, [this] {
|
|
|
|
this->split->setModerationMode(!this->split->getModerationMode());
|
|
|
|
});
|
|
|
|
|
|
|
|
this->updateModerationModeIcon();
|
2018-01-13 04:05:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// ---- misc
|
|
|
|
this->layout()->setMargin(0);
|
2018-01-25 21:11:14 +01:00
|
|
|
this->scaleChangedEvent(this->getScale());
|
2017-07-02 14:28:37 +02:00
|
|
|
|
2017-06-11 09:11:55 +02:00
|
|
|
this->updateChannelText();
|
2017-01-15 16:38:30 +01:00
|
|
|
|
2017-11-04 14:57:29 +01:00
|
|
|
this->initializeChannelSignals();
|
|
|
|
|
2018-01-13 04:05:38 +01:00
|
|
|
this->split->channelChanged.connect([this]() {
|
2017-11-04 14:57:29 +01:00
|
|
|
this->initializeChannelSignals(); //
|
|
|
|
});
|
2018-05-26 16:31:43 +02:00
|
|
|
|
2018-05-26 20:26:25 +02:00
|
|
|
this->managedConnect(app->accounts->twitch.currentUserChanged,
|
2018-05-26 17:20:16 +02:00
|
|
|
[this] { this->updateModerationModeIcon(); });
|
|
|
|
|
2018-05-26 16:31:43 +02:00
|
|
|
this->setMouseTracking(true);
|
2017-11-04 14:57:29 +01:00
|
|
|
}
|
|
|
|
|
2018-01-13 04:05:38 +01:00
|
|
|
SplitHeader::~SplitHeader()
|
|
|
|
{
|
|
|
|
this->onlineStatusChangedConnection.disconnect();
|
|
|
|
}
|
|
|
|
|
2018-05-26 16:31:43 +02:00
|
|
|
void SplitHeader::addDropdownItems(RippleEffectButton *)
|
2018-01-13 04:05:38 +01:00
|
|
|
{
|
|
|
|
// clang-format off
|
|
|
|
this->dropdownMenu.addAction("Add new split", this->split, &Split::doAddSplit, QKeySequence(tr("Ctrl+T")));
|
|
|
|
this->dropdownMenu.addAction("Close split", this->split, &Split::doCloseSplit, QKeySequence(tr("Ctrl+W")));
|
2018-01-17 02:04:10 +01:00
|
|
|
// this->dropdownMenu.addAction("Move split", this, SLOT(menuMoveSplit()));
|
2018-01-13 04:05:38 +01:00
|
|
|
this->dropdownMenu.addAction("Popup", this->split, &Split::doPopup);
|
|
|
|
this->dropdownMenu.addAction("Open viewer list", this->split, &Split::doOpenViewerList);
|
2018-05-25 16:24:24 +02:00
|
|
|
this->dropdownMenu.addAction("Search in messages", this->split, &Split::doSearch, QKeySequence(tr("Ctrl+F")));
|
2018-01-13 04:05:38 +01:00
|
|
|
this->dropdownMenu.addSeparator();
|
2018-01-19 14:48:17 +01:00
|
|
|
#ifdef USEWEBENGINE
|
|
|
|
this->dropdownMenu.addAction("Start watching", this, [this]{
|
2018-01-24 13:15:41 +01:00
|
|
|
ChannelPtr _channel = this->split->getChannel();
|
2018-02-05 15:11:50 +01:00
|
|
|
TwitchChannel *tc = dynamic_cast<TwitchChannel *>(_channel.get());
|
2018-01-19 14:48:17 +01:00
|
|
|
|
|
|
|
if (tc != nullptr) {
|
|
|
|
StreamView *view = new StreamView(_channel, "https://player.twitch.tv/?channel=" + tc->name);
|
|
|
|
view->setAttribute(Qt::WA_DeleteOnClose, true);
|
|
|
|
view->show();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
#endif
|
2018-01-13 04:05:38 +01:00
|
|
|
this->dropdownMenu.addAction("Change channel", this->split, &Split::doChangeChannel, QKeySequence(tr("Ctrl+R")));
|
|
|
|
this->dropdownMenu.addAction("Clear chat", this->split, &Split::doClearChat);
|
2018-01-17 02:04:10 +01:00
|
|
|
this->dropdownMenu.addAction("Open in web browser", this->split, &Split::doOpenChannel);
|
2018-01-19 14:48:17 +01:00
|
|
|
#ifndef USEWEBENGINE
|
2018-01-17 03:18:47 +01:00
|
|
|
this->dropdownMenu.addAction("Open web player", this->split, &Split::doOpenPopupPlayer);
|
2018-01-19 14:48:17 +01:00
|
|
|
#endif
|
2018-01-13 04:05:38 +01:00
|
|
|
this->dropdownMenu.addAction("Open in Streamlink", this->split, &Split::doOpenStreamlink);
|
|
|
|
this->dropdownMenu.addSeparator();
|
|
|
|
this->dropdownMenu.addAction("Reload channel emotes", this, SLOT(menuReloadChannelEmotes()));
|
|
|
|
this->dropdownMenu.addAction("Manual reconnect", this, SLOT(menuManualReconnect()));
|
2018-06-19 19:42:15 +02:00
|
|
|
// this->dropdownMenu.addSeparator();
|
|
|
|
// this->dropdownMenu.addAction("Show changelog", this, SLOT(menuShowChangelog()));
|
2018-01-13 04:05:38 +01:00
|
|
|
// clang-format on
|
|
|
|
}
|
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
void SplitHeader::initializeChannelSignals()
|
2017-11-04 14:57:29 +01:00
|
|
|
{
|
|
|
|
// Disconnect any previous signal first
|
|
|
|
this->onlineStatusChangedConnection.disconnect();
|
|
|
|
|
2018-01-13 04:05:38 +01:00
|
|
|
auto channel = this->split->getChannel();
|
2018-02-05 15:11:50 +01:00
|
|
|
TwitchChannel *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get());
|
2017-11-04 14:57:29 +01:00
|
|
|
|
|
|
|
if (twitchChannel) {
|
2018-04-11 01:06:13 +02:00
|
|
|
this->managedConnections.emplace_back(twitchChannel->updateLiveInfo.connect([this]() {
|
2017-11-04 14:57:29 +01:00
|
|
|
this->updateChannelText(); //
|
2018-04-11 01:06:13 +02:00
|
|
|
}));
|
2017-11-04 14:57:29 +01:00
|
|
|
}
|
2017-01-15 16:38:30 +01:00
|
|
|
}
|
|
|
|
|
2018-01-25 21:11:14 +01:00
|
|
|
void SplitHeader::scaleChangedEvent(float scale)
|
2017-09-22 00:50:43 +02:00
|
|
|
{
|
2018-01-25 21:11:14 +01:00
|
|
|
int w = 28 * scale;
|
2018-01-13 04:05:38 +01:00
|
|
|
|
|
|
|
this->setFixedHeight(w);
|
2018-01-17 16:52:51 +01:00
|
|
|
this->dropdownButton->setFixedWidth(w);
|
|
|
|
this->moderationButton->setFixedWidth(w);
|
2018-01-27 21:13:22 +01:00
|
|
|
// this->titleLabel->setFont(
|
|
|
|
// singletons::FontManager::getInstance().getFont(FontStyle::Medium, scale));
|
2017-09-22 00:50:43 +02:00
|
|
|
}
|
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
void SplitHeader::updateChannelText()
|
2017-01-17 00:15:44 +01:00
|
|
|
{
|
2018-04-20 22:33:28 +02:00
|
|
|
auto indirectChannel = this->split->getIndirectChannel();
|
2018-04-20 19:54:45 +02:00
|
|
|
auto channel = this->split->getChannel();
|
|
|
|
|
2018-04-20 22:33:28 +02:00
|
|
|
QString title = channel->name;
|
|
|
|
|
|
|
|
if (indirectChannel.getType() == Channel::TwitchWatching) {
|
|
|
|
title = "watching: " + (title.isEmpty() ? "none" : title);
|
2018-03-30 15:05:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
TwitchChannel *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get());
|
2017-09-22 00:50:43 +02:00
|
|
|
|
2018-03-30 15:05:33 +02:00
|
|
|
if (twitchChannel != nullptr) {
|
2018-05-26 16:31:43 +02:00
|
|
|
const auto streamStatus = twitchChannel->getStreamStatus();
|
2018-03-30 15:05:33 +02:00
|
|
|
|
|
|
|
if (streamStatus.live) {
|
2017-12-23 22:17:38 +01:00
|
|
|
this->isLive = true;
|
|
|
|
this->tooltip = "<style>.center { text-align: center; }</style>"
|
|
|
|
"<p class = \"center\">" +
|
2018-04-08 15:14:14 +02:00
|
|
|
streamStatus.title + "<br><br>" + streamStatus.game + "<br>" +
|
|
|
|
(streamStatus.rerun ? "Vod-casting" : "Live") + " for " +
|
2018-03-30 15:05:33 +02:00
|
|
|
streamStatus.uptime + " with " +
|
|
|
|
QString::number(streamStatus.viewerCount) +
|
2018-01-13 04:05:38 +01:00
|
|
|
" viewers"
|
|
|
|
"</p>";
|
2018-04-08 15:14:14 +02:00
|
|
|
if (streamStatus.rerun) {
|
2018-04-20 22:33:28 +02:00
|
|
|
title += " (rerun)";
|
2018-05-26 16:31:43 +02:00
|
|
|
} else if (streamStatus.streamType.isEmpty()) {
|
|
|
|
title += " (" + streamStatus.streamType + ")";
|
2018-04-08 15:14:14 +02:00
|
|
|
} else {
|
2018-04-20 22:33:28 +02:00
|
|
|
title += " (live)";
|
2018-04-08 15:14:14 +02:00
|
|
|
}
|
2018-05-26 16:31:43 +02:00
|
|
|
} else {
|
|
|
|
this->tooltip = QString();
|
2017-09-11 22:37:39 +02:00
|
|
|
}
|
2017-07-09 17:49:02 +02:00
|
|
|
}
|
2018-03-30 15:05:33 +02:00
|
|
|
|
2018-04-20 22:33:28 +02:00
|
|
|
if (title.isEmpty()) {
|
|
|
|
title = "<empty>";
|
|
|
|
}
|
|
|
|
|
2018-03-30 15:05:33 +02:00
|
|
|
this->isLive = false;
|
2018-04-20 22:33:28 +02:00
|
|
|
this->titleLabel->setText(title);
|
2017-01-17 00:15:44 +01:00
|
|
|
}
|
|
|
|
|
2018-01-17 16:52:51 +01:00
|
|
|
void SplitHeader::updateModerationModeIcon()
|
|
|
|
{
|
2018-04-28 15:20:18 +02:00
|
|
|
auto app = getApp();
|
|
|
|
|
2018-01-17 16:52:51 +01:00
|
|
|
this->moderationButton->setPixmap(this->split->getModerationMode()
|
2018-06-06 10:46:23 +02:00
|
|
|
? *app->resources->moderationmode_enabled->getPixmap()
|
|
|
|
: *app->resources->moderationmode_disabled->getPixmap());
|
2018-01-17 17:17:26 +01:00
|
|
|
|
2018-01-17 18:36:12 +01:00
|
|
|
bool modButtonVisible = false;
|
2018-01-24 13:15:41 +01:00
|
|
|
ChannelPtr channel = this->split->getChannel();
|
2018-01-17 18:36:12 +01:00
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
TwitchChannel *tc = dynamic_cast<TwitchChannel *>(channel.get());
|
2018-01-17 18:36:12 +01:00
|
|
|
|
|
|
|
if (tc != nullptr && tc->hasModRights()) {
|
|
|
|
modButtonVisible = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
this->moderationButton->setVisible(modButtonVisible);
|
2018-01-17 16:52:51 +01:00
|
|
|
}
|
|
|
|
|
2018-05-24 08:58:34 +02:00
|
|
|
void SplitHeader::updateModes()
|
|
|
|
{
|
|
|
|
TwitchChannel *tc = dynamic_cast<TwitchChannel *>(this->split->getChannel().get());
|
|
|
|
if (tc == nullptr) {
|
2018-05-24 10:07:31 +02:00
|
|
|
this->modeButton->hide();
|
2018-05-24 08:58:34 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
TwitchChannel::RoomModes roomModes = tc->getRoomModes();
|
|
|
|
|
|
|
|
QString text;
|
|
|
|
|
|
|
|
if (roomModes.r9k) {
|
|
|
|
text += "r9k, ";
|
|
|
|
}
|
|
|
|
if (roomModes.slowMode) {
|
|
|
|
text += QString("slow(%1), ").arg(QString::number(roomModes.slowMode));
|
|
|
|
}
|
|
|
|
if (roomModes.emoteOnly) {
|
|
|
|
text += "emote, ";
|
|
|
|
}
|
|
|
|
if (roomModes.submode) {
|
|
|
|
text += "sub, ";
|
|
|
|
}
|
|
|
|
|
|
|
|
if (text.length() > 2) {
|
|
|
|
text = text.mid(0, text.size() - 2);
|
|
|
|
}
|
|
|
|
|
2018-05-24 10:03:07 +02:00
|
|
|
if (text.isEmpty()) {
|
|
|
|
this->modeButton->hide();
|
|
|
|
} else {
|
|
|
|
static QRegularExpression commaReplacement("^.+?, .+?,( ).+$");
|
|
|
|
QRegularExpressionMatch match = commaReplacement.match(text);
|
|
|
|
if (match.hasMatch()) {
|
|
|
|
text = text.mid(0, match.capturedStart(1)) + '\n' + text.mid(match.capturedEnd(1));
|
|
|
|
}
|
2018-05-24 08:58:34 +02:00
|
|
|
|
2018-05-24 10:03:07 +02:00
|
|
|
this->modeButton->getLabel().setText(text);
|
|
|
|
this->modeButton->show();
|
2018-05-24 08:58:34 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
void SplitHeader::paintEvent(QPaintEvent *)
|
2017-01-01 02:30:42 +01:00
|
|
|
{
|
|
|
|
QPainter painter(this);
|
|
|
|
|
2018-04-27 22:11:19 +02:00
|
|
|
painter.fillRect(rect(), this->themeManager->splits.header.background);
|
|
|
|
painter.setPen(this->themeManager->splits.header.border);
|
2017-01-01 02:30:42 +01:00
|
|
|
painter.drawRect(0, 0, width() - 1, height() - 1);
|
|
|
|
}
|
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
void SplitHeader::mousePressEvent(QMouseEvent *event)
|
2017-01-01 02:30:42 +01:00
|
|
|
{
|
2018-05-16 14:55:45 +02:00
|
|
|
if (event->button() == Qt::LeftButton) {
|
|
|
|
this->dragging = true;
|
|
|
|
|
|
|
|
this->dragStart = event->pos();
|
|
|
|
}
|
2017-01-01 02:30:42 +01:00
|
|
|
|
2018-05-16 14:55:45 +02:00
|
|
|
this->doubleClicked = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SplitHeader::mouseReleaseEvent(QMouseEvent *event)
|
|
|
|
{
|
|
|
|
if (this->dragging && event->button() == Qt::LeftButton) {
|
|
|
|
QPoint pos = event->globalPos();
|
|
|
|
|
|
|
|
if (!showingHelpTooltip) {
|
|
|
|
this->showingHelpTooltip = true;
|
|
|
|
|
|
|
|
QTimer::singleShot(400, this, [this, pos] {
|
|
|
|
if (this->doubleClicked) {
|
|
|
|
this->doubleClicked = false;
|
|
|
|
this->showingHelpTooltip = false;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
TooltipWidget *widget = new TooltipWidget();
|
|
|
|
|
2018-05-17 12:16:13 +02:00
|
|
|
widget->setText("Double click or press <Ctrl+R> to change the channel.\nClick and "
|
2018-05-16 14:55:45 +02:00
|
|
|
"drag to move the split.");
|
|
|
|
widget->setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
widget->move(pos);
|
|
|
|
widget->show();
|
2018-05-24 10:07:31 +02:00
|
|
|
widget->raise();
|
2018-05-16 14:55:45 +02:00
|
|
|
|
|
|
|
QTimer::singleShot(3000, widget, [this, widget] {
|
|
|
|
widget->close();
|
|
|
|
this->showingHelpTooltip = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
this->dragging = false;
|
2017-01-01 02:30:42 +01:00
|
|
|
}
|
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
void SplitHeader::mouseMoveEvent(QMouseEvent *event)
|
2017-01-01 02:30:42 +01:00
|
|
|
{
|
2018-05-11 13:55:10 +02:00
|
|
|
if (this->dragging) {
|
2018-05-26 16:31:43 +02:00
|
|
|
if (std::abs(this->dragStart.x() - event->pos().x()) > int(12 * this->getScale()) ||
|
|
|
|
std::abs(this->dragStart.y() - event->pos().y()) > int(12 * this->getScale())) {
|
2018-05-11 13:55:10 +02:00
|
|
|
this->split->drag();
|
|
|
|
this->dragging = false;
|
|
|
|
}
|
|
|
|
}
|
2017-01-01 02:30:42 +01:00
|
|
|
}
|
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
void SplitHeader::mouseDoubleClickEvent(QMouseEvent *event)
|
2017-01-17 00:15:44 +01:00
|
|
|
{
|
|
|
|
if (event->button() == Qt::LeftButton) {
|
2018-01-13 04:05:38 +01:00
|
|
|
this->split->doChangeChannel();
|
2017-01-17 00:15:44 +01:00
|
|
|
}
|
2018-05-16 14:55:45 +02:00
|
|
|
this->doubleClicked = true;
|
2017-01-17 00:15:44 +01:00
|
|
|
}
|
|
|
|
|
2018-05-26 16:31:43 +02:00
|
|
|
void SplitHeader::enterEvent(QEvent *event)
|
|
|
|
{
|
|
|
|
if (!this->tooltip.isEmpty()) {
|
|
|
|
auto tooltipWidget = TooltipWidget::getInstance();
|
2018-05-26 17:11:09 +02:00
|
|
|
tooltipWidget->moveTo(this, this->mapToGlobal(this->rect().bottomLeft()), false);
|
2018-05-26 16:31:43 +02:00
|
|
|
tooltipWidget->setText(this->tooltip);
|
|
|
|
tooltipWidget->show();
|
|
|
|
tooltipWidget->raise();
|
|
|
|
}
|
|
|
|
|
|
|
|
BaseWidget::enterEvent(event);
|
|
|
|
}
|
|
|
|
|
2018-05-16 14:55:45 +02:00
|
|
|
void SplitHeader::leaveEvent(QEvent *event)
|
|
|
|
{
|
|
|
|
TooltipWidget::getInstance()->hide();
|
2018-05-26 16:31:43 +02:00
|
|
|
|
2018-05-16 14:55:45 +02:00
|
|
|
BaseWidget::leaveEvent(event);
|
|
|
|
}
|
2018-05-26 16:31:43 +02:00
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
void SplitHeader::rightButtonClicked()
|
2017-01-15 16:38:30 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-01-25 20:49:49 +01:00
|
|
|
void SplitHeader::themeRefreshEvent()
|
2017-07-02 14:28:37 +02:00
|
|
|
{
|
|
|
|
QPalette palette;
|
2018-04-27 22:11:19 +02:00
|
|
|
palette.setColor(QPalette::Foreground, this->themeManager->splits.header.text);
|
2017-07-02 14:28:37 +02:00
|
|
|
|
2018-01-17 16:52:51 +01:00
|
|
|
// this->dropdownButton->setPalette(palette);
|
2018-01-13 04:05:38 +01:00
|
|
|
this->titleLabel->setPalette(palette);
|
2018-01-17 16:52:51 +01:00
|
|
|
// this->moderationLabel->setPalette(palette);
|
2017-07-02 14:28:37 +02:00
|
|
|
}
|
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
void SplitHeader::menuMoveSplit()
|
2017-01-15 16:38:30 +01:00
|
|
|
{
|
|
|
|
}
|
2017-06-10 23:53:39 +02:00
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
void SplitHeader::menuReloadChannelEmotes()
|
2017-01-15 16:38:30 +01:00
|
|
|
{
|
2018-06-05 15:03:34 +02:00
|
|
|
auto channel = this->split->getChannel();
|
|
|
|
TwitchChannel *twitchChannel = dynamic_cast<TwitchChannel *>(channel.get());
|
|
|
|
|
|
|
|
if (twitchChannel) {
|
|
|
|
twitchChannel->reloadChannelEmotes();
|
|
|
|
}
|
2017-01-15 16:38:30 +01:00
|
|
|
}
|
2017-06-10 23:53:39 +02:00
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
void SplitHeader::menuManualReconnect()
|
2017-01-15 16:38:30 +01:00
|
|
|
{
|
2018-04-28 15:20:18 +02:00
|
|
|
auto app = getApp();
|
|
|
|
|
2018-02-05 15:11:50 +01:00
|
|
|
// fourtf: connection
|
2018-04-28 15:20:18 +02:00
|
|
|
app->twitch.server->connect();
|
2017-01-15 16:38:30 +01:00
|
|
|
}
|
2017-06-10 23:53:39 +02:00
|
|
|
|
2017-11-12 17:21:50 +01:00
|
|
|
void SplitHeader::menuShowChangelog()
|
2017-01-15 16:38:30 +01:00
|
|
|
{
|
|
|
|
}
|
2017-06-07 10:09:24 +02:00
|
|
|
|
|
|
|
} // namespace widgets
|
|
|
|
} // namespace chatterino
|