diff --git a/Telegram/SourceFiles/info/info_layer_widget.cpp b/Telegram/SourceFiles/info/info_layer_widget.cpp index 87650d4df..131bc6b1a 100644 --- a/Telegram/SourceFiles/info/info_layer_widget.cpp +++ b/Telegram/SourceFiles/info/info_layer_widget.cpp @@ -59,6 +59,7 @@ void LayerWidget::setupHeightConsumers() { | rpl::start_with_next([this](int height) { accumulate_max(_desiredHeight, height); resizeToWidth(width()); + _content->forceContentRepaint(); }, lifetime()); } @@ -142,9 +143,6 @@ int LayerWidget::resizeGetHeight(int newWidth) { moveToLeft((windowWidth - newWidth) / 2, (windowHeight - newHeight) / 2); - _content->update(); - update(); - return newHeight; } diff --git a/Telegram/SourceFiles/info/info_wrap_widget.cpp b/Telegram/SourceFiles/info/info_wrap_widget.cpp index f9c22e6c8..1588fd283 100644 --- a/Telegram/SourceFiles/info/info_wrap_widget.cpp +++ b/Telegram/SourceFiles/info/info_wrap_widget.cpp @@ -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(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) diff --git a/Telegram/SourceFiles/info/info_wrap_widget.h b/Telegram/SourceFiles/info/info_wrap_widget.h index c0a409e10..ce65bffca 100644 --- a/Telegram/SourceFiles/info/info_wrap_widget.h +++ b/Telegram/SourceFiles/info/info_wrap_widget.h @@ -108,6 +108,7 @@ public: const Window::SectionSlideParams ¶ms) override; void showAnimatedHook( const Window::SectionSlideParams ¶ms) override; + void forceContentRepaint(); bool showInternal( not_null memento,