From accb20a5719a2ea1ff4652b42859163ebf3145ae Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 25 Apr 2019 13:20:20 +0400 Subject: [PATCH] Improve archived toast notification. --- Telegram/SourceFiles/window/window_peer_menu.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index 6b925de73..55ab7d810 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -42,6 +42,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Window { namespace { +constexpr auto kArchivedToastDuration = crl::time(3000); + class Filler { public: Filler( @@ -811,9 +813,15 @@ void PeerMenuAddMuteAction( // void ToggleHistoryArchived(not_null history, bool archived) { const auto callback = [=] { - Ui::Toast::Show(lang(archived + Ui::Toast::Config toast; + toast.text = lang(archived ? lng_archived_added - : lng_archived_removed)); + : lng_archived_removed); + toast.maxWidth = st::boxWideWidth; + if (archived) { + toast.durationMs = kArchivedToastDuration; + } + Ui::Toast::Show(toast); }; history->session().api().toggleHistoryArchived( history,