mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 02:01:40 -05:00
Fix layer resize animation glitches.
This commit is contained in:
parent
c0bb8a8af7
commit
335704e176
3 changed files with 16 additions and 5 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -108,6 +108,7 @@ public:
|
|||
const Window::SectionSlideParams ¶ms) override;
|
||||
void showAnimatedHook(
|
||||
const Window::SectionSlideParams ¶ms) override;
|
||||
void forceContentRepaint();
|
||||
|
||||
bool showInternal(
|
||||
not_null<Window::SectionMemento*> memento,
|
||||
|
|
Loading…
Add table
Reference in a new issue