Bug 426770

Summary: pageStack.replace plays animation
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: link2xt
Component: generalAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 5.70.0   
Target Milestone: Not decided   
Platform: Debian unstable   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=395324
Latest Commit: Version Fixed In:
Attachments: Example QML file

Description link2xt 2020-09-20 11:50:46 UTC
Created attachment 131803 [details]
Example QML file

SUMMARY


STEPS TO REPRODUCE
1. Open attached example.qml with qmlscene
2. Shrink the window, so only one column ("Bar") is visible
3. Click the button

OBSERVED RESULT

Animation is played

EXPECTED RESULT

Page is replaced with a clone of itself immediately, without any animation. Underlying stackView .push method has "immediate" option for that: https://doc.qt.io/qt-5/qml-qtquick-controls-stackview.html#push-method
Comment 1 link2xt 2021-02-21 02:25:54 UTC
> Underlying stackView .push method has "immediate" option for that

This is incorrect. I have read the code again and it seems StackView has nothing to do with this bug.

PageRow contains StackView which is initialized with one layer of ColumnView. ColumnView, which is written in C++, does all the animations. In the attached example StackView always contains one item.

Because ColumnView does not have a specialized method to replace item (only addItem, insertItem, moveItem, removeItem, pop and clear), there is no way to replace item without animation.

I have been able to completely disable animation by ignoring m_shouldAnimate stored in ContentItem. ContentItem is implemented in kirigami/src/columnview_p.h.

I will try to prepare a patch adding ColumnView::replaceItem method that replaces items without animations and modify PageRow.qml to actually use it when items are replaced.
Comment 2 link2xt 2021-02-21 21:01:24 UTC
Bugfix is now available in the branch `columnview-replace` of https://git.sr.ht/~link2xt/Kirigami
Comment 3 link2xt 2021-02-21 21:19:56 UTC
Merge request with a bugfix: https://invent.kde.org/frameworks/kirigami/-/merge_requests/234
Comment 4 Marco Martin 2021-02-23 11:11:11 UTC
Git commit 2f02c48695c2f78e77aa593a3ccecb5f4193b419 by Marco Martin.
Committed on 23/02/2021 at 11:10.
Pushed by mart into branch 'master'.

disable animations during replace

M  +10   -1    src/controls/PageRow.qml

https://invent.kde.org/frameworks/kirigami/commit/2f02c48695c2f78e77aa593a3ccecb5f4193b419
Comment 5 link2xt 2021-02-23 16:13:53 UTC
I can't test attached example with latest Kirigami because qmlscene from repositories does not run with it, but the bug remains in https://git.sr.ht/~link2xt/kdeltachat: every time chat is opened, an animation is played.

With https://invent.kde.org/frameworks/kirigami/-/merge_requests/234 it works correctly.
Comment 6 Janet Blackquill 2021-02-24 17:53:10 UTC
Git commit 7db7e3f4130a73050086f98deebfdcad6de132ae by Jan Blackquill, on behalf of Alexander Krotov.
Committed on 24/02/2021 at 17:53.
Pushed by cblack into branch 'master'.

Do not show animation on pageStack.replace

ColumnView should replace the page without sliding animation when a page is replaced.

M  +48   -5    src/columnview.cpp
M  +8    -0    src/columnview.h
M  +53   -13   src/controls/PageRow.qml

https://invent.kde.org/frameworks/kirigami/commit/7db7e3f4130a73050086f98deebfdcad6de132ae