From 1a685d7bd00ae8ac3fa0d3c5f584f1a2ec69da09 Mon Sep 17 00:00:00 2001 From: Mm2PL Date: Mon, 20 Nov 2023 18:59:04 +0100 Subject: [PATCH] Finish renaming Viewer list to Chatter list (#4974) --- .../{viewersDark.png => chattersDark.png} | Bin .../{viewersLight.png => chattersLight.png} | Bin src/providers/twitch/api/README.md | 2 +- src/widgets/splits/Split.cpp | 62 +++++++++--------- src/widgets/splits/Split.hpp | 2 +- src/widgets/splits/SplitHeader.cpp | 16 ++--- src/widgets/splits/SplitHeader.hpp | 4 +- 7 files changed, 43 insertions(+), 43 deletions(-) rename resources/buttons/{viewersDark.png => chattersDark.png} (100%) rename resources/buttons/{viewersLight.png => chattersLight.png} (100%) diff --git a/resources/buttons/viewersDark.png b/resources/buttons/chattersDark.png similarity index 100% rename from resources/buttons/viewersDark.png rename to resources/buttons/chattersDark.png diff --git a/resources/buttons/viewersLight.png b/resources/buttons/chattersLight.png similarity index 100% rename from resources/buttons/viewersLight.png rename to resources/buttons/chattersLight.png diff --git a/src/providers/twitch/api/README.md b/src/providers/twitch/api/README.md index e300e5440..23509c94b 100644 --- a/src/providers/twitch/api/README.md +++ b/src/providers/twitch/api/README.md @@ -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 diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 7565b61a2..7d1a2b91e 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -652,7 +652,7 @@ void Split::addShortcuts() }}, {"openViewerList", [this](std::vector) -> 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 { - viewerDock->close(); + [chatterDock](std::vector) -> 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() diff --git a/src/widgets/splits/Split.hpp b/src/widgets/splits/Split.hpp index 493cdf2f1..f0cc3de85 100644 --- a/src/widgets/splits/Split.hpp +++ b/src/widgets/splits/Split.hpp @@ -185,7 +185,7 @@ public slots: void openWithCustomScheme(); void setFiltersDialog(); void showSearch(bool singleChannel); - void showViewerList(); + void showChatterList(); void openSubPage(); void reloadChannelAndSubscriberEmotes(); void reconnect(); diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index 887176d5c..19e34e8b3 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -320,9 +320,9 @@ void SplitHeader::initializeLayout() }); }), // chatter list - this->viewersButton_ = makeWidget