From 393bb7d455984f12f4f9e31d15d1fb1f47134d52 Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Fri, 26 Aug 2022 21:49:24 +0300 Subject: [PATCH] [Option][GUI] Always show scheduled --- .../icons/send_control_scheduled_no_dot.png | Bin 0 -> 1694 bytes .../send_control_scheduled_no_dot@2x.png | Bin 0 -> 1826 bytes .../send_control_scheduled_no_dot@3x.png | Bin 0 -> 1976 bytes Telegram/Resources/langs/rewrites/en.json | 1 + .../chat_helpers/chat_helpers.style | 5 +++ .../SourceFiles/history/history_widget.cpp | 38 ++++++++++++------ .../SourceFiles/kotato/kotato_settings.cpp | 3 ++ .../kotato/kotato_settings_menu.cpp | 2 + 8 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 Telegram/Resources/icons/send_control_scheduled_no_dot.png create mode 100644 Telegram/Resources/icons/send_control_scheduled_no_dot@2x.png create mode 100644 Telegram/Resources/icons/send_control_scheduled_no_dot@3x.png diff --git a/Telegram/Resources/icons/send_control_scheduled_no_dot.png b/Telegram/Resources/icons/send_control_scheduled_no_dot.png new file mode 100644 index 0000000000000000000000000000000000000000..ed21b6e955d3adf1b4bbdb90b8e2d293a2ac8fec GIT binary patch literal 1694 zcmbVNPl()99FAgjUFku*NDn1VFT2!CUj9zIcu)}bV)dY)9tu^^qToT=qoDR6)x#>N6yKZ4#9i6e#bGjeNxt`e z-|tU;^UA{fiT%?DrUgOR->BCX+4&$prtW0F7Z;r^cDgsNpH2ngz6bbmhw#RQ2L)l@ zH$iJDTWUTIF%3(|qis?egfT-4!qMY{7~y4-iEYveB3HWc@u!j)c&>EHY=UN7CEcLD zmXMQc^DVr#j2%xpeoQ<%fQ%p{84?F!FG}ISl}5aft@&+55=W41*_A3>P+V#*h*g>p z(JWaqRt-}uJ0;c94aa#%)PQO$z*baURxM}%sA*#Uk(gTI`EarJXs*SsT&bI7F;tX( zzhCO>C7N^;)o~mJXo{xE3?Zk(C_@7|N)JyMY9z%;5N836M9zrXbR}~o=5!oF7#Fl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lx z+gK(aD^jlRFXj*?y+!dW>YlCpMd+f=EY96Z`ir@le-94d+WpF^S+TX${WAUdKiyZ8 zqvoKMMRD=%- zf;cthNrLb>Sm=28`Ot42jaSYbPHpE-&YZfKUw=HZ5B)qnpLufO^u+Z`*QC(}>hkHQ z^e6Vr($jqxOD|5CigNc)rJkaW?aQe^1Lee=JxOpS|g zZ3-FP@#gud@#~G_k==(rIkfT77Vv9f+qw(iy?M24ViyMhHfMfoC>lgt}+-r^< S+Y5{a&q^4`v;5Bv>+7FQ4e literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/send_control_scheduled_no_dot@3x.png b/Telegram/Resources/icons/send_control_scheduled_no_dot@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..d0c17193a72e7c198d3200b988522d5bef3670a3 GIT binary patch literal 1976 zcmbVNeQeZZ9PU^MI0i(RFmRBjOAMmD_S)X<+Hf$un{0_U<~V^FoxIn+y{p`{rR{dN z$(#a8CK(a_kPIdgNcfm$5k+T)I#@&um;eqz1;etT8G#AJ@R6X4Z|`m=(}Be1dVN2h z_xU})kN(!2s#om9icI7-hzY<#Ffy(LolqUUgGM(E&^91FR{!OpaZ%O zMwHTe11_mA4~q3GMP4En%*W>?1Vj*n7Qhp+sA>ucFOlRG(AZw42s{a~R(gqrwn2P( zpaS=42E<(sHz_(f7hc3WoNkum`6qFPc6unH1o5y+Y$$wH<7>9j30 z^AZuu(gli&$K#GT>(Goa<>Yyuq8W-|NQ5BGI@JORQZ);Q8T`-`4Mn#UO~q|S5YlQa zFM*V%T!`rzTGdR42?dNw0G)C=XxpVEP!cmZy~c1_BuyqiTu8GA2x`q!zi64#=ozGgzlXsuG%7jUmF4S|qd3_C^oT!Rn$+*vFCx*x8EK^iTi<^(%bq4x@1-*p5Ptxe;4$_R^;sx6I1kDOGoq`55 zNs;SDLRmUUI|Uab(A)?psu~Gc;6K5VD9D--1ITA32Evfi)i8l)A}RQ^sAeF;NFAG0 z5eNuns%ZgLgk^p&f!uZ|iX^zWB2a`b(nE)2l94%?^vJwOLdc=2q=C%J-0*q7Cf3-= zwa=&OT+&3u@wZixr9C2pj)%~3vdGD?B+q$5q(_oPR)ijpEHT4uiwy<6Y9M+ytF1~x zjBXfWJZ_05Js}85jzeUj5F?U6W&kURZiZz!yP%UbB9tm7%3fXi6YrIl?%mawhT*8$*~3hiMUzaQhAN^q zP#4}#v`)aVtmZQR!eHX3!EJ||-k|eJ8nc#O+dui%v=xPGUi@L*O+dL3^Pl?`BuQCiZ&ExuGqEePgaP z&X_e&d^G!FUG>=;bZ)=LalCKJPGfG{cR4%qCvUj@YFEPr?cA@qJMwdOm7e%)Z`;e; z!{OYL$`4OFw(kD%*3T{e!+F%DPWo~mw>i=rF=w7H>^S(?5q@X?+z%QG7M-mrc~+`= z$2if}`c~V4G3)l_x#|~Byz>ngfK~I)_2(5kyQ`;m+-dt_{pG$@)AwxBo9F0XZSK65 zxN)Fj@P+Y@e7#}Mp@%PD${F~+=gcR&eBkp$PQm`_#JI()YlrGSdb8v9vY}UQ9$Pn1 zJWe?I`o{4`uB@G8?Z}=rkk~S5CW)3(v*hl-hesQG_njX*yRy2sWpM0l@KSHnmy@## zrsrS14sIV`f9lXSS9kB;#*OsS)jbU}gmKAFDTb~618a{LvG4BgXYG};l5&6hQ!Cc| E1 channel) { return _peer == channel.get(); @@ -2746,19 +2756,23 @@ void HistoryWidget::setupScheduledToggle() { } void HistoryWidget::refreshScheduledToggle() { - const auto has = _history - && _canSendMessages - && (session().data().scheduledMessages().count(_history) > 0); - if (!_scheduled && has) { - _scheduled.create(this, st::historyScheduledToggle); - _scheduled->show(); - _scheduled->addClickHandler([=] { - controller()->showSection( - std::make_shared(_history)); - }); - orderWidgets(); // Raise drag areas to the top. - } else if (_scheduled && !has) { + const auto canWrite = _history && _canSendMessages; + const auto has = canWrite && (session().data().scheduledMessages().count(_history) > 0); + if (_scheduled && !canWrite) { _scheduled.destroy(); + } else if (canWrite) { + if (_scheduled) { + _scheduled.destroy(); + } + if (::Kotato::JsonSettings::GetBool("always_show_scheduled") || has){ + _scheduled.create(this, (has ? st::historyScheduledToggle : st::historyScheduledToggleEmpty)); + _scheduled->show(); + _scheduled->addClickHandler([=] { + controller()->showSection( + std::make_shared(_history)); + }); + orderWidgets(); // Raise drag areas to the top. + } } } diff --git a/Telegram/SourceFiles/kotato/kotato_settings.cpp b/Telegram/SourceFiles/kotato/kotato_settings.cpp index 022ca0592..f3e16ccde 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings.cpp @@ -259,6 +259,9 @@ const std::map> DefinitionMap { { "monospace_large_bubbles", { .type = SettingType::BoolSetting, .defaultValue = false, }}, + { "always_show_scheduled", { + .type = SettingType::BoolSetting, + .defaultValue = false, }}, }; using OldOptionKey = QString; diff --git a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp index 8e21641e4..02b339e8e 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp @@ -71,6 +71,8 @@ void SetupKotatoChats( Ui::AddSkip(container); Ui::AddSubsectionTitle(container, rktr("ktg_settings_chats")); + SettingsMenuJsonSwitch(ktg_settings_always_show_scheduled, always_show_scheduled); + container->add(object_ptr