Created attachment 131803 [details]
Example QML file
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
Animation is played
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
> 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.
Bugfix is now available in the branch `columnview-replace` of https://git.sr.ht/~link2xt/Kirigami
Merge request with a bugfix: https://invent.kde.org/frameworks/kirigami/-/merge_requests/234
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
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.
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