From 392f2e633c2a29998954ea8fa32703511338d8e4 Mon Sep 17 00:00:00 2001 From: AlexeyZavar Date: Thu, 12 Sep 2024 16:10:03 +0300 Subject: [PATCH] feat: message field configuration --- .../icons/ayu/message_field/attach.png | Bin 0 -> 452 bytes .../icons/ayu/message_field/attach@2x.png | Bin 0 -> 789 bytes .../icons/ayu/message_field/attach@3x.png | Bin 0 -> 1117 bytes .../icons/ayu/message_field/commands.png | Bin 0 -> 444 bytes .../icons/ayu/message_field/commands@2x.png | Bin 0 -> 760 bytes .../icons/ayu/message_field/commands@3x.png | Bin 0 -> 1101 bytes .../icons/ayu/message_field/emoji.png | Bin 0 -> 514 bytes .../icons/ayu/message_field/emoji@2x.png | Bin 0 -> 970 bytes .../icons/ayu/message_field/emoji@3x.png | Bin 0 -> 1431 bytes .../Resources/icons/ayu/message_field/ttl.png | Bin 0 -> 493 bytes .../icons/ayu/message_field/ttl@2x.png | Bin 0 -> 891 bytes .../icons/ayu/message_field/ttl@3x.png | Bin 0 -> 1270 bytes .../icons/ayu/message_field/voice.png | Bin 0 -> 499 bytes .../icons/ayu/message_field/voice@2x.png | Bin 0 -> 911 bytes .../icons/ayu/message_field/voice@3x.png | Bin 0 -> 1334 bytes Telegram/Resources/langs/lang.strings | 12 +- Telegram/SourceFiles/ayu/ayu_settings.cpp | 53 +++++ Telegram/SourceFiles/ayu/ayu_settings.h | 28 +++ Telegram/SourceFiles/ayu/ui/ayu_icons.style | 6 + .../ayu/ui/settings/settings_ayu.cpp | 187 ++++++++++++++++-- .../SourceFiles/chat_helpers/tabbed_panel.cpp | 6 +- .../SourceFiles/history/history_widget.cpp | 86 +++++--- .../settings/settings_experimental.cpp | 4 +- 23 files changed, 342 insertions(+), 40 deletions(-) create mode 100644 Telegram/Resources/icons/ayu/message_field/attach.png create mode 100644 Telegram/Resources/icons/ayu/message_field/attach@2x.png create mode 100644 Telegram/Resources/icons/ayu/message_field/attach@3x.png create mode 100644 Telegram/Resources/icons/ayu/message_field/commands.png create mode 100644 Telegram/Resources/icons/ayu/message_field/commands@2x.png create mode 100644 Telegram/Resources/icons/ayu/message_field/commands@3x.png create mode 100644 Telegram/Resources/icons/ayu/message_field/emoji.png create mode 100644 Telegram/Resources/icons/ayu/message_field/emoji@2x.png create mode 100644 Telegram/Resources/icons/ayu/message_field/emoji@3x.png create mode 100644 Telegram/Resources/icons/ayu/message_field/ttl.png create mode 100644 Telegram/Resources/icons/ayu/message_field/ttl@2x.png create mode 100644 Telegram/Resources/icons/ayu/message_field/ttl@3x.png create mode 100644 Telegram/Resources/icons/ayu/message_field/voice.png create mode 100644 Telegram/Resources/icons/ayu/message_field/voice@2x.png create mode 100644 Telegram/Resources/icons/ayu/message_field/voice@3x.png diff --git a/Telegram/Resources/icons/ayu/message_field/attach.png b/Telegram/Resources/icons/ayu/message_field/attach.png new file mode 100644 index 0000000000000000000000000000000000000000..d803dc06fdb8121fd33ea16967042b1d0fc09b24 GIT binary patch literal 452 zcmV;#0XzPQP)rfF!JCSvA&VhvjuhHv+>YerGT^E`9cb(|y#3o>Pg4gX9Z``L3Q7%s(2hne}bYYF5oyJYyiR(8mM&PcU@QY{gwdW za5jOLWvOh#FdV)?3XOEE-?QQZoa(x!IF4yqmfeOb5u5jl>HA*!ZresaoqwG+n^uLA=Y0jza!TnRV8uLPpWY~^N5)olWqCTJm31;Dm#{{zm( u2S;8Lf_M<_>#29(1`}az7jnbUK|V#7u0@ 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 TBLXq(00000NkvXXu0mjfDCPh% literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/ayu/message_field/emoji.png b/Telegram/Resources/icons/ayu/message_field/emoji.png new file mode 100644 index 0000000000000000000000000000000000000000..4bc32775adbadff9fcb7da68e6286ba9e95f4437 GIT binary patch literal 514 zcmV+d0{#7oP)Tgv-~~5?RKLiNvN)CQcAHFMZvbm<3Vdgx%7NKt31zHecxB7(`h)nTrTSM zdMQoH3g0;#CjkHu2;hZ4)*uMj7cr{{aGMVSvlp7lWNcV_b5|yKor?szXiQ+=E)2s- zU=&4@EJ2`~VxB;EhI&4qlOTu$0|>;vF){~+w2j(SgHTmf@K1$5N}HdiCq7#@jTgfq|c=r>|xe9Ob8X-E$gwQbA)(=_F0S(a?W`SEyUg`aLq zK7YU8{KPAU?}U^@kF zYGKy-=5;L8paVLf13Ewjr~nn90y@ac$(xhe?6-eO)|WBk%VI+|s{|lG5`@_X z1eV(Ent%|wbZuf@*NYHfwpbZYDa`dq3Gt@Gnp{tLuw<}{C3CN{{dX&m(J_Jn1 zB=>NX@#Z6p*Cjd)py6-{h5UfwBCE49>n4u^(frU>PRoslEcARn*Pip3uiiuuIt>RY zr{#svWT?;Bc#xz|)|Pu;0EA8JR&Ho8(AH7AI!$dhn@pI+Vqx`H5X2lp*Z0bn^}O(M zPRRV-)YLeS!I1P2R@d@%M+{>v zqyhLA7pUeIHb43ZvX%Q07*qoM6N<$f|K006951J literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/ayu/message_field/emoji@3x.png b/Telegram/Resources/icons/ayu/message_field/emoji@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..37e5854114a594e5c7ea89982daacd6a6ec7cec5 GIT binary patch literal 1431 zcmV;I1!($-P)*Fy)oc~$SDDhflM=cfVX9?lyS^~h9uT$c!D|GB(DgFo zqv{J&?XhkUq28zu-y~;Rq7IC~^YgRWbaO4LLJ(pwx!S}1CF{b@7hLOl!nMd4Ptp~{ zmk+RbsOVe_7FFklA!j|IT4eOFbp`1cu!jEEWXG802M*hoUW~{xm5*qIJGWr#klvE=woyNj0P!xyf)MnF_T}{S z)LmU&_4bQ;&lV3~Gty;p5WVHiK97SFN0T_03T@@dvL-(wjUwQ+fQ zSz~(Xwi*GRn1yBXab|aMaS<(tGQLBi`GuxoS0A*FyAu$ES~Qk(YilcMy8S-T`2~9Z zj4~)|ftpRr8B?DYVbf~)iYVJ>*`)Y($!Uy?A@n80`lNkir)9L?!bq&sKrQ zcKR#_PjbL>Nn#b&LEc{985{S>GQ%YHj?z;G>5L16@VrIq;UU`hUh zOb{d|-7S{Bt0hKb`6{FZ7FGV0#0f3Y#GElj;M`&0v5b8D7Gl^MV(`vbLTTyv+yD(k z(}1mW9s|UQN$gsJhV03v0S6f&p*u=yDuI2#_YBwJ*j0oYmrYW)i17cy1-ULkkXY7x zAPQ<<>L{kJS81%Jy|Pssy!e5sgkz z5SZ$ru4I9yAmXkqogOdTK!tPCO7R3i9;ydaJHav&VS{w-M6ggPRB%@=d|CeEQ`dpRH6QBQBF&@ah9ru%w{ zf$Z|At-9W!JU4&s`@c-*%u`!S|Aw;{_GpD&-)i7nyr#i%XIJm$it-PsvwkzQUE5G} z!#-TFBh<6@(xDGJC9&pbQ+Io8YiLVU;B<2h^x3F$+T(iZs#RG%_VdrH-ub0_$Z5g` z&zX~6?|PgutL>4+yd)2oFjx0&lN96ErFwfT)Q~aQ{`!h!!h<45T^~2=Ah-JqcX?|u z8SwGG7cg68!WXdSVY%nmIXOZGobQ-;)&`{Zd;Q$q>TKOu=1BCpEP)K~#7F?OE-S z0YMP$ySo2mKn7$$24sK;$N&+L0U00yG9Uv)fC%>HP1W0KdyARfSx%L%+S;qR`RLdE z`pwMx5|K#W*uLe>?E~P|_5tu}3l5;&Zp(hZmne#4Hk(PcT9u+L3iTLgqof%ywmsxJ zi6`7-CgRp{pA0K!(oviii!Rc zK@=PPCx9qE`e`5n7IwY~s5EfQb&)CIcVaIN_Tko+!0BD`h z!e=K4`3>vbL~ z`3)G2MseY~^hZ=l6Br_Xk4gYr7yzyLwOY+N`lQG`{pbFGY!n6{OW_g#9Mk%rj$gzn$sI|2G^ip~JC$|k8nrx0CQGSZrE!2wWte9tdbm{zOxC(>zr zCygqVN;m+F%p>JNKSWwnj1K8G&G)40Fw?HPyVIrKD2{zEm&==dj68~os2G{GZ{wsG z=j?m8+sWZ@i2I(;XE8T5`?tx=)jaIy`Z2%>04LKt)v6_-D0DBah&0+an~jXeW7`*R z8mMwBbI2B~R4T=7rg*Q`d}Kc^otRcoMLWkfSg+TM+dvtk_j0*hEdPBBH3K6!7kii{ zq?r1w(@jms=HxO@@}WtJ>^2$=*LmC)I>9&0cxr zCCc-F&yZG^W468v&_KPMUpDdq@O|`Mz*B8fpD&_#SNr@*`D*(Bc(uJffL|&k!s2B# RdAk4r002ovPDHLkV1minoPz)W literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/ayu/message_field/ttl@3x.png b/Telegram/Resources/icons/ayu/message_field/ttl@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..2d40692c6a109ef04d2721d67a4e27b5a3d25e9b GIT binary patch literal 1270 zcmV@W~CuL3%N4xj^|0_Xs!06KsUxDJ2{paY-+paSRsI>^f)IhxyZygqxK@bO5NtV_xyrTh5!a9!8Ax3@QU ze0=P_Bf2@t-Q8Um!qwH)EaQok={r3+Iq70}etzz@x3~W;LA^Q+WL#WaeEkN=Vc?x_ zLejJy?(gp}k-*PDmLzF+clU1*^ziU75O95cz4H9%=&0)r_wWwtGm|u3XHXf&m%K!I zO&9{y?Lbb>$33O(Oc*EC?O?H3EKO>2bF+wS4gpHro1Gx()-Ajc><A|sDhHW_Q_VPlU8`rp@a5xCbi=LPIOdYP7evxAHvIm9xz%^k#W~%pCxdSuc6=K#*-38|avHjP=b)b77XB z_s1L&4&CbD6N*%uCS7^x9VQ$3+~fqYDx}ySyu&t&;cW@GsgcfYg^V?a3x%mqIYC=n zThVtzM>aC}le>dj|C%xXQ3T0E)~l4f?&6WM6Ts>kQpec|f?j*XR7~3jk(qnyWLN@2 z?%v7iuAY@ATefs6*o3-`|}TSZYJ< za^EHWW)lQ;@S+QG<^g&15;N2-$pLyBGt^n#Q=g}z=py-Iu^8%XYeFcs0}{L-EX@GO z@r#3nd3t(sCCJuKJ~63A_5c6? literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/ayu/message_field/voice.png b/Telegram/Resources/icons/ayu/message_field/voice.png new file mode 100644 index 0000000000000000000000000000000000000000..bfe1eefe0d17d25bb1a74cea12f7d6a5b72e1ae0 GIT binary patch literal 499 zcmV+U;;+S`9(5H`3STU(pj<;?8MK0j)Ox) ziY}BNx>)`PfbaWM6b1EtPi@=kwd=ZcR+LSXBvBk#MNy<4kB8#GDhxwygYW3P6+i+# zpU;&KHu!=d_#OZOJkQ(pGj)n7vjXh);C{brbsUE{+czKhM_**k)R9d#kwF2Zu4~P| z*cnvYM5k%ey`i%dp=^_5I%p#H2!Nb5^>R7 z++@1lZZiM^zFx1lz(=xMGWZ4OWa$(3V2%0Mx>2iJR8`eXL7wLn$MJ4v@L@j$x2fy8 z;|kCyRDsN)GO^~c!Or0GKC;iuy7aOvRhDHl4gB_KDsU}91J(%q0g;uwH%p2zeDI-K+eIKc7$jtjAfUxm*lh2Vs3Rz6L~c}?re}{_|3^EV pWK+g*B!2%sIYJ*%^o?9j(I2<{$%zH(I+p+d002ovPDHLkV1kiM(6|5q literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/ayu/message_field/voice@2x.png b/Telegram/Resources/icons/ayu/message_field/voice@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..9529172e35309831abcfe4bc7b73a4c705ee404f GIT binary patch literal 911 zcmV;A191F_P)Bbbi$-Y5dhX0wFB`~9w$%cUNTM!MJQSuz&U>-E|`BNmIr?+^ft5Mcc0 z=O=S4G(VruV+#>Jc|0B`%s}HI^I*NV2mozfE*HzhbUO8(Pq%|x}NQ&lZMKznEr09fF7JZ6qFL7%i15+)8(@B1Lw z0#z~)32RibKw&p(^0lQ`!{@!Z5)$gg7D#)qiX8*+UsH^d|C7livt8b7HmO+%*{2FB z34q{}0odtuQU$;mq|rK1C;%7&1E$af70s0zTVAxeb-E1!7(Bs4>NZWZ&*;MK*SDCydQoN1j}`E)t;qasq(hCRv#Q zjM1Iw78nnUfpG0UPumDF<9Sy2as!Keo+l2HQ5Ucv#-ycQ855r8Mx_T@e`Vgz^Lc0& zS&A0Gb>7yK%wuggCZY=9`n>6HDxI=nE@J}B2e#DyFNT)rD){w1+kp!~>$E1;2+(}E z0Ms5+9+|*@1az8@;~t(Ne&i8jgtJmrWwLdtv_oAm386reVaa%vBN@X08&DH%69RL+T2T%eX02KfgKnKtPPytW@bO2NUQ~(_Wf04YJHF5li?d(cElC`hI zc8+Jp zS65eq(r|Ea;JsH9)n99aK5NXqI6*c!udlEDL&x@mYJGfs%t2DQ&b3rdQBO855b<0V96@pk%i4rS}UnG%Y z*JdL~N)PV~O?=6xy1u?HHBSCcrTB+z<*7|d5w@t%IC(on)GJJS(d0(3y}g~i|LmuE z>G|Rvmxesd;(6yr_R~Bka|6iIHfZVhr>7_N`1q(o!0|-(Hw2C(2KF%~7qW_^K5unn zKqW%9e0!G)0b}QWp6UTJ4y5K#I))nR8G@n#GgQe|CsZs1khr_MtMo27dfm~{QQu0T zC_zZU{r$a41)&hy7_f6C32HHE526XuAqJ)Gq0*kKS{D#pW6sPy7SRNqot^csY{BaS zGiUP}gJ>HR<7;3aZ09W|OJPE&N zg#ywl64SS8|J5)c3`@lZ(MUq3V_6IHwuIe&E0SYrHjD(67_~DZ6&HZ z$VN!X;QdgBVh*(O7Y`ai9yEeHXasrC2=ZWM2$H*)uW+*_X8qs11l6$Q*&!;lRJaDJ sd(!KMW`jIv1bNU1@}LpqK_ke6UjrS?T#{EG*#H0l07*qoM6N<$f;kXin*aa+ literal 0 HcmV?d00001 diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 69a77a4872..1ca622721d 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -5699,6 +5699,13 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ayu_SettingsContextMenuReactionsPanel" = "Reactions Panel"; "ayu_SettingsContextMenuViewsPanel" = "Views Panel"; "ayu_ContextMenuElementsHeader" = "Context Menu Elements"; +"ayu_MessageFieldElementsHeader" = "Message Field Elements"; +"ayu_MessageFieldPopupsHeader" = "Message Field Popups"; +"ayu_MessageFieldElementAttach" = "Attach"; +"ayu_MessageFieldElementCommands" = "Commands"; +"ayu_MessageFieldElementTTL" = "TTL"; +"ayu_MessageFieldElementEmoji" = "Emoji"; +"ayu_MessageFieldElementVoice" = "Voice"; "ayu_DrawerElementsHeader" = "Drawer Elements"; "ayu_TrayElementsHeader" = "Tray Elements"; "ayu_SettingsSpoofWebviewAsAndroid" = "Spoof Client as Android"; @@ -5741,8 +5748,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "ayu_RegexFiltersAdd" = "Add Filter"; "ayu_RegexFiltersEdit" = "Edit Filter"; "ayu_RegexFiltersPlaceholder" = "Expression"; -"ayu_EnableExpression" = "Enable expression"; -"ayu_CaseInsensitiveExpression" = "Case insensitive expression"; +"ayu_EnableExpression" = "Enable Filter"; +"ayu_CaseInsensitiveExpression" = "Case Insensitive"; +"ayu_ReversedExpression" = "Reversed"; "ayu_RegexFiltersAddError" = "Regex syntax error"; "ayu_RegexFilterQuickAdd" = "Add Filter"; "ayu_RegexFilterBulletinText" = "Filter added to the **Shared filters**."; diff --git a/Telegram/SourceFiles/ayu/ayu_settings.cpp b/Telegram/SourceFiles/ayu/ayu_settings.cpp index d5168cf3eb..ecf8bba0b5 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.cpp +++ b/Telegram/SourceFiles/ayu/ayu_settings.cpp @@ -42,6 +42,7 @@ rpl::variable editedMarkReactive; rpl::variable showPeerIdReactive; rpl::variable hideFromBlockedReactive; +rpl::event_stream<> historyUpdateReactive; rpl::lifetime lifetime = rpl::lifetime(); @@ -249,6 +250,15 @@ AyuGramSettings::AyuGramSettings() { showUserMessagesInContextMenu = 2; showMessageDetailsInContextMenu = 2; + showAttachButtonInMessageField = true; + showCommandsButtonInMessageField = true; + showEmojiButtonInMessageField = true; + showMicrophoneButtonInMessageField = true; + showAutoDeleteButtonInMessageField = true; + + showAttachPopup = true; + showEmojiPopup = true; + showLReadToggleInDrawer = false; showSReadToggleInDrawer = true; showGhostToggleInDrawer = true; @@ -431,6 +441,41 @@ void AyuGramSettings::set_showMessageDetailsInContextMenu(int val) { showMessageDetailsInContextMenu = val; } +void AyuGramSettings::set_showAttachButtonInMessageField(bool val) { + showAttachButtonInMessageField = val; + triggerHistoryUpdate(); +} + +void AyuGramSettings::set_showCommandsButtonInMessageField(bool val) { + showCommandsButtonInMessageField = val; + triggerHistoryUpdate(); +} + +void AyuGramSettings::set_showEmojiButtonInMessageField(bool val) { + showEmojiButtonInMessageField = val; + triggerHistoryUpdate(); +} + +void AyuGramSettings::set_showMicrophoneButtonInMessageField(bool val) { + showMicrophoneButtonInMessageField = val; + triggerHistoryUpdate(); +} + +void AyuGramSettings::set_showAutoDeleteButtonInMessageField(bool val) { + showAutoDeleteButtonInMessageField = val; + triggerHistoryUpdate(); +} + +void AyuGramSettings::set_showAttachPopup(bool val) { + showAttachPopup = val; + triggerHistoryUpdate(); +} + +void AyuGramSettings::set_showEmojiPopup(bool val) { + showEmojiPopup = val; + triggerHistoryUpdate(); +} + void AyuGramSettings::set_showLReadToggleInDrawer(bool val) { showLReadToggleInDrawer = val; } @@ -524,4 +569,12 @@ rpl::producer get_hideFromBlockedReactive() { return hideFromBlockedReactive.value(); } +void triggerHistoryUpdate() { + historyUpdateReactive.fire({}); +} + +rpl::producer<> get_historyUpdateReactive() { + return historyUpdateReactive.events(); +} + } diff --git a/Telegram/SourceFiles/ayu/ayu_settings.h b/Telegram/SourceFiles/ayu/ayu_settings.h index a68106ae08..abb6c79ca1 100644 --- a/Telegram/SourceFiles/ayu/ayu_settings.h +++ b/Telegram/SourceFiles/ayu/ayu_settings.h @@ -57,6 +57,15 @@ public: int showUserMessagesInContextMenu; int showMessageDetailsInContextMenu; + bool showAttachButtonInMessageField; + bool showCommandsButtonInMessageField; + bool showEmojiButtonInMessageField; + bool showMicrophoneButtonInMessageField; + bool showAutoDeleteButtonInMessageField; + + bool showAttachPopup; + bool showEmojiPopup; + bool showLReadToggleInDrawer; bool showSReadToggleInDrawer; bool showGhostToggleInDrawer; @@ -123,6 +132,15 @@ public: void set_showUserMessagesInContextMenu(int val); void set_showMessageDetailsInContextMenu(int val); + void set_showAttachButtonInMessageField(bool val); + void set_showCommandsButtonInMessageField(bool val); + void set_showEmojiButtonInMessageField(bool val); + void set_showMicrophoneButtonInMessageField(bool val); + void set_showAutoDeleteButtonInMessageField(bool val); + + void set_showAttachPopup(bool val); + void set_showEmojiPopup(bool val); + void set_showLReadToggleInDrawer(bool val); void set_showSReadToggleInDrawer(bool val); void set_showGhostToggleInDrawer(bool val); @@ -181,6 +199,13 @@ NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE_WITH_DEFAULT( showHideMessageInContextMenu, showUserMessagesInContextMenu, showMessageDetailsInContextMenu, + showAttachButtonInMessageField, + showCommandsButtonInMessageField, + showEmojiButtonInMessageField, + showMicrophoneButtonInMessageField, + showAutoDeleteButtonInMessageField, + showAttachPopup, + showEmojiPopup, showLReadToggleInDrawer, showSReadToggleInDrawer, showGhostToggleInDrawer, @@ -215,4 +240,7 @@ rpl::producer get_ghostModeEnabledReactive(); rpl::producer get_hideFromBlockedReactive(); +void triggerHistoryUpdate(); +rpl::producer<> get_historyUpdateReactive(); + } diff --git a/Telegram/SourceFiles/ayu/ui/ayu_icons.style b/Telegram/SourceFiles/ayu/ui/ayu_icons.style index fb98cb99da..4f4934b86f 100644 --- a/Telegram/SourceFiles/ayu/ui/ayu_icons.style +++ b/Telegram/SourceFiles/ayu/ui/ayu_icons.style @@ -19,6 +19,12 @@ ayuStreamerModeMenuIcon: icon {{ "ayu/streamer", menuIconColor }}; ayuMenuIconToBeginning: icon {{ "ayu/to_beginning", menuIconColor }}; +messageFieldAttachIcon: icon {{ "ayu/message_field/attach", menuIconColor }}; +messageFieldCommandsIcon: icon {{ "ayu/message_field/commands", menuIconColor }}; +messageFieldEmojiIcon: icon {{ "ayu/message_field/emoji", menuIconColor }}; +messageFieldVoiceIcon: icon {{ "ayu/message_field/voice", menuIconColor }}; +messageFieldTTLIcon: icon {{ "ayu/message_field/ttl", menuIconColor }}; + inChannelBadgeIcon: icon {{ "ayu/channel", msgInDateFg }}; inChannelBadgeSelectedIcon: icon {{ "ayu/channel", msgInDateFgSelected }}; outChannelBadgeIcon: icon {{ "ayu/channel", msgOutDateFg }}; diff --git a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp index c3860948e1..06edd51aee 100644 --- a/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp +++ b/Telegram/SourceFiles/ayu/ui/settings/settings_ayu.cpp @@ -5,6 +5,8 @@ // // Copyright @Radolyn, 2024 #include "settings_ayu.h" + + #include "ayu/ayu_settings.h" #include "ayu/ui/boxes/edit_deleted_mark.h" #include "ayu/ui/boxes/edit_edited_mark.h" @@ -17,6 +19,7 @@ #include "main/main_session.h" #include "settings/settings_common.h" #include "storage/localstorage.h" +#include "styles/style_chat_helpers.h" #include "styles/style_ayu_styles.h" #include "styles/style_basic.h" #include "styles/style_boxes.h" @@ -346,14 +349,14 @@ void AddCollapsibleToggle(not_null container, } void AddChooseButtonWithIconAndRightTextInner(not_null container, - not_null controller, - int initialState, - std::vector options, - rpl::producer text, - rpl::producer boxTitle, - const style::SettingsButton & st, - Settings::IconDescriptor && descriptor, - const Fn &setter) { + not_null controller, + int initialState, + std::vector options, + rpl::producer text, + rpl::producer boxTitle, + const style::SettingsButton &st, + Settings::IconDescriptor &&descriptor, + const Fn &setter) { auto reactiveVal = container->lifetime().make_state>(initialState); rpl::producer rightTextReactive = reactiveVal->value() | rpl::map( @@ -885,6 +888,166 @@ void SetupContextMenuElements(not_null container, AddDividerText(container, tr::ayu_SettingsContextMenuDescription()); } +void SetupMessageFieldElements(not_null container) { + auto settings = &AyuSettings::getInstance(); + + AddSkip(container); + AddSubsectionTitle(container, tr::ayu_MessageFieldElementsHeader()); + + AddButtonWithIcon( + container, + tr::ayu_MessageFieldElementAttach(), + st::settingsButton, + {&st::messageFieldAttachIcon} + )->toggleOn( + rpl::single(settings->showAttachButtonInMessageField) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (enabled != settings->showAttachButtonInMessageField); + }) | start_with_next( + [=](bool enabled) + { + settings->set_showAttachButtonInMessageField(enabled); + AyuSettings::save(); + }, + container->lifetime()); + + AddButtonWithIcon( + container, + tr::ayu_MessageFieldElementCommands(), + st::settingsButton, + {&st::messageFieldCommandsIcon} + )->toggleOn( + rpl::single(settings->showCommandsButtonInMessageField) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (enabled != settings->showCommandsButtonInMessageField); + }) | start_with_next( + [=](bool enabled) + { + settings->set_showCommandsButtonInMessageField(enabled); + AyuSettings::save(); + }, + container->lifetime()); + + AddButtonWithIcon( + container, + tr::ayu_MessageFieldElementTTL(), + st::settingsButton, + {&st::messageFieldTTLIcon} + )->toggleOn( + rpl::single(settings->showAutoDeleteButtonInMessageField) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (enabled != settings->showAutoDeleteButtonInMessageField); + }) | start_with_next( + [=](bool enabled) + { + settings->set_showAutoDeleteButtonInMessageField(enabled); + AyuSettings::save(); + }, + container->lifetime()); + + AddButtonWithIcon( + container, + tr::ayu_MessageFieldElementEmoji(), + st::settingsButton, + {&st::messageFieldEmojiIcon} + )->toggleOn( + rpl::single(settings->showEmojiButtonInMessageField) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (enabled != settings->showEmojiButtonInMessageField); + }) | start_with_next( + [=](bool enabled) + { + settings->set_showEmojiButtonInMessageField(enabled); + AyuSettings::save(); + }, + container->lifetime()); + + AddButtonWithIcon( + container, + tr::ayu_MessageFieldElementVoice(), + st::settingsButton, + {&st::messageFieldVoiceIcon} + )->toggleOn( + rpl::single(settings->showMicrophoneButtonInMessageField) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (enabled != settings->showMicrophoneButtonInMessageField); + }) | start_with_next( + [=](bool enabled) + { + settings->set_showMicrophoneButtonInMessageField(enabled); + AyuSettings::save(); + }, + container->lifetime()); + + AddSkip(container); + AddDivider(container); +} + +void SetupMessageFieldPopups(not_null container) { + auto settings = &AyuSettings::getInstance(); + + AddSkip(container); + AddSubsectionTitle(container, tr::ayu_MessageFieldPopupsHeader()); + + AddButtonWithIcon( + container, + tr::ayu_MessageFieldElementAttach(), + st::settingsButton, + {&st::messageFieldAttachIcon} + )->toggleOn( + rpl::single(settings->showAttachPopup) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (enabled != settings->showAttachPopup); + }) | start_with_next( + [=](bool enabled) + { + settings->set_showAttachPopup(enabled); + AyuSettings::save(); + }, + container->lifetime()); + + AddButtonWithIcon( + container, + tr::ayu_MessageFieldElementEmoji(), + st::settingsButton, + {&st::messageFieldEmojiIcon} + )->toggleOn( + rpl::single(settings->showEmojiPopup) + )->toggledValue( + ) | rpl::filter( + [=](bool enabled) + { + return (enabled != settings->showEmojiPopup); + }) | start_with_next( + [=](bool enabled) + { + settings->set_showEmojiPopup(enabled); + AyuSettings::save(); + }, + container->lifetime()); + + AddSkip(container); + AddDivider(container); +} + void SetupDrawerElements(not_null container) { auto settings = &AyuSettings::getInstance(); @@ -1250,9 +1413,9 @@ void SetupFolderSettings(not_null container, not_nulltoggleOn( rpl::single(settings->hideNotificationBadge) )->toggledValue( @@ -1440,6 +1603,8 @@ void SetupCustomization(not_null container, AddSkip(container); AddDivider(container); SetupContextMenuElements(container, controller); + SetupMessageFieldElements(container); + SetupMessageFieldPopups(container); SetupDrawerElements(container); AddSkip(container); AddDivider(container); diff --git a/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp b/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp index 7d399a5964..d1368a8afa 100644 --- a/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp +++ b/Telegram/SourceFiles/chat_helpers/tabbed_panel.cpp @@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "chat_helpers/tabbed_selector.h" #include "window/window_session_controller.h" #include "mainwindow.h" +#include "ayu/ayu_settings.h" #include "core/application.h" #include "base/options.h" #include "styles/style_chat_helpers.h" @@ -27,6 +28,7 @@ base::options::toggle TabbedPanelShowOnClick({ .id = kOptionTabbedPanelShowOnClick, .name = "Show tabbed panel by click", .description = "Show Emoji / Stickers / GIFs panel only after a click.", + .scope = static_cast(0), }); } // namespace @@ -464,7 +466,9 @@ void TabbedPanel::showStarted() { } bool TabbedPanel::eventFilter(QObject *obj, QEvent *e) { - if (TabbedPanelShowOnClick.value()) { + const auto settings = &AyuSettings::getInstance(); + + if (TabbedPanelShowOnClick.value() || !settings->showEmojiPopup) { return false; } else if (e->type() == QEvent::Enter) { otherEnter(); diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 5243b429df..5bab52a2d5 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -228,6 +228,13 @@ const auto kPsaAboutPrefix = "cloud_lng_about_psa_"; return QString(); } +#define SWITCH_BUTTON(button, show_v) \ + if (show_v) { \ + (button)->show(); \ + } else { \ + (button)->hide(); \ + } + } // namespace HistoryWidget::HistoryWidget( @@ -478,12 +485,13 @@ HistoryWidget::HistoryWidget( _fieldCharsCountManager.limitExceeds( ) | rpl::start_with_next([=] { + const auto settings = &AyuSettings::getInstance(); const auto hide = _fieldCharsCountManager.isLimitExceeded(); if (_silent) { _silent->setVisible(!hide); } if (_ttlInfo) { - _ttlInfo->setVisible(!hide); + _ttlInfo->setVisible(!hide && settings->showAutoDeleteButtonInMessageField); } if (_scheduled) { _scheduled->setVisible(!hide); @@ -807,6 +815,15 @@ HistoryWidget::HistoryWidget( } }, lifetime()); + AyuSettings::get_historyUpdateReactive() | rpl::start_with_next([=] + { + refreshAttachBotsMenu(); + updateHistoryGeometry(); + updateControlsVisibility(); + updateControlsGeometry(); + this->update(); + }, lifetime()); + using MessageUpdateFlag = Data::MessageUpdate::Flag; session().changes().messageUpdates( MessageUpdateFlag::Destroyed @@ -2640,8 +2657,10 @@ void HistoryWidget::setHistory(History *history) { return; } + const auto settings = &AyuSettings::getInstance(); + const auto was = _attachBotsMenu && _history && _history->peer->isUser(); - const auto now = _attachBotsMenu && history && history->peer->isUser(); + const auto now = _attachBotsMenu && history && history->peer->isUser() && settings->showAttachPopup; if (was && !now) { _attachToggle->removeEventFilter(_attachBotsMenu.get()); _attachBotsMenu->hideFast(); @@ -2722,6 +2741,9 @@ void HistoryWidget::refreshAttachBotsMenu() { if (!_history) { return; } + + const auto settings = &AyuSettings::getInstance(); + _attachBotsMenu = InlineBots::MakeAttachBotsMenu( this, controller(), @@ -2733,7 +2755,9 @@ void HistoryWidget::refreshAttachBotsMenu() { } _attachBotsMenu->setOrigin( Ui::PanelAnimation::Origin::BottomLeft); - _attachToggle->installEventFilter(_attachBotsMenu.get()); + if (settings->showAttachPopup) { + _attachToggle->installEventFilter(_attachBotsMenu.get()); + } _attachBotsMenu->heightValue( ) | rpl::start_with_next([=] { moveFieldControls(); @@ -2982,6 +3006,8 @@ bool HistoryWidget::canWriteMessage() const { } void HistoryWidget::updateControlsVisibility() { + const auto settings = &AyuSettings::getInstance(); + auto fieldDisabledRemoved = (_fieldDisabled != nullptr); const auto hideExtraButtons = _fieldCharsCountManager.isLimitExceeded(); const auto guard = gsl::finally([&] { @@ -3162,27 +3188,27 @@ void HistoryWidget::updateControlsVisibility() { _botCommandStart->hide(); } else if (_kbReplyTo) { _kbScroll->hide(); - _tabbedSelectorToggle->show(); + SWITCH_BUTTON(_tabbedSelectorToggle, settings->showEmojiButtonInMessageField); _botKeyboardHide->hide(); _botKeyboardShow->hide(); _botCommandStart->hide(); } else { _kbScroll->hide(); - _tabbedSelectorToggle->show(); + SWITCH_BUTTON(_tabbedSelectorToggle, settings->showEmojiButtonInMessageField); _botKeyboardHide->hide(); if (_keyboard->hasMarkup()) { _botKeyboardShow->show(); _botCommandStart->hide(); } else { _botKeyboardShow->hide(); - _botCommandStart->setVisible(_cmdStartShown); + _botCommandStart->setVisible(_cmdStartShown && settings->showCommandsButtonInMessageField); } } if (_replaceMedia) { _replaceMedia->show(); _attachToggle->hide(); } else { - _attachToggle->show(); + SWITCH_BUTTON(_attachToggle, settings->showAttachButtonInMessageField); } if (_botMenu.button) { _botMenu.button->show(); @@ -3210,7 +3236,7 @@ void HistoryWidget::updateControlsVisibility() { } if (_ttlInfo) { const auto was = _ttlInfo->isVisible(); - const auto now = (!_editMsgId) && (!hideExtraButtons); + const auto now = (!_editMsgId) && (!hideExtraButtons) && settings->showAutoDeleteButtonInMessageField; if (was != now) { _ttlInfo->setVisible(now); rightButtonsChanged = true; @@ -5024,6 +5050,11 @@ bool HistoryWidget::isSearching() const { } bool HistoryWidget::showRecordButton() const { + const auto settings = &AyuSettings::getInstance(); + if (!settings->showMicrophoneButtonInMessageField) { + return false; + } + return Media::Capture::instance()->available() && !_voiceRecordBar->isListenState() && !_voiceRecordBar->isRecordingByAnotherBar() @@ -5233,6 +5264,8 @@ void HistoryWidget::showKeyboardHideButton() { } void HistoryWidget::toggleKeyboard(bool manual) { + const auto settings = &AyuSettings::getInstance(); + auto fieldEnabled = canWriteMessage() && !_showAnimation; if (_kbShown || _kbReplyTo) { _botKeyboardHide->hide(); @@ -5268,7 +5301,7 @@ void HistoryWidget::toggleKeyboard(bool manual) { _botKeyboardHide->hide(); _botKeyboardShow->hide(); if (fieldEnabled) { - _botCommandStart->show(); + SWITCH_BUTTON(_botCommandStart, settings->showCommandsButtonInMessageField); } _kbScroll->hide(); _kbShown = false; @@ -5308,11 +5341,7 @@ void HistoryWidget::toggleKeyboard(bool manual) { } updateControlsGeometry(); updateFieldPlaceholder(); - if (_botKeyboardHide->isHidden() && canWriteMessage() && !_showAnimation) { - _tabbedSelectorToggle->show(); - } else { - _tabbedSelectorToggle->hide(); - } + SWITCH_BUTTON(_tabbedSelectorToggle, _botKeyboardHide->isHidden() && canWriteMessage() && !_showAnimation && settings->showEmojiButtonInMessageField); updateField(); } @@ -5451,6 +5480,8 @@ bool HistoryWidget::fieldOrDisabledShown() const { } void HistoryWidget::moveFieldControls() { + const auto settings = &AyuSettings::getInstance(); + auto keyboardHeight = 0; auto bottom = height(); auto maxKeyboardHeight = computeMaxFieldHeight() - fieldHeight(); @@ -5474,7 +5505,9 @@ void HistoryWidget::moveFieldControls() { if (_replaceMedia) { _replaceMedia->moveToLeft(left, buttonsBottom); } - _attachToggle->moveToLeft(left, buttonsBottom); left += _attachToggle->width(); + if (settings->showAttachButtonInMessageField) { + _attachToggle->moveToLeft(left, buttonsBottom); left += _attachToggle->width(); + } if (_sendAs) { _sendAs->moveToLeft(left, buttonsBottom); left += _sendAs->width(); } @@ -5488,14 +5521,14 @@ void HistoryWidget::moveFieldControls() { _send->moveToRight(right, buttonsBottom); right += _send->width(); _voiceRecordBar->moveToLeft(0, bottom - _voiceRecordBar->height()); _tabbedSelectorToggle->moveToRight(right, buttonsBottom); - _botKeyboardHide->moveToRight(right, buttonsBottom); right += _botKeyboardHide->width(); + _botKeyboardHide->moveToRight(right, buttonsBottom); right += settings->showEmojiButtonInMessageField || !_botKeyboardHide->isHidden() ? _botKeyboardHide->width() : 0; _botKeyboardShow->moveToRight(right, buttonsBottom); _botCommandStart->moveToRight(right, buttonsBottom); if (_silent) { _silent->moveToRight(right, buttonsBottom); } const auto kbShowShown = _history && !_kbShown && _keyboard->hasMarkup(); - if (kbShowShown || _cmdStartShown || _silent) { + if (kbShowShown || (_cmdStartShown && settings->showCommandsButtonInMessageField) || _silent) { right += _botCommandStart->width(); } if (_scheduled) { @@ -5536,12 +5569,14 @@ void HistoryWidget::moveFieldControls() { } void HistoryWidget::updateFieldSize() { + const auto settings = &AyuSettings::getInstance(); + const auto kbShowShown = _history && !_kbShown && _keyboard->hasMarkup(); auto fieldWidth = width() - - _attachToggle->width() + - (settings->showAttachButtonInMessageField ? _attachToggle->width() : 0) - st::historySendRight - _send->width() - - _tabbedSelectorToggle->width(); + - (settings->showEmojiButtonInMessageField ? _tabbedSelectorToggle->width() : 0); if (_botMenu.button) { fieldWidth -= st::historyBotMenuSkip + _botMenu.button->width(); } @@ -5551,7 +5586,7 @@ void HistoryWidget::updateFieldSize() { if (kbShowShown) { fieldWidth -= _botKeyboardShow->width(); } - if (_cmdStartShown) { + if (_cmdStartShown && settings->showCommandsButtonInMessageField) { fieldWidth -= _botCommandStart->width(); } if (_silent && _silent->isVisible()) { @@ -5560,7 +5595,7 @@ void HistoryWidget::updateFieldSize() { if (_scheduled && _scheduled->isVisible()) { fieldWidth -= _scheduled->width(); } - if (_ttlInfo && _ttlInfo->isVisible()) { + if (_ttlInfo && _ttlInfo->isVisible() && settings->showAutoDeleteButtonInMessageField) { fieldWidth -= _ttlInfo->width(); } @@ -6586,6 +6621,8 @@ void HistoryWidget::updateBotKeyboard(History *h, bool force) { return; } + const auto settings = &AyuSettings::getInstance(); + const auto wasVisible = _kbShown || _kbReplyTo; const auto wasMsgId = _keyboard->forMsgId(); auto changed = false; @@ -6628,7 +6665,7 @@ void HistoryWidget::updateBotKeyboard(History *h, bool force) { showKeyboardHideButton(); } else { _kbScroll->hide(); - _tabbedSelectorToggle->show(); + SWITCH_BUTTON(_tabbedSelectorToggle, settings->showEmojiButtonInMessageField); _botKeyboardHide->hide(); } _botKeyboardShow->hide(); @@ -6648,7 +6685,7 @@ void HistoryWidget::updateBotKeyboard(History *h, bool force) { } else { if (!_showAnimation) { _kbScroll->hide(); - _tabbedSelectorToggle->show(); + SWITCH_BUTTON(_tabbedSelectorToggle, settings->showEmojiButtonInMessageField); _botKeyboardHide->hide(); _botKeyboardShow->show(); _botCommandStart->hide(); @@ -6666,10 +6703,11 @@ void HistoryWidget::updateBotKeyboard(History *h, bool force) { } else { if (!_scroll->isHidden()) { _kbScroll->hide(); + //SWITCH_BUTTON(_tabbedSelectorToggle, settings->showEmojiButtonInMessageField); _tabbedSelectorToggle->show(); _botKeyboardHide->hide(); _botKeyboardShow->hide(); - _botCommandStart->setVisible(!_editMsgId); + _botCommandStart->setVisible(!_editMsgId && settings->showCommandsButtonInMessageField); } _field->setMaxHeight(computeMaxFieldHeight()); _kbShown = false; diff --git a/Telegram/SourceFiles/settings/settings_experimental.cpp b/Telegram/SourceFiles/settings/settings_experimental.cpp index 983497e8a1..9ff718b407 100644 --- a/Telegram/SourceFiles/settings/settings_experimental.cpp +++ b/Telegram/SourceFiles/settings/settings_experimental.cpp @@ -140,11 +140,11 @@ void SetupExperimental( : rpl::producer<>())); }; - addToggle(ChatHelpers::kOptionTabbedPanelShowOnClick); + // addToggle(ChatHelpers::kOptionTabbedPanelShowOnClick); addToggle(Dialogs::kOptionForumHideChatsList); addToggle(Core::kOptionFractionalScalingEnabled); addToggle(Window::kOptionViewProfileInChatsListContextMenu); - addToggle(Info::Profile::kOptionShowPeerIdBelowAbout); + // addToggle(Info::Profile::kOptionShowPeerIdBelowAbout); addToggle(Ui::kOptionUseSmallMsgBubbleRadius); addToggle(Media::Player::kOptionDisableAutoplayNext); addToggle(kOptionSendLargePhotos);