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 }};
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 }};

View file

@ -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<Ui::PopupMenu *> menu, HistoryItem *item)
{
item->history()->session().tryResolveWindow()
->showSection(std::make_shared<EditedLog::SectionMemento>(item->history()->peer, item));
}, &st::menuIconInfo);
}, &st::ayuEditsHistoryIcon);
}
}
void AddHideMessageAction(not_null<Ui::PopupMenu *> 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<Ui::PopupMenu *> menu, HistoryItem *item)