2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 22:46:10 +00:00

Slide psa / quiz toast from the top.

This commit is contained in:
John Preston
2020-04-30 13:16:42 +04:00
parent dd78052f92
commit ff25f1d5c9
4 changed files with 24 additions and 15 deletions

View File

@@ -140,16 +140,16 @@ void HistoryInner::BotAbout::clickHandlerPressedChanged(
HistoryInner::HistoryInner(
not_null<HistoryWidget*> historyWidget,
not_null<Ui::ScrollArea*> scroll,
not_null<Window::SessionController*> controller,
Ui::ScrollArea *scroll,
not_null<History*> history)
: RpWidget(nullptr)
, _widget(historyWidget)
, _scroll(scroll)
, _controller(controller)
, _peer(history->peer)
, _history(history)
, _migrated(history->migrateFrom())
, _widget(historyWidget)
, _scroll(scroll)
, _scrollDateCheck([this] { scrollDateCheck(); })
, _scrollDateHideTimer([this] { scrollDateHideByTimer(); }) {
Instance = this;
@@ -2489,12 +2489,16 @@ void HistoryInner::elementShowPollResults(
}
void HistoryInner::elementShowTooltip(const TextWithEntities &text) {
Ui::Toast::Show(_widget, Ui::Toast::Config{
if (const auto strong = _topToast.get()) {
strong->hideAnimated();
}
_topToast = Ui::Toast::Show(_scroll, Ui::Toast::Config{
.text = text,
.st = &st::historyInfoToast,
.durationMs = CountToastDuration(text),
.multiline = true,
.dark = true,
.slideSide = RectPart::Top,
});
}