Add chatter count for each category in viewer list (#3683)

Co-authored-by: Kasia <zneix@zneix.eu>
Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
badoge 2022-04-24 08:54:37 -07:00 committed by GitHub
parent f170d31ab5
commit 7246ab38c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 9 deletions

View file

@ -6,6 +6,7 @@
- Minor: Adjust large stream thumbnail to 16:9 (#3655)
- Minor: Fixed being unable to load Twitch Usercards from the `/mentions` tab. (#3623)
- Minor: Add information about the user's operating system in the About page. (#3663)
- Minor: Added chatter count for each category in viewer list. (#3683)
- Bugfix: Fixed live notifications for usernames containing uppercase characters. (#3646)
- Bugfix: Fixed certain settings dialogs appearing behind the main window, when `Always on top` was used. (#3679)
- Bugfix: Fixed an issue in the emote picker where an emotes tooltip would not properly disappear. (#3686)

View file

@ -983,13 +983,6 @@ void Split::showViewerList()
static QStringList jsonLabels = {"broadcaster", "moderators", "vips",
"staff", "admins", "global_mods",
"viewers"};
QList<QListWidgetItem *> labelList;
for (auto &x : labels)
{
auto label = formatListItemText(x);
label->setForeground(this->theme->accent);
labelList.append(label);
}
auto loadingLabel = new QLabel("Loading...");
NetworkRequest::twitchRequest("https://tmi.twitch.tv/group/user/" +
@ -1014,7 +1007,10 @@ void Split::showViewerList()
if (currentCategory.empty())
continue;
chattersList->addItem(labelList.at(i));
auto label = formatListItemText(QString("%1 (%2)").arg(
labels.at(i), localizeNumbers(currentCategory.size())));
label->setForeground(this->theme->accent);
chattersList->addItem(label);
foreach (const QJsonValue &v, currentCategory)
{
chattersList->addItem(formatListItemText(v.toString()));
@ -1055,7 +1051,9 @@ void Split::showViewerList()
});
auto listDoubleClick = [=](QString userName) {
if (!labels.contains(userName) && !userName.isEmpty())
// if the list item contains a parentheses it means that
// it's a category label so don't show a usercard
if (!userName.contains("(") && !userName.isEmpty())
{
this->view_->showUserInfoPopup(userName);
}