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 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 ### Send Shoutout

View file

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

View file

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

View file

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

View file

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