2020-09-30 07:51:17 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
|
|
|
the official desktop application for the Telegram messaging service.
|
|
|
|
|
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|
|
|
*/
|
|
|
|
#include "ui/toasts/common_toasts.h"
|
|
|
|
|
|
|
|
#include "ui/toast/toast.h"
|
|
|
|
#include "styles/style_td_common.h"
|
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
|
2021-05-31 13:10:30 +00:00
|
|
|
base::weak_ptr<Toast::Instance> ShowMultilineToast(
|
|
|
|
MultilineToastArgs &&args) {
|
2021-03-16 14:13:51 +00:00
|
|
|
auto config = Ui::Toast::Config{
|
2020-09-30 07:51:17 +00:00
|
|
|
.text = std::move(args.text),
|
|
|
|
.st = &st::defaultMultilineToast,
|
2021-02-11 14:46:46 +00:00
|
|
|
.durationMs = (args.duration
|
|
|
|
? args.duration
|
|
|
|
: Ui::Toast::kDefaultDuration),
|
2020-09-30 07:51:17 +00:00
|
|
|
.multiline = true,
|
2021-03-16 14:13:51 +00:00
|
|
|
};
|
2021-05-31 13:10:30 +00:00
|
|
|
return args.parentOverride
|
|
|
|
? Ui::Toast::Show(args.parentOverride, std::move(config))
|
|
|
|
: Ui::Toast::Show(std::move(config));
|
2020-09-30 07:51:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace Ui
|