mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
* Added functionality of customizable split headers * removed empty line
This commit is contained in:
parent
c6cfb548f5
commit
43ba408568
4 changed files with 44 additions and 1 deletions
|
@ -45,6 +45,12 @@ public:
|
||||||
BoolSetting enableSmoothScrollingNewMessages = {"/appearance/smoothScrollingNewMessages",
|
BoolSetting enableSmoothScrollingNewMessages = {"/appearance/smoothScrollingNewMessages",
|
||||||
false};
|
false};
|
||||||
BoolSetting enableUsernameBold = {"/appearence/messages/boldUsernames", false};
|
BoolSetting enableUsernameBold = {"/appearence/messages/boldUsernames", false};
|
||||||
|
// BoolSetting customizable splitheader
|
||||||
|
BoolSetting showViewerCount = {"/appearance/splitheader/showViewerCount", false};
|
||||||
|
BoolSetting showTitle = {"/appearance/splitheader/showTitle", false};
|
||||||
|
BoolSetting showGame = {"/appearance/splitheader/showGame", false};
|
||||||
|
BoolSetting showUptime = {"/appearance/splitheader/showUptime", false};
|
||||||
|
|
||||||
// BoolSetting useCustomWindowFrame = {"/appearance/useCustomWindowFrame", false};
|
// BoolSetting useCustomWindowFrame = {"/appearance/useCustomWindowFrame", false};
|
||||||
|
|
||||||
/// Behaviour
|
/// Behaviour
|
||||||
|
|
|
@ -53,6 +53,7 @@ void LookPage::initializeUi()
|
||||||
this->addInterfaceTab(tabs.appendTab(new QVBoxLayout, "Interface"));
|
this->addInterfaceTab(tabs.appendTab(new QVBoxLayout, "Interface"));
|
||||||
this->addMessageTab(tabs.appendTab(new QVBoxLayout, "Messages"));
|
this->addMessageTab(tabs.appendTab(new QVBoxLayout, "Messages"));
|
||||||
this->addEmoteTab(tabs.appendTab(new QVBoxLayout, "Emotes"));
|
this->addEmoteTab(tabs.appendTab(new QVBoxLayout, "Emotes"));
|
||||||
|
this->addSplitHeaderTab(tabs.appendTab(new QVBoxLayout, "Split header"));
|
||||||
|
|
||||||
layout->addStretch(1);
|
layout->addStretch(1);
|
||||||
|
|
||||||
|
@ -104,7 +105,6 @@ void LookPage::addInterfaceTab(LayoutCreator<QVBoxLayout> layout)
|
||||||
layout.append(this->createCheckBox(INPUT_EMPTY, getSettings()->showEmptyInput));
|
layout.append(this->createCheckBox(INPUT_EMPTY, getSettings()->showEmptyInput));
|
||||||
layout.append(
|
layout.append(
|
||||||
this->createCheckBox("Show message length while typing", getSettings()->showMessageLength));
|
this->createCheckBox("Show message length while typing", getSettings()->showMessageLength));
|
||||||
|
|
||||||
layout->addStretch(1);
|
layout->addStretch(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,6 +239,16 @@ void LookPage::addEmoteTab(LayoutCreator<QVBoxLayout> layout)
|
||||||
layout->addStretch(1);
|
layout->addStretch(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LookPage::addSplitHeaderTab(LayoutCreator<QVBoxLayout> layout)
|
||||||
|
{
|
||||||
|
layout.append(this->createCheckBox("Show viewer count", getSettings()->showViewerCount));
|
||||||
|
layout.append(this->createCheckBox("Show title", getSettings()->showTitle));
|
||||||
|
layout.append(this->createCheckBox("Show game", getSettings()->showGame));
|
||||||
|
layout.append(this->createCheckBox("Show uptime", getSettings()->showUptime));
|
||||||
|
|
||||||
|
layout->addStretch(1);
|
||||||
|
}
|
||||||
|
|
||||||
void LookPage::addLastReadMessageIndicatorPatternSelector(LayoutCreator<QVBoxLayout> layout)
|
void LookPage::addLastReadMessageIndicatorPatternSelector(LayoutCreator<QVBoxLayout> layout)
|
||||||
{
|
{
|
||||||
// combo
|
// combo
|
||||||
|
|
|
@ -22,6 +22,7 @@ private:
|
||||||
void addInterfaceTab(LayoutCreator<QVBoxLayout> layout);
|
void addInterfaceTab(LayoutCreator<QVBoxLayout> layout);
|
||||||
void addMessageTab(LayoutCreator<QVBoxLayout> layout);
|
void addMessageTab(LayoutCreator<QVBoxLayout> layout);
|
||||||
void addEmoteTab(LayoutCreator<QVBoxLayout> layout);
|
void addEmoteTab(LayoutCreator<QVBoxLayout> layout);
|
||||||
|
void addSplitHeaderTab(LayoutCreator<QVBoxLayout> layout);
|
||||||
|
|
||||||
void addLastReadMessageIndicatorPatternSelector(LayoutCreator<QVBoxLayout> layout);
|
void addLastReadMessageIndicatorPatternSelector(LayoutCreator<QVBoxLayout> layout);
|
||||||
|
|
||||||
|
|
|
@ -101,6 +101,20 @@ SplitHeader::SplitHeader(Split *_split)
|
||||||
this->addModeActions(this->modeMenu_);
|
this->addModeActions(this->modeMenu_);
|
||||||
|
|
||||||
this->setMouseTracking(true);
|
this->setMouseTracking(true);
|
||||||
|
|
||||||
|
// Update title on title-settings-change
|
||||||
|
getSettings()->showViewerCount.connect(
|
||||||
|
[this](const auto &, const auto &) { this->updateChannelText(); },
|
||||||
|
this->managedConnections_);
|
||||||
|
getSettings()->showTitle.connect(
|
||||||
|
[this](const auto &, const auto &) { this->updateChannelText(); },
|
||||||
|
this->managedConnections_);
|
||||||
|
getSettings()->showGame.connect(
|
||||||
|
[this](const auto &, const auto &) { this->updateChannelText(); },
|
||||||
|
this->managedConnections_);
|
||||||
|
getSettings()->showUptime.connect(
|
||||||
|
[this](const auto &, const auto &) { this->updateChannelText(); },
|
||||||
|
this->managedConnections_);
|
||||||
}
|
}
|
||||||
|
|
||||||
SplitHeader::~SplitHeader()
|
SplitHeader::~SplitHeader()
|
||||||
|
@ -331,6 +345,18 @@ void SplitHeader::updateChannelText()
|
||||||
} else {
|
} else {
|
||||||
title += " (live)";
|
title += " (live)";
|
||||||
}
|
}
|
||||||
|
if (getSettings()->showViewerCount) {
|
||||||
|
title += " - " + QString::number(streamStatus->viewerCount) + " viewers";
|
||||||
|
}
|
||||||
|
if (getSettings()->showTitle) {
|
||||||
|
title += " - " + streamStatus->title;
|
||||||
|
}
|
||||||
|
if (getSettings()->showGame) {
|
||||||
|
title += " - " + streamStatus->game;
|
||||||
|
}
|
||||||
|
if (getSettings()->showUptime) {
|
||||||
|
title += " - uptime: " + streamStatus->uptime;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this->tooltip_ = QString();
|
this->tooltip_ = QString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue