fix: use custom icon for edits history action

fix: remove buggy Hide
This commit is contained in:
ZavaruKitsu 2023-12-24 17:18:28 +03:00
parent 6fab4e1dc3
commit 9cc0ca5d81
5 changed files with 14 additions and 14 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,005 B

View file

@ -12,6 +12,7 @@ using "ui/widgets/widgets.style";
ayuGhostIcon: icon {{ "ayu/ghost", menuIconColor }}; ayuGhostIcon: icon {{ "ayu/ghost", menuIconColor }};
ayuMenuIcon: icon {{ "ayu/ayu_menu", menuIconColor }}; ayuMenuIcon: icon {{ "ayu/ayu_menu", menuIconColor }};
ayuEditsHistoryIcon: icon {{ "ayu/edits_history", menuIconColor }};
ayuLReadMenuIcon: icon {{ "ayu/lread", menuIconColor }}; ayuLReadMenuIcon: icon {{ "ayu/lread", menuIconColor }};
ayuSReadMenuIcon: icon {{ "ayu/sread", menuIconColor }}; ayuSReadMenuIcon: icon {{ "ayu/sread", menuIconColor }};
ayuStreamerModeMenuIcon: icon {{ "ayu/streamer", menuIconColor }}; ayuStreamerModeMenuIcon: icon {{ "ayu/streamer", menuIconColor }};

View file

@ -10,9 +10,7 @@
#include "ayu/messages/ayu_messages_controller.h" #include "ayu/messages/ayu_messages_controller.h"
#include "ayu/ui/boxes/message_history_box.h" #include "ayu/ui/boxes/message_history_box.h"
#include "history/history_inner_widget.h" #include "styles/style_ayu_icons.h"
#include "settings/settings_common.h"
#include "styles/style_chat.h"
#include "ui/widgets/popup_menu.h" #include "ui/widgets/popup_menu.h"
#include "ayu/ui/sections/edited/edited_log_section.h" #include "ayu/ui/sections/edited/edited_log_section.h"
@ -29,22 +27,23 @@ void AddHistoryAction(not_null<Ui::PopupMenu *> menu, HistoryItem *item)
{ {
item->history()->session().tryResolveWindow() item->history()->session().tryResolveWindow()
->showSection(std::make_shared<EditedLog::SectionMemento>(item->history()->peer, item)); ->showSection(std::make_shared<EditedLog::SectionMemento>(item->history()->peer, item));
}, &st::menuIconInfo); }, &st::ayuEditsHistoryIcon);
} }
} }
void AddHideMessageAction(not_null<Ui::PopupMenu *> menu, HistoryItem *item) void AddHideMessageAction(not_null<Ui::PopupMenu *> menu, HistoryItem *item)
{ {
const auto settings = &AyuSettings::getInstance(); // todo: rework
const auto history = item->history(); // const auto settings = &AyuSettings::getInstance();
menu->addAction(tr::ayu_ContextHideMessage(tr::now), [=]() // const auto history = item->history();
{ // menu->addAction(tr::ayu_ContextHideMessage(tr::now), [=]()
const auto initSaveDeleted = settings->saveDeletedMessages; // {
// const auto initSaveDeleted = settings->saveDeletedMessages;
settings->set_saveDeletedMessages(false); //
history->destroyMessage(item); // settings->set_saveDeletedMessages(false);
settings->set_saveDeletedMessages(initSaveDeleted); // history->destroyMessage(item);
}, &st::menuIconClear); // settings->set_saveDeletedMessages(initSaveDeleted);
// }, &st::menuIconClear);
} }
void AddReadUntilAction(not_null<Ui::PopupMenu *> menu, HistoryItem *item) void AddReadUntilAction(not_null<Ui::PopupMenu *> menu, HistoryItem *item)