From 3cce0655d1c109a42764051a9f2ca4b01f343daa Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 9 May 2022 17:09:05 +0400 Subject: [PATCH] Allow links in default multiline toasts. --- ui/toasts/common_toasts.cpp | 1 + ui/toasts/common_toasts.h | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/ui/toasts/common_toasts.cpp b/ui/toasts/common_toasts.cpp index 0f06547..cc25a2f 100644 --- a/ui/toasts/common_toasts.cpp +++ b/ui/toasts/common_toasts.cpp @@ -21,6 +21,7 @@ base::weak_ptr ShowMultilineToast( ? args.duration : Ui::Toast::kDefaultDuration), .multiline = true, + .filter = std::move(args.filter), }; return args.parentOverride ? Ui::Toast::Show(args.parentOverride, std::move(config)) diff --git a/ui/toasts/common_toasts.h b/ui/toasts/common_toasts.h index 7384c0a..1fe074d 100644 --- a/ui/toasts/common_toasts.h +++ b/ui/toasts/common_toasts.h @@ -10,6 +10,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/text/text_entity.h" #include "base/weak_ptr.h" +class ClickHandler; +using ClickHandlerPtr = std::shared_ptr; +using ClickHandlerFilter = Fn; + namespace Ui { namespace Toast { class Instance; @@ -19,6 +23,7 @@ struct MultilineToastArgs { QWidget *parentOverride = nullptr; TextWithEntities text; crl::time duration = 0; + ClickHandlerFilter filter; }; base::weak_ptr ShowMultilineToast(