mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
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:
parent
f170d31ab5
commit
7246ab38c7
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue