From 98762fdfa046fdbf1dfe1baacdbd7cde40c3858c Mon Sep 17 00:00:00 2001 From: Dave Date: Sat, 10 Oct 2020 11:24:53 -0400 Subject: [PATCH] Add viewer list button to twitch channel header (#2042) --- CHANGELOG.md | 1 + resources/buttons/viewersDark.png | Bin 0 -> 2482 bytes resources/buttons/viewersLight.png | Bin 0 -> 2509 bytes resources/resources_autogenerated.qrc | 2 ++ src/autogenerated/ResourcesAutogen.cpp | 2 ++ src/autogenerated/ResourcesAutogen.hpp | 2 ++ src/widgets/splits/Split.cpp | 9 +++++++++ src/widgets/splits/SplitHeader.cpp | 13 +++++++++++++ src/widgets/splits/SplitHeader.hpp | 2 ++ 9 files changed, 31 insertions(+) create mode 100644 resources/buttons/viewersDark.png create mode 100644 resources/buttons/viewersLight.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 73c5f574c..81ec712b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unversioned +- Minor: Added viewer list button to twitch channel header. (#1978) - Minor: Added followage and subage information to usercard. (#2023) - Minor: Added an option to only open channels specified in command line with `-c` parameter. You can also use `--help` to display short help message (#1940) - Minor: Added customizable timeout buttons to the user info popup diff --git a/resources/buttons/viewersDark.png b/resources/buttons/viewersDark.png new file mode 100644 index 0000000000000000000000000000000000000000..399b942e291b4f59bdf0bbd51be53a395784d8e2 GIT binary patch literal 2482 zcmV;j2~GBiP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1Yw609l={Ld=R5=eM22NkN$4({?#^U%@JnbE2{ zl%gS!raQr*{NLX~fAAAgLdN>wqH_vA6HSzahoJf|wmU1+?(HXI2=50wZ36<6Mz8y; zPs2aKZeJ7D7(5;A6vl{zvCtS;7t}R!jkfGT!Y`(sHaZYGtJOdPLJr$od!_aS9Y|iE z=$-xT>5Y6z!>-@Bbb}*2Tn@0kCcja<3#>OpavX3*`O|jBRmu`d$$fXpI56r)Mk!j^ zsdL~sfpXoZIW&*U;@P(r(Sk~9hB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png b/resources/buttons/viewersLight.png new file mode 100644 index 0000000000000000000000000000000000000000..a55aae5c4d4ba1dc5ca00112f3168071b9065cf7 GIT binary patch literal 2509 zcmV;;2{QJHP) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1Y=(xe~^{GU_o5lA3Bj)MwSdxJgxHi&-eIIr53 z8o>}r)1BZ@`SZKdFI*x<$Z3c^d2evJ_A}GUv75XjScW?wrrhMLZ_C;Vj$$Sy{$LqNYIJoZA4f0 z_tAxX$-{0hT>8Ng2DcNe7rWiV$T6_p5y^SNI};wZGk&!$vDUKgE;|oK{m7_J_Qp_i zoIttluX(h9pJE((OK8z#Geh#l%w|HHIkABKO6+*y%#};;XPyDkNfBrwBD2_Ti_j>^ z43!ufp>dU9lU;0tZnG4!7G~M8aF3gMyqO~+FAP^k^alPj1<+vxT3cUrUH7EMoys zgxCr&Y@vYhY?VEmAQG6tV}w8%$i+IDpa84N0+8aY^+G|SwAgqjaQ77zFU^dzsa28n zHb9$XGsJREkw3vj7`Nl%_l*eP%c7?B_7YIn8;I#V$A| z7QcigE@{bysope%PC07Q{SV~`(mm>SquSEGb8}a0t-{8sv8X=GmzYUnZXdP$ZC|IFk0!eFO&&*q zOa)&R_?Lu_r)>}2$C%rmo=x2K4aK&6zBtf2nAU&@T+8K2A;jjbfb4R`fj)J|1JX|s ztr+YM=j?!B)T1EpkPj>TEnFKsUmaj;hl;lwW+mL9V0-DkU_HR<LbCZ5y2>8$N4< zo#dPKH}vF37;O_DqT5(HPSH^4sr$~^3B}I&9++-%9$==vSIG57TpFqKrDzB7TBbFQ zWDo9+{66KRN4#;PdvaQR<*y*psgSlJ*l_QKy6(RZxdBP1?KL<0gaWsv|8@O?KV8e| zajgribA1nx$ZUvvENPs0hqQc=($_4bmuYrc=t-^hH|b>|9ik^h-Xys>oGP8R@~+Mw z(GLi9qQ~-!U8j%sdU%gs)M)aXZZA|_r`jdfCxMmf>778hL-=4CZpRy=(e z=;Hbu*PEX1!@MtvYYEaB%@;?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bQ)u?%XUx+qXjq??`&P-LEg{PMy(z X=y*(^%1Nv800000NkvXXu0mjfUW%&! literal 0 HcmV?d00001 diff --git a/resources/resources_autogenerated.qrc b/resources/resources_autogenerated.qrc index 575639ebd..0e8c02ebf 100644 --- a/resources/resources_autogenerated.qrc +++ b/resources/resources_autogenerated.qrc @@ -29,6 +29,8 @@ buttons/unvip.png buttons/update.png buttons/updateError.png + buttons/viewersDark.png + buttons/viewersLight.png buttons/vip.png chatterino.icns com.chatterino.chatterino.appdata.xml diff --git a/src/autogenerated/ResourcesAutogen.cpp b/src/autogenerated/ResourcesAutogen.cpp index 0e6cecc71..2b31dc7e0 100644 --- a/src/autogenerated/ResourcesAutogen.cpp +++ b/src/autogenerated/ResourcesAutogen.cpp @@ -28,6 +28,8 @@ Resources2::Resources2() this->buttons.unvip = QPixmap(":/buttons/unvip.png"); this->buttons.update = QPixmap(":/buttons/update.png"); this->buttons.updateError = QPixmap(":/buttons/updateError.png"); + this->buttons.viewersDark = QPixmap(":/buttons/viewersDark.png"); + this->buttons.viewersLight = QPixmap(":/buttons/viewersLight.png"); this->buttons.vip = QPixmap(":/buttons/vip.png"); this->error = QPixmap(":/error.png"); this->icon = QPixmap(":/icon.png"); diff --git a/src/autogenerated/ResourcesAutogen.hpp b/src/autogenerated/ResourcesAutogen.hpp index f108be954..87fc932e3 100644 --- a/src/autogenerated/ResourcesAutogen.hpp +++ b/src/autogenerated/ResourcesAutogen.hpp @@ -35,6 +35,8 @@ public: QPixmap unvip; QPixmap update; QPixmap updateError; + QPixmap viewersDark; + QPixmap viewersLight; QPixmap vip; } buttons; QPixmap error; diff --git a/src/widgets/splits/Split.cpp b/src/widgets/splits/Split.cpp index e90c3eab5..3d5fa9305 100644 --- a/src/widgets/splits/Split.cpp +++ b/src/widgets/splits/Split.cpp @@ -314,6 +314,15 @@ void Split::setChannel(IndirectChannel newChannel) this->header_->updateChannelText(); this->header_->updateRoomModes(); + if (newChannel.getType() == Channel::Type::Twitch) + { + this->header_->setViewersButtonVisible(true); + } + else + { + this->header_->setViewersButtonVisible(false); + } + this->channelChanged.invoke(); // Queue up save because: Split channel changed diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index 6176bd817..baf9b6e29 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -228,6 +228,11 @@ void SplitHeader::initializeLayout() } }); }), + // viewer list + this->viewersButton_ = makeWidget