2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-02 15:45:12 +00:00

Improve child list closing.

This commit is contained in:
John Preston
2022-12-06 14:12:43 +04:00
parent 6bd2be0aee
commit a1de77e8d2
3 changed files with 10 additions and 4 deletions

View File

@@ -787,6 +787,7 @@ void Widget::changeOpenedSubsection(
oldContentCache = grabForFolderSlideAnimation();
}
_showAnimation = nullptr;
destroyChildListCanvas();
change();
refreshTopBars();
updateControlsVisibility(true);
@@ -807,6 +808,11 @@ void Widget::changeOpenedSubsection(
}
}
void Widget::destroyChildListCanvas() {
_childListShown = 0.;
_hideChildListCanvas = nullptr;
}
void Widget::changeOpenedFolder(Data::Folder *folder, anim::type animated) {
if (_openedFolder == folder) {
return;
@@ -1987,8 +1993,7 @@ void Widget::openChildList(
const auto animated = !_childList
&& (params.animated == anim::type::normal);
if (animated) {
_childListShown = 0.;
_hideChildListCanvas = nullptr;
destroyChildListCanvas();
slide.oldContentCache = Ui::GrabWidget(
this,
QRect(_narrowWidth, 0, width() - _narrowWidth, height()));
@@ -2086,8 +2091,7 @@ void Widget::closeChildList(anim::type animated) {
_hideChildListCanvas->update();
});
animation->setFinishedCallback([=] {
_childListShown = 0.;
_hideChildListCanvas = nullptr;
destroyChildListCanvas();
});
animation->setPixmaps(oldContentCache, newContentCache);
animation->start();