From be38800a70b1642671f397ef6f218c918c2f59d4 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 21 Oct 2023 23:55:17 +0300 Subject: [PATCH] Moved entry point for boosts statistic to channel context menu. --- Telegram/Resources/icons/menu/boosts.png | Bin 0 -> 589 bytes Telegram/Resources/icons/menu/boosts@2x.png | Bin 0 -> 1126 bytes Telegram/Resources/icons/menu/boosts@3x.png | Bin 0 -> 1703 bytes .../statistics/info_statistics_inner_widget.cpp | 15 --------------- Telegram/SourceFiles/ui/menu_icons.style | 1 + Telegram/SourceFiles/window/window_peer_menu.cpp | 8 ++++++++ 6 files changed, 9 insertions(+), 15 deletions(-) create mode 100644 Telegram/Resources/icons/menu/boosts.png create mode 100644 Telegram/Resources/icons/menu/boosts@2x.png create mode 100644 Telegram/Resources/icons/menu/boosts@3x.png diff --git a/Telegram/Resources/icons/menu/boosts.png b/Telegram/Resources/icons/menu/boosts.png new file mode 100644 index 0000000000000000000000000000000000000000..64a5ae3b9a31515c270f9a882903fcb35241ca74 GIT binary patch literal 589 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1SIoCSFHz9jKx9jP7LeL$-D$|Tv8)E(|mmy zw18|52FCVG1{RPKAeI7R1_tH@j10^`nh_+nfC(-uv49!D1}S`GTDlgfY`dq6V~B;| z-N}1TI|j-e-)nP8H&Er}GHZ_JloZ9oz8j5p+})M3Wy47owWt0El9arD^855m>2RHS z;496g(WcE;YS4TxK=*T-Dyb~%Ai>Wx|}mM2uYGQ>)*Ux2+iHS);8vR!xI z6ry(dRJzf1= J);T3K0RRyM`mq22 literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/menu/boosts@2x.png b/Telegram/Resources/icons/menu/boosts@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..0478fa66047ac730819776863982601fee7e0a85 GIT binary patch literal 1126 zcmV-s1eyDZP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91FrWhf1ONa40RR91FaQ7m0NXcg3;+NF&`Cr=R9Fe^SW76hQ5YVVlzU1I z21zW~pfM@3urMidSy)&}?8t2~HJX}il|~}jAklA{4JDDwMoLm{3n^K+N4dn1yQlxH z)7N(!Grlwb;-9ma&UtUo>wNEd&vWQ>ff3k&zz%rWf#BfagoK39&`=L{eozMm1$B0I zK0iNyeSKYBT{Si~`Te8e|~+if%&nbFAB*I?metkOC>lU+ZEZzGMM+_%r>CJ^T3V8-w3p=P=i@*D@AUN4U@*u6 z?Cjh54pLyvZ3(>UtV5d)7I7|YoM7hCMITYZx2Xl%H`$d zN^vtXGGK$Twzl@?@96FAHJMCG_CCr%Cl(eK2&tu|MI}mUX(^cre{tgK>+4m#yjBel z4--INU!S^jY;5e*)D*5*Hg0Zi;ET%BtP3Iq4;tWOpd6-l*TOK`An zZ*P&%=H_N(WTe;rI$d{nH~l>*FCW~+F1XAoTuDiZSoecAd*H&7eGS&t)zSW~uC9iKg=vf}8*XG|1duyB zJ5p^yK>}-*i*AfLwj~=VlD#SoT zC&CXdP*zqZRPmjsr>9ei;Bm;1aKYi4BRQV1Ozw{fo;w7bmX^lwh(tp^G&ID7ewuW3 zbpaSR2EH9ZHZ(L)iXhRl=ZKilBCReRp;`aSz40ykfLCA#{`(#H26?iXtLol(-T(jq07*qoM6N<$f)EGpga7~l literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/menu/boosts@3x.png b/Telegram/Resources/icons/menu/boosts@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..33590248c93a6017310a355cddc9df9bcde5006b GIT binary patch literal 1703 zcmV;Y23YxtP)Px#L}ge>W=%~1DgXcg2mk?xX#fNO00031000^Q000001E2u_0{{R30RRC20H6W@ z1ONa40RR91NT34%1ONa40RR91NB{r;0FW_8?*IS>5lKWrRA>e5T74*9UmTy!+YHUi z7HuXHdD$qXM2PaTO(bDjV{6m?Afn|ZVnQLMFp;tqnen9 z@Avt2f4<%B^E}tZ^*r~f=lSP3=X*Zib3Wg5&pF@k`QCfwisq-80nH3(WXw$4uCA{7`udxjn<}Is=FkrwJm~A|`{(5M{rmT@urM(PP)T22US2ypJ10i{ z|NrODpO-IRs)Ua?gWB2It*@_htYWIafB(L9>y|jfD7hC?Q`4!bDY9yOeEij`S3NyF zB+1OoR5B$IhSSy6?eFg=8|LQbZr{F*ej&%RV&qj-RU(X}4CntyGYEXFg>={u<;ra9DY|@V( zKc?2`=xBD6q|3g(z6S>fM7^-EkV7{uEsa{;+}t>=60JHoI3TJZ-c3zST3T8ht~E6^ z1h{eI2B%euRdaLmnVA_PJvcas=t-7nZ*MPySy)(*ZIzq^Hoy|H3Kqgnxh$8KmKYcu znp}W{gjjD_bz~J*Bi5u`eujpI1goyDmWz>)u&Ahr=;GwS`JsrMySqCfQ&LhC!6YGn z@!|z>MFD3$53MIpo)Gxq!-qUb6*s~2!v7N2w{PF_6UxoaB{1S+ez3|~5hWp3BBF?) zPNnkk<3|RM>9}@HmA77nR1wi4t|hAw?;^TYh(2i;85vT z;ckK(iV%WyotN0|Nsw z$3*C?w<%&J!0F)Vmv%N_V)J3FxqgMDj0|Ns#K+ zrD6$(2abDoTuUaQFf=s8B;q+LYEwmCfbFap+ichannelStats(), descriptor.api->supergroupStats(), }; - if (_state.stats.channel) { - ::Settings::AddSkip(inner); - const auto button = ::Settings::AddButton( - inner, - tr::lng_boosts_title(), - st::boostsButton); - const auto controller = _controller; - button->setClickedCallback([=, peer = descriptor.peer] { - controller->showSection(Info::Boosts::Make(peer)); - }); - ::Settings::AddSkip(inner); - ::Settings::AddDivider(inner); - ::Settings::AddSkip(inner); - } fill(); finishLoading(); diff --git a/Telegram/SourceFiles/ui/menu_icons.style b/Telegram/SourceFiles/ui/menu_icons.style index 734651b521..1a840e0f48 100644 --- a/Telegram/SourceFiles/ui/menu_icons.style +++ b/Telegram/SourceFiles/ui/menu_icons.style @@ -52,6 +52,7 @@ menuIconClear: icon {{ "menu/clear", menuIconColor }}; menuIconManage: icon {{ "menu/manage", menuIconColor }}; menuIconDiscussion: icon {{ "menu/discussion", menuIconColor }}; menuIconStats: icon {{ "menu/stats", menuIconColor }}; +menuIconBoosts: icon {{ "menu/boosts", menuIconColor }}; menuIconCreatePoll: icon {{ "menu/create_poll", menuIconColor }}; menuIconQrCode: icon {{ "menu/qr_code", menuIconColor }}; menuIconExpand: icon {{ "menu/expand", menuIconColor }}; diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index 28afbfb4ce..13955e8dba 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -62,6 +62,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "support/support_helper.h" #include "info/info_controller.h" #include "info/info_memento.h" +#include "info/boosts/info_boosts_widget.h" #include "info/profile/info_profile_values.h" #include "info/statistics/info_statistics_widget.h" #include "info/stories/info_stories_widget.h" @@ -1006,6 +1007,13 @@ void Filler::addViewStatistics() { controller->showSection(Info::Statistics::Make(peer, {})); } }, &st::menuIconStats); + if (!channel->isMegagroup()) { + _addAction(tr::lng_boosts_title(tr::now), [=] { + if (const auto strong = weak.get()) { + controller->showSection(Info::Boosts::Make(peer)); + } + }, &st::menuIconBoosts); + } } } }