From 9cc0ca5d819dbaba2d8484d46f37a6d1cf4a8fa2 Mon Sep 17 00:00:00 2001 From: ZavaruKitsu Date: Sun, 24 Dec 2023 17:18:28 +0300 Subject: [PATCH] fix: use custom icon for edits history action fix: remove buggy Hide --- .../Resources/icons/ayu/edits_history.png | Bin 0 -> 428 bytes .../Resources/icons/ayu/edits_history@2x.png | Bin 0 -> 713 bytes .../Resources/icons/ayu/edits_history@3x.png | Bin 0 -> 1005 bytes Telegram/SourceFiles/ayu/ui/ayu_icons.style | 1 + .../ayu/ui/context_menu/context_menu.cpp | 27 +++++++++--------- 5 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 Telegram/Resources/icons/ayu/edits_history.png create mode 100644 Telegram/Resources/icons/ayu/edits_history@2x.png create mode 100644 Telegram/Resources/icons/ayu/edits_history@3x.png diff --git a/Telegram/Resources/icons/ayu/edits_history.png b/Telegram/Resources/icons/ayu/edits_history.png new file mode 100644 index 0000000000000000000000000000000000000000..6cc42ef365a981ddcafd514c6de0d2b065188e22 GIT binary patch literal 428 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjoCO|{#S9GG!XV7ZFl!D-1!HlL zyA#8@b22Z19F}xPUq=Rpjs4tz5?O(Aj-D=#Ar*{Ar`|p5>LAee{KU@X%w7waWr3)J z%Y}6jki}%RfCWg-FBgu#aW~?*`?<+)T1}JF?w#ym7t}3Lmb!Z;I5ii7 zHPtis_NGs<*O%^lKU1YzVP@{_GkjMM=y5QuTJ(!Uqh-{-q!w>g@r z!FXmxWy+sA@mj6PMhp{9mbl6-_~I=aeD>gHn`;p_&!_QEa(Mr0*EBU1-VeTc@>^~*|6y!Zzj>JZ ToYx9q;4*l+`njxgN@xNAi~O+k literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/ayu/edits_history@2x.png b/Telegram/Resources/icons/ayu/edits_history@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..853fd34b70891b5cd47aa24e8cdd6b364f30ed9a GIT binary patch literal 713 zcmV;)0yh1LP)Z~R9Ebbty_fl&b+&;cFLfzbgKD1i=80V>GLmzmt$k9U_%Ht)`j`(`r7$ZfK_ zUp~pEK}3owj325vY6r?jlOmzrZkxuz{eGvIP|~*9Y}E7lR9v7h-ia}`*n!<{r$Vva zZp98XtQR2wWpp&nXYGh-E_6B_n$PF7TCI}ruh)wt2=ZJ{UX91&B%0lBm;G+9*Gt}m z4cH2u2ipM*0^VLOmp}O)>OdN>4O-!Mt}PaY27>{e&*xl~0eudK1B(uz&vLoU{2eMa zo6YEYy%Gn`Xx(nNL_H88&0#efjZD<>U9yOEaEz_#bgK6IeUe=~nbgYfU?&KJS*cyG z*WNOUcd`OzZDsZGasa#p5FJ-vWQ5aPk+ng?*kT7PkYa|hC~dJ=B$;yc&D{&77p+vQ zePFj5ob3tQf%p4OMIpUcYPDLqec8KF`;Yr+2;PnQ>^@xpJwquPSIw;2=G-Sm-_hpF*aQjvj9CFk4J9bSiJT*3FcBLJ*ilG ze-3=k;?6Z-&!?!)6$M=ZG0!NKITV*%g{_z^UD)E3-<`Elq*Ip`%@gT79*=Z7of3M* z;63Px*6;U8*M!Vi$oyn7Vcq69y+r-e)<=r~GJr8Tb0cOalUk(ImKy(K(y$H6`rH=; v-_RhWl8OQ9DpJD(}EAc0Q{9%{n5;00000NkvXXu0mjf27x(; literal 0 HcmV?d00001 diff --git a/Telegram/Resources/icons/ayu/edits_history@3x.png b/Telegram/Resources/icons/ayu/edits_history@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..6167dc349eee7655e5c0f5a0791537d64de6cbc4 GIT binary patch literal 1005 zcmVUO)2>-G9@#p!g4&*{T^SSjoXR}%AoYiVo)PqE;7!tF}VzD4w*6VfZw`s!9 zi?b>QL!+EP(H;G7w6yVHI-SN94WWy5JRalUreXXHWA}?Z1KQYI;4RDu&S6Y&Ktpkm~Z;%7ed|HhE|=)x4%w z#O!sl_O#n=^1Sfy(4T!w7ACJdzQ)b!_ znt*prXdqqVTp;AB=&7B2gDxFi^5t?Nm;9&@E0s#*8s{E_vN{|N<8NTTKtBfWk!U+a zauD)?i}%m(K&WC2K_G@85JM1%L43MHvT2lR4pl@2l5QHMnnRVshnPfjs3Ph?l1-yz zbEqPogNoiXhAPGo1Y!sRF$94ayo~_^7fqv&=1|3(K(3lbAI+gkAwx{MIaJZ|Ae%3# zE}BMP&0!Yf*&r7)htexMz@yr%bRs00000NkvXXu0mjfwW8Q% literal 0 HcmV?d00001 diff --git a/Telegram/SourceFiles/ayu/ui/ayu_icons.style b/Telegram/SourceFiles/ayu/ui/ayu_icons.style index d3b7260fe..59199295b 100644 --- a/Telegram/SourceFiles/ayu/ui/ayu_icons.style +++ b/Telegram/SourceFiles/ayu/ui/ayu_icons.style @@ -12,6 +12,7 @@ using "ui/widgets/widgets.style"; ayuGhostIcon: icon {{ "ayu/ghost", menuIconColor }}; ayuMenuIcon: icon {{ "ayu/ayu_menu", menuIconColor }}; +ayuEditsHistoryIcon: icon {{ "ayu/edits_history", menuIconColor }}; ayuLReadMenuIcon: icon {{ "ayu/lread", menuIconColor }}; ayuSReadMenuIcon: icon {{ "ayu/sread", menuIconColor }}; ayuStreamerModeMenuIcon: icon {{ "ayu/streamer", menuIconColor }}; diff --git a/Telegram/SourceFiles/ayu/ui/context_menu/context_menu.cpp b/Telegram/SourceFiles/ayu/ui/context_menu/context_menu.cpp index 0da62ac92..93728d183 100644 --- a/Telegram/SourceFiles/ayu/ui/context_menu/context_menu.cpp +++ b/Telegram/SourceFiles/ayu/ui/context_menu/context_menu.cpp @@ -10,9 +10,7 @@ #include "ayu/messages/ayu_messages_controller.h" #include "ayu/ui/boxes/message_history_box.h" -#include "history/history_inner_widget.h" -#include "settings/settings_common.h" -#include "styles/style_chat.h" +#include "styles/style_ayu_icons.h" #include "ui/widgets/popup_menu.h" #include "ayu/ui/sections/edited/edited_log_section.h" @@ -29,22 +27,23 @@ void AddHistoryAction(not_null menu, HistoryItem *item) { item->history()->session().tryResolveWindow() ->showSection(std::make_shared(item->history()->peer, item)); - }, &st::menuIconInfo); + }, &st::ayuEditsHistoryIcon); } } void AddHideMessageAction(not_null menu, HistoryItem *item) { - const auto settings = &AyuSettings::getInstance(); - const auto history = item->history(); - menu->addAction(tr::ayu_ContextHideMessage(tr::now), [=]() - { - const auto initSaveDeleted = settings->saveDeletedMessages; - - settings->set_saveDeletedMessages(false); - history->destroyMessage(item); - settings->set_saveDeletedMessages(initSaveDeleted); - }, &st::menuIconClear); + // todo: rework +// const auto settings = &AyuSettings::getInstance(); +// const auto history = item->history(); +// menu->addAction(tr::ayu_ContextHideMessage(tr::now), [=]() +// { +// const auto initSaveDeleted = settings->saveDeletedMessages; +// +// settings->set_saveDeletedMessages(false); +// history->destroyMessage(item); +// settings->set_saveDeletedMessages(initSaveDeleted); +// }, &st::menuIconClear); } void AddReadUntilAction(not_null menu, HistoryItem *item)