Fix render lag in the new tooltip.

Geometry update, animation cache grab and show call should be invoked
queued, because they depend on the later controls geometry update.
This commit is contained in:
John Preston
2017-05-17 14:15:08 +03:00
parent 52f7c8f064
commit 966dcd5509
+8 -6
View File
@@ -3751,17 +3751,19 @@ void HistoryWidget::checkTabbedSelectorToggleTooltip() {
if (!_tabbedSelectorToggleTooltipShown) {
auto shownCount = AuthSession::Current().data().tabbedSelectorSectionTooltipShown();
if (shownCount < kTabbedSelectorToggleTooltipCount) {
AuthSession::Current().data().setTabbedSelectorSectionTooltipShown(shownCount + 1);
AuthSession::Current().saveDataDelayed(kTabbedSelectorToggleTooltipTimeoutMs);
_tabbedSelectorToggleTooltipShown = true;
_tabbedSelectorToggleTooltip.create(this, object_ptr<Ui::FlatLabel>(this, lang(lng_emoji_hide_panel), Ui::FlatLabel::InitType::Simple, st::defaultImportantTooltipLabel), st::defaultImportantTooltip);
updateTabbedSelectorToggleTooltipGeometry();
_tabbedSelectorToggleTooltip->setHiddenCallback([this] {
_tabbedSelectorToggleTooltip.destroy();
});
_tabbedSelectorToggleTooltip->hideAfter(kTabbedSelectorToggleTooltipTimeoutMs);
_tabbedSelectorToggleTooltip->toggleAnimated(true);
InvokeQueued(_tabbedSelectorToggleTooltip, [this, shownCount] {
AuthSession::Current().data().setTabbedSelectorSectionTooltipShown(shownCount + 1);
AuthSession::Current().saveDataDelayed(kTabbedSelectorToggleTooltipTimeoutMs);
updateTabbedSelectorToggleTooltipGeometry();
_tabbedSelectorToggleTooltip->hideAfter(kTabbedSelectorToggleTooltipTimeoutMs);
_tabbedSelectorToggleTooltip->toggleAnimated(true);
});
}
}
} else {