[vlc-commits] [Git][videolan/vlc][master] 3 commits: qml: disable add displaced transition and clear add transition artifact in `ListViewExt`
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Sun Jan 5 14:46:12 UTC 2025
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
b0b0bb94 by Fatih Uzunoglu at 2025-01-05T14:23:08+00:00
qml: disable add displaced transition and clear add transition artifact in `ListViewExt`
Qt has number of bugs that hinder using transitions properly. The worst one seems to be
add displaced, which causes items to have incorrect positions, where it is not possible
to recover from that situation.
Transition in general causes visual glitches (independent of positioning), but it seems
to be possible to recover from that by adjusting the viewport in an undetectable way.
This can be observed when there are 2-3 items in the playlist, and when a large number,
such as 30 items are inserted at the beginning of the playlist.
Instead of disabling the transitions altogether, I propose to:
1) Clear the artifact on items after items are added.
2) Disable add displaced transition, as it is not possible to recover from incorrectly
positioned delegate once it occurs. Keep move and remove displaced transition
- - - - -
69ecacdf by Fatih Uzunoglu at 2025-01-05T14:23:08+00:00
qml: care about the view orientation in displaced transition in `ListViewExt`
- - - - -
9f451c05 by Fatih Uzunoglu at 2025-01-05T14:23:08+00:00
qml: care about the rest of transitions in `FadingEdgeForListView`
- - - - -
2 changed files:
- modules/gui/qt/widgets/qml/FadingEdgeForListView.qml
- modules/gui/qt/widgets/qml/ListViewExt.qml
Changes:
=====================================
modules/gui/qt/widgets/qml/FadingEdgeForListView.qml
=====================================
@@ -40,6 +40,9 @@ FadingEdge {
readonly property bool transitionsRunning: (listView.add?.running ||
listView.addDisplaced?.running ||
+ listView.displaced?.running ||
+ listView.move?.running ||
+ listView.moveDisplaced?.running ||
listView.populate?.running ||
listView.remove?.running ||
listView.removeDisplaced?.running) ?? false
=====================================
modules/gui/qt/widgets/qml/ListViewExt.qml
=====================================
@@ -299,17 +299,43 @@ ListView {
duration: VLCStyle.duration_long
easing.type: Easing.OutSine
}
+
+ onRunningChanged: {
+ if (!running) {
+ // This intends to clear the artifact (QTBUG-110969).
+ // Note that this does not help if items are not
+ // positioned correctly, for that x/y animation should
+ // not be used for add transitions.
+ const epsilon = 0.001
+ if (root.orientation === ListView.Vertical) {
+ root.contentY -= epsilon
+ root.contentY += epsilon
+ } else if (root.orientation === ListView.Horizontal) {
+ root.contentX -= epsilon
+ root.contentX += epsilon
+ }
+ }
+ }
}
- displaced: Transition {
+ // WARNING: Add displaced transition is disabled, because it is
+ // often not executed properly, and causes items to have
+ // incorrect positions. It is currently not possible to
+ // recover from that situation. Fortunately move and
+ // remove displaced seemingly are not affected from that
+ // issue. See QTBUG-131106, QTBUG-89158, ...
+
+ moveDisplaced: Transition {
NumberAnimation {
// TODO: Use YAnimator >= Qt 6.0 (QTBUG-66475)
- property: "y"
+ property: (root.orientation === ListView.Vertical) ? "y" : "x"
duration: VLCStyle.duration_long
easing.type: Easing.OutSine
}
}
+ removeDisplaced: moveDisplaced
+
// Events
// NOTE: We always want a valid 'currentIndex' by default.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/93598293a5e3696360d08e44be684e639df11d76...9f451c0596d24f94dca55f309a7b53f920d905df
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/93598293a5e3696360d08e44be684e639df11d76...9f451c0596d24f94dca55f309a7b53f920d905df
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list