2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Fix layer resize animation glitches.

This commit is contained in:
John Preston
2017-10-04 11:27:21 +01:00
parent c0bb8a8af7
commit 335704e176
3 changed files with 16 additions and 5 deletions

View File

@@ -76,8 +76,8 @@ void WrapWidget::setWrap(Wrap wrap) {
void WrapWidget::createTabs() {
_topTabs.create(this, st::infoTabs);
auto sections = QStringList();
sections.push_back(lang(lng_profile_info_section));
sections.push_back(lang(lng_info_tab_media));
sections.push_back(lang(lng_profile_info_section).toUpper());
sections.push_back(lang(lng_info_tab_media).toUpper());
_topTabs->setSections(sections);
_topTabs->sectionActivated()
| rpl::map([](int index) { return static_cast<Tab>(index); })
@@ -90,6 +90,7 @@ void WrapWidget::createTabs() {
_topTabs->show();
_topTabsBackground.create(this, st::profileBg);
_topTabsBackground->setAttribute(Qt::WA_OpaquePaintEvent);
_topTabsBackground->move(0, 0);
_topTabsBackground->resize(
@@ -98,6 +99,17 @@ void WrapWidget::createTabs() {
_topTabsBackground->show();
}
void WrapWidget::forceContentRepaint() {
// WA_OpaquePaintEvent on TopBar creates render glitches when
// animating the LayerWidget's height :( Fixing by repainting.
if (_topTabs) {
_topTabsBackground->update();
} else if (_topBar) {
_topBar->update();
}
_content->update();
}
void WrapWidget::showTab(Tab tab) {
Expects(_content != nullptr);
auto direction = (tab > _tab)