diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bc772381..f6aa579ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unversioned +- Minor: Improved viewer list window. - Major: Added Streamer Mode configuration (under `Settings -> General`), where you can select which features of Chatterino should behave differently when you are in Streamer Mode. (#2001) - Minor: Made the current channels emotes appear at the top of the emote picker popup. (#2057) - Minor: Added viewer list button to twitch channel header. (#1978) diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index 3d5fa9305..0fd44f5a4 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -8,6 +8,7 @@ #include "providers/twitch/TwitchChannel.hpp" #include "providers/twitch/TwitchIrcServer.hpp" #include "providers/twitch/TwitchMessageBuilder.hpp" +#include "singletons/Fonts.hpp" #include "singletons/Settings.hpp" #include "singletons/Theme.hpp" #include "singletons/WindowManager.hpp" @@ -608,7 +609,8 @@ void Split::openWithCustomScheme() void Split::showViewerList() { - auto viewerDock = new QDockWidget("Viewer List", this); + auto viewerDock = + new QDockWidget("Viewer List - " + this->getChannel()->getName(), this); viewerDock->setAllowedAreas(Qt::LeftDockWidgetArea); viewerDock->setFeatures(QDockWidget::DockWidgetVerticalTitleBar | QDockWidget::DockWidgetClosable | @@ -625,17 +627,24 @@ void Split::showViewerList() auto chattersList = new QListWidget(); auto resultList = new QListWidget(); - static QStringList labels = {"Broadcaster", "VIPs", "Moderators", - "Staff", "Admins", "Global Moderators", - "Viewers"}; - static QStringList jsonLabels = {"broadcaster", "vips", "moderators", - "staff", "admins", "global_mods", + auto formatListItemText = [](QString text) { + auto item = new QListWidgetItem(); + item->setText(text); + item->setFont(getApp()->fonts->getFont(FontStyle::ChatMedium, 1.0)); + return item; + }; + + static QStringList labels = { + "Broadcaster", "Moderators", "VIPs", "Staff", + "Admins", "Global Moderators", "Viewers"}; + static QStringList jsonLabels = {"broadcaster", "moderators", "vips", + "staff", "admins", "global_mods", "viewers"}; QList labelList; for (auto &x : labels) { - auto label = new QListWidgetItem(x); - label->setBackgroundColor(this->theme->splits.header.background); + auto label = formatListItemText(x); + label->setForeground(this->theme->accent); labelList.append(label); } auto loadingLabel = new QLabel("Loading..."); @@ -659,7 +668,10 @@ void Split::showViewerList() chattersList->addItem(labelList.at(i)); foreach (const QJsonValue &v, currentCategory) - chattersList->addItem(v.toString()); + { + chattersList->addItem(formatListItemText(v.toString())); + } + chattersList->addItem(new QListWidgetItem()); } return Success; @@ -677,7 +689,9 @@ void Split::showViewerList() for (auto &item : results) { if (!labels.contains(item->text())) - resultList->addItem(item->text()); + { + resultList->addItem(formatListItemText(item->text())); + } } resultList->show(); } @@ -692,7 +706,7 @@ void Split::showViewerList() [=]() { viewerDock->setMinimumWidth(300); }); auto listDoubleClick = [=](QString userName) { - if (!labels.contains(userName)) + if (!labels.contains(userName) && !userName.isEmpty()) { this->view_->showUserInfoPopup(userName); }