mirror of https://github.com/procxx/kepka.git
Improve archived toast notification.
This commit is contained in:
parent
08101ba666
commit
accb20a571
|
@ -42,6 +42,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
namespace Window {
|
namespace Window {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
constexpr auto kArchivedToastDuration = crl::time(3000);
|
||||||
|
|
||||||
class Filler {
|
class Filler {
|
||||||
public:
|
public:
|
||||||
Filler(
|
Filler(
|
||||||
|
@ -811,9 +813,15 @@ void PeerMenuAddMuteAction(
|
||||||
//
|
//
|
||||||
void ToggleHistoryArchived(not_null<History*> history, bool archived) {
|
void ToggleHistoryArchived(not_null<History*> history, bool archived) {
|
||||||
const auto callback = [=] {
|
const auto callback = [=] {
|
||||||
Ui::Toast::Show(lang(archived
|
Ui::Toast::Config toast;
|
||||||
|
toast.text = lang(archived
|
||||||
? lng_archived_added
|
? 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->session().api().toggleHistoryArchived(
|
||||||
history,
|
history,
|
||||||
|
|
Loading…
Reference in New Issue