From 2ac0b60952d34c6820a9f867d02a49eb925a2eef Mon Sep 17 00:00:00 2001 From: apa420 <17131426+apa420@users.noreply.github.com> Date: Mon, 13 Apr 2020 12:24:27 +0200 Subject: [PATCH] option to hide viewer count and duration of the stream when you hover on the split (#1626) Fixes #1621 --- src/singletons/Settings.hpp | 2 ++ src/widgets/settingspages/GeneralPage.cpp | 3 +++ src/widgets/splits/SplitHeader.cpp | 7 +++++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/singletons/Settings.hpp b/src/singletons/Settings.hpp index 7ae1984bc..c95b0e500 100644 --- a/src/singletons/Settings.hpp +++ b/src/singletons/Settings.hpp @@ -278,6 +278,8 @@ public: BoolSetting restartOnCrash = {"/misc/restartOnCrash", false}; BoolSetting attachExtensionToAnyProcess = { "/misc/attachExtensionToAnyProcess", false}; + BoolSetting hideViewerCountAndDuration = { + "/misc/hideViewerCountAndDuration", false}; /// Debug BoolSetting showUnhandledIrcMessages = {"/debug/showUnhandledIrcMessages", diff --git a/src/widgets/settingspages/GeneralPage.cpp b/src/widgets/settingspages/GeneralPage.cpp index 03d8c8c9f..7c4acf998 100644 --- a/src/widgets/settingspages/GeneralPage.cpp +++ b/src/widgets/settingspages/GeneralPage.cpp @@ -540,6 +540,9 @@ void GeneralPage::initLayout(SettingsLayout &layout) s.enableExperimentalIrc); layout.addCheckbox("Show unhandled IRC messages", s.showUnhandledIrcMessages); + layout.addCheckbox( + "Hide viewercount and stream length while hovering the split", + s.hideViewerCountAndDuration); layout.addTitle("Cache"); layout.addDescription( diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index 2ca47effc..55ec556e8 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -94,8 +94,11 @@ namespace { .arg(s.game.toHtmlEscaped()) .arg(s.game.isEmpty() ? QString() : "
") .arg(s.rerun ? "Vod-casting" : "Live") - .arg(s.uptime) - .arg(QString::number(s.viewerCount)); + .arg(getSettings()->hideViewerCountAndDuration ? "<Hidden>" + : s.uptime) + .arg(getSettings()->hideViewerCountAndDuration + ? "<Hidden>" + : QString::number(s.viewerCount)); } auto formatOfflineTooltip(const TwitchChannel::StreamStatus &s) {