From 62f73f51f78e01bf36b0824850a659b390d06cbf Mon Sep 17 00:00:00 2001 From: RadRussianRus Date: Mon, 5 Sep 2022 15:31:25 +0300 Subject: [PATCH] [Option][GUI] Folder options --- Telegram/Resources/icons/menu/hide.png | Bin 0 -> 2278 bytes Telegram/Resources/icons/menu/hide@2x.png | Bin 0 -> 2818 bytes Telegram/Resources/icons/menu/hide@3x.png | Bin 0 -> 3023 bytes Telegram/Resources/langs/rewrites/en.json | 9 ++ .../SourceFiles/kotato/kotato_settings.cpp | 12 +++ .../kotato/kotato_settings_menu.cpp | 19 +++++ Telegram/SourceFiles/ui/menu_icons.style | 1 + Telegram/SourceFiles/window/window.style | 3 +- .../window/window_filters_menu.cpp | 79 ++++++++++++++---- .../SourceFiles/window/window_filters_menu.h | 1 + .../window/window_session_controller.cpp | 6 +- 11 files changed, 112 insertions(+), 18 deletions(-) create mode 100644 Telegram/Resources/icons/menu/hide.png create mode 100644 Telegram/Resources/icons/menu/hide@2x.png create mode 100644 Telegram/Resources/icons/menu/hide@3x.png diff --git a/Telegram/Resources/icons/menu/hide.png b/Telegram/Resources/icons/menu/hide.png new file mode 100644 index 0000000000000000000000000000000000000000..1cdc079bef68f8e494fe3cea3c85d71d7b6125eb GIT binary patch literal 2278 zcmb_ee^3-<7(N_j6r~(Vhv*NM#mvmT-Mzg%ZdVV5JLn*f2yYaf()M=uVD)bI+FgzV zvKa-$qDGry&{EUTF<{dC(I}%v=_oo#Na zdEfVW-}m{xZ{N<&dNDdGE=s4u(*+gk|;fHB8(I@A2MLL8O6*fP9V66He$5F0EK=qh$eGxI>(kC ziUpo5aK5VgXcR3hEYuegdP&Yhaf+f)%zzpU2tXi8k*G2OL{t(-JlJ@Jl?9(FNFt

`8#0Ht*}!ZF6>;`N3@C~BG?q!B8}xM;;$1e6Z2pwTuIt0 zc_bMG2JDC+3x|Ww5EYdXSw6#NfkE1OLEvbTHxovaiACI`i$ZY1h#_XPi9%dP!o(Te zCU+9=9J4{82zbVYKjg^bLnT97($SQ8A)=1`kM*DjSyza?Pgg6Z=$G??8mYX>5-)IupS?i zeW*BWJ|pJwU(l4pc&4dz#jJK)#;we!=guiT-&x$4wPSxtPuy31L)UKjuXiu(?pgQU(Du_e z?l%oyygk@EKu0_4+m_Y0-SEXui_}*SRb}sMO~^QuJO5K-b@Ps_=YA*8b{)Lj%U`Z* zTl4j|-TlADZ*Hn?<`1_|t2n)WF;tcLUV2SaS47!BvDX;4;>fNAYhJssDZS=1dIOYP zH@7PD4^v!p=gg={6Q77Iz4zwM^Bm@=xp-@^q;qS_&q?!o)VO)eYn{jRdu|R6ZEi~3 zQ+XzJ_Kbu>Hn`!c*xkP^Ibz!qf8+HhD@vX7)^)I0Y}t{kVi%INFJ?>2CJ<%V~2%2O})`PU`K|FEI1w*Ta+0|468b+YlyF{{2~%H*2ako=(8#d@!Z;xP9utR{QMK-P0=@z9~6(yuPh&<>zNz z2RVaa*tWIcV8ya}@0Tkty)^Y&Ymb^+S-fiXq$`mhx44gXFq`Ct?LQ@6>0TW;v3T$0 e-oM_j{&UK%4rB8(cPLi-63Ix*vh7cOeZ$`y`XzG! literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/menu/hide@2x.png b/Telegram/Resources/icons/menu/hide@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..c5dc78095b2b2b5e77127d4f2b72bb78821c7357 GIT binary patch literal 2818 zcmb_e4^R_V8V_hoi=tNabgn9KwF9D?-TWoHl3+qWI1K`3M(7-lo83*akYr;vfrJ*$ zaw<^dM8O-PAW}rsc7V!Ixhh<*C{j-mk%C3kYfsOfPWfZKVUAk47yeamwC8kgXLk4P zd%yR6zwi5g@4d~Bk6Rz$|7(99j~5Udqe%pB)O)|?3!c}vSv$e&bz4j_$K%Zk^xi(a zgJp|(yjLq3U6Lb7yAdZ@i-4e5JuPrqYyi#Ug-5t-1er!V_cKMrxE zDIk^CAwNkQ&yQs7G+!!^!K6?k<%eMcp-e2nur+)UDwHFr91)6Pp$wOxxJbmGy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U_B8qA ze=k|PcEg3aW?lHJ?#xV(rNqG*GiHdI>s{&_N`>M)_}7woVp`62ww}mnN;8>0`=I0d zrrg}zfvfXMJ)XwXr@0H|4Gj$)9UYGzIfi3P{<=9i+4EjS1H&+jgI#;yd^lTeC^B|} z!S(BNm7_=HmxaBxb#(<1b3hKvX7iqNfj)=3+E;declYjF2jT@T`)EV>aN@Fn)vH#$ zu8tZruj|Ns=beH(fg4nN0tA~ritW07B%EpNyZ!Lq=Im_c)`Hma{dEyuP}T7 literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/menu/hide@3x.png b/Telegram/Resources/icons/menu/hide@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..e32ae8b2909a41758375a5dd951794a38e945393 GIT binary patch literal 3023 zcmbVO2~-nz9*!0eP(VQr0X0Sr5ke*j3CUD)&+Z9C=k0;Rm2awf$w(HxxH<_8t_y4}%@%?|9 zz2O`FU}5fPP9P90c){FAa1J&crnABKt$i-@!O2V=ycs7D=GqvJS%ku32Li#kOD@=? z-NX-t5lrbV6k{UPJ6Wj)XaZriU$R<=B%oTN2$jlJ9MY4&H;{;OF^3ex;6r?MAS#mw zr)toRsT%}HY68L*ll;~YS0}@OK#6LF#AKyHg~Q1l(j+eot_?p^NW@8qHi1L(HwY3p z@xzIMmyqRQ#>cb%Vvc0KHx(}P}MWjJg76oEasB|)w3Hv}WjYgdQkbs&-EP*4r z>!!899fu^-YSl1>l9ZI>okaJ>G*Swc&1O>|8iht90|XgQQE7$AWEH;rEdv+D5sh4} zm18QRfl(;JbXpDxL^_p%QawYf!l%mw3Pwp5swq@&$dJ+`P>jsr)H;n~Qe2EsPz9<) zRazWisWVu$4AWw`4Eqi0naA%5fYS2$Ga4U^MX8*Tz_me%AdTsQd=QNbQq(9V62&o{ z20?=oL72-8*{I<_4Jy=P8UcnW-Zm=yZOFvHKtp5L#1%1el^9FHJ>FS^a)nxyL!v>T z+z^!vu>}wfrmGC=7Jm`Z&Q3S1)=YK8w3EJk1n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#0I-*H7obC|~~l9gIoU0s>qwoq7j3LZ|^+Y zxjh$8niZr#QDa>?jxVRFif_BnXx;7YUqHT_GJ%V~aekmKG8SCjp>n9Gs5s9#XHy+g zjs&zmA05rx>GJ6AT|#ERUrp})-COi&#lX}@w@RFE_Vhe!vQVqlcb_~7)9Evu6uM;$82mY}b@J2EpR$P~Kw;-a2)> DefinitionMap { .type = SettingType::IntSetting, .defaultValue = 0, .limitHandler = IntLimit(0, 5), }}, + { "folders/count_unmuted_only", { + .type = SettingType::BoolSetting, + .defaultValue = false, }}, + { "folders/hide_edit_button", { + .type = SettingType::BoolSetting, + .defaultValue = false, }}, + { "folders/hide_names", { + .type = SettingType::BoolSetting, + .defaultValue = false, }}, + { "folders/hide_all_chats", { + .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 e2cf0bfa0..a8c8245f3 100644 --- a/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp +++ b/Telegram/SourceFiles/kotato/kotato_settings_menu.cpp @@ -107,6 +107,21 @@ QString ChatIdLabel(int option) { ::Kotato::JsonSettings::Write(); \ }, container->lifetime()); +#define SettingsMenuJsonFilterSwitch(LangKey, Option) container->add(object_ptr