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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user