mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 07:07:08 +02:00
Improve child list closing.
This commit is contained in:
parent
6bd2be0aee
commit
a1de77e8d2
3 changed files with 10 additions and 4 deletions
Telegram/SourceFiles/dialogs
|
@ -2102,6 +2102,7 @@ void InnerWidget::refreshShownList() {
|
|||
: session().data().chatsList(_openedFolder)->indexed();
|
||||
if (_shownList != list) {
|
||||
_shownList = list;
|
||||
_shownList->updateHeights(_narrowRatio);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -182,6 +182,7 @@ private:
|
|||
void changeOpenedFolder(Data::Folder *folder, anim::type animated);
|
||||
void changeOpenedForum(Data::Forum *forum, anim::type animated);
|
||||
void hideChildList();
|
||||
void destroyChildListCanvas();
|
||||
[[nodiscard]] QPixmap grabForFolderSlideAnimation();
|
||||
void startSlideAnimation(
|
||||
QPixmap oldContentCache,
|
||||
|
|
Loading…
Add table
Reference in a new issue