Finish renaming Viewer list to Chatter list (#4974)

This commit is contained in:
Mm2PL 2023-11-20 18:59:04 +01:00 committed by GitHub
parent fbc8aacabe
commit 1a685d7bd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 43 additions and 43 deletions

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -168,7 +168,7 @@ Not used anywhere at the moment.
URL: https://dev.twitch.tv/docs/api/reference/#get-chatters
Used for the viewer list for moderators/broadcasters.
Used for the chatter list for moderators/broadcasters.
### Send Shoutout

View file

@ -652,7 +652,7 @@ void Split::addShortcuts()
}},
{"openViewerList",
[this](std::vector<QString>) -> QString {
this->showViewerList();
this->showChatterList();
return "";
}},
{"clearMessages",
@ -852,11 +852,11 @@ void Split::setChannel(IndirectChannel newChannel)
if (newChannel.getType() == Channel::Type::Twitch)
{
this->header_->setViewersButtonVisible(true);
this->header_->setChattersButtonVisible(true);
}
else
{
this->header_->setViewersButtonVisible(false);
this->header_->setChattersButtonVisible(false);
}
this->channelSignalHolder_.managedConnect(
@ -1028,7 +1028,7 @@ void Split::changeChannel()
if (popup.size() && popup.at(0)->isVisible() && !popup.at(0)->isFloating())
{
popup.at(0)->hide();
showViewerList();
showChatterList();
}
}
@ -1122,31 +1122,31 @@ void Split::openWithCustomScheme()
}
}
void Split::showViewerList()
void Split::showChatterList()
{
auto viewerDock =
new QDockWidget("Viewer List - " + this->getChannel()->getName(), this);
viewerDock->setAllowedAreas(Qt::LeftDockWidgetArea);
viewerDock->setFeatures(QDockWidget::DockWidgetVerticalTitleBar |
QDockWidget::DockWidgetClosable |
QDockWidget::DockWidgetFloatable);
viewerDock->resize(
auto *chatterDock = new QDockWidget(
"Chatter List - " + this->getChannel()->getName(), this);
chatterDock->setAllowedAreas(Qt::LeftDockWidgetArea);
chatterDock->setFeatures(QDockWidget::DockWidgetVerticalTitleBar |
QDockWidget::DockWidgetClosable |
QDockWidget::DockWidgetFloatable);
chatterDock->resize(
0.5 * this->width(),
this->height() - this->header_->height() - this->input_->height());
viewerDock->move(0, this->header_->height());
chatterDock->move(0, this->header_->height());
auto multiWidget = new QWidget(viewerDock);
auto *multiWidget = new QWidget(chatterDock);
auto *dockVbox = new QVBoxLayout();
auto searchBar = new QLineEdit(viewerDock);
auto *searchBar = new QLineEdit(chatterDock);
auto chattersList = new QListWidget();
auto resultList = new QListWidget();
auto *chattersList = new QListWidget();
auto *resultList = new QListWidget();
auto channel = this->getChannel();
if (!channel)
{
qCWarning(chatterinoWidget)
<< "Viewer list opened when no channel was defined";
<< "Chatter list opened when no channel was defined";
return;
}
@ -1155,7 +1155,7 @@ void Split::showViewerList()
if (twitchChannel == nullptr)
{
qCWarning(chatterinoWidget)
<< "Viewer list opened in a non-Twitch channel";
<< "Chatter list opened in a non-Twitch channel";
return;
}
@ -1163,14 +1163,14 @@ void Split::showViewerList()
searchBar->setPlaceholderText("Search User...");
auto formatListItemText = [](QString text) {
auto item = new QListWidgetItem();
auto *item = new QListWidgetItem();
item->setText(text);
item->setFont(getApp()->fonts->getFont(FontStyle::ChatMedium, 1.0));
return item;
};
auto addLabel = [this, formatListItemText, chattersList](QString label) {
auto formattedLabel = formatListItemText(label);
auto *formattedLabel = formatListItemText(label);
formattedLabel->setForeground(this->theme->accent);
chattersList->addItem(formattedLabel);
};
@ -1336,13 +1336,13 @@ void Split::showViewerList()
formatListItemText("Due to Twitch restrictions, this feature is "
"only \navailable for moderators."));
chattersList->addItem(
formatListItemText("If you would like to see the Viewer list, you "
formatListItemText("If you would like to see the Chatter list, you "
"must \nuse the Twitch website."));
loadingLabel->hide();
}
QObject::connect(viewerDock, &QDockWidget::topLevelChanged, this, [=]() {
viewerDock->setMinimumWidth(300);
QObject::connect(chatterDock, &QDockWidget::topLevelChanged, this, [=]() {
chatterDock->setMinimumWidth(300);
});
auto listDoubleClick = [this](const QModelIndex &index) {
@ -1364,8 +1364,8 @@ void Split::showViewerList()
HotkeyController::HotkeyMap actions{
{"delete",
[viewerDock](std::vector<QString>) -> QString {
viewerDock->close();
[chatterDock](std::vector<QString>) -> QString {
chatterDock->close();
return "";
}},
{"accept", nullptr},
@ -1381,7 +1381,7 @@ void Split::showViewerList()
};
getApp()->hotkeys->shortcutsForCategory(HotkeyCategory::PopupWindow,
actions, viewerDock);
actions, chatterDock);
dockVbox->addWidget(searchBar);
dockVbox->addWidget(loadingLabel);
@ -1391,10 +1391,10 @@ void Split::showViewerList()
multiWidget->setStyleSheet(this->theme->splits.input.styleSheet);
multiWidget->setLayout(dockVbox);
viewerDock->setWidget(multiWidget);
viewerDock->setFloating(true);
viewerDock->show();
viewerDock->activateWindow();
chatterDock->setWidget(multiWidget);
chatterDock->setFloating(true);
chatterDock->show();
chatterDock->activateWindow();
}
void Split::openSubPage()

View file

@ -185,7 +185,7 @@ public slots:
void openWithCustomScheme();
void setFiltersDialog();
void showSearch(bool singleChannel);
void showViewerList();
void showChatterList();
void openSubPage();
void reloadChannelAndSubscriberEmotes();
void reconnect();

View file

@ -320,9 +320,9 @@ void SplitHeader::initializeLayout()
});
}),
// chatter list
this->viewersButton_ = makeWidget<Button>([&](auto w) {
this->chattersButton_ = makeWidget<Button>([&](auto w) {
QObject::connect(w, &Button::leftClicked, this, [this]() {
this->split_->showViewerList();
this->split_->showChatterList();
});
}),
// dropdown
@ -511,7 +511,7 @@ std::unique_ptr<QMenu> SplitHeader::createMainMenu()
if (twitchChannel)
{
moreMenu->addAction(
"Show chatter list", this->split_, &Split::showViewerList,
"Show chatter list", this->split_, &Split::showChatterList,
h->getDisplaySequence(HotkeyCategory::Split, "openViewerList"));
moreMenu->addAction("Subscribe", this->split_, &Split::openSubPage);
@ -745,7 +745,7 @@ void SplitHeader::scaleChangedEvent(float scale)
this->setFixedHeight(w);
this->dropdownButton_->setFixedWidth(w);
this->moderationButton_->setFixedWidth(w);
this->viewersButton_->setFixedWidth(w);
this->chattersButton_->setFixedWidth(w);
this->addButton_->setFixedWidth(w * 5 / 8);
}
@ -754,9 +754,9 @@ void SplitHeader::setAddButtonVisible(bool value)
this->addButton_->setVisible(value);
}
void SplitHeader::setViewersButtonVisible(bool value)
void SplitHeader::setChattersButtonVisible(bool value)
{
this->viewersButton_->setVisible(value);
this->chattersButton_->setVisible(value);
}
void SplitHeader::updateChannelText()
@ -987,13 +987,13 @@ void SplitHeader::themeChangedEvent()
// --
if (this->theme->isLightTheme())
{
this->viewersButton_->setPixmap(getResources().buttons.viewersDark);
this->chattersButton_->setPixmap(getResources().buttons.chattersDark);
this->dropdownButton_->setPixmap(getResources().buttons.menuDark);
this->addButton_->setPixmap(getResources().buttons.addSplit);
}
else
{
this->viewersButton_->setPixmap(getResources().buttons.viewersLight);
this->chattersButton_->setPixmap(getResources().buttons.chattersLight);
this->dropdownButton_->setPixmap(getResources().buttons.menuLight);
this->addButton_->setPixmap(getResources().buttons.addSplitDark);
}

View file

@ -28,7 +28,7 @@ public:
explicit SplitHeader(Split *split);
void setAddButtonVisible(bool value);
void setViewersButtonVisible(bool value);
void setChattersButtonVisible(bool value);
void updateChannelText();
void updateModerationModeIcon();
@ -86,7 +86,7 @@ private:
QAction *modeActionSetFollowers{};
Button *moderationButton_{};
Button *viewersButton_{};
Button *chattersButton_{};
Button *addButton_{};
// states