Verified Commit c857d3ba authored by Fushan Wen's avatar Fushan Wen 💬
Browse files

wallpapers/image: set position in `resetCurrentIndex`

Move the position of the image list view to the currently selected
item's index.

CCBUG: 455129
parent 4fbb2953
......@@ -35,6 +35,7 @@ Item {
function resetCurrentIndex() {
//that min is needed as the module will be populated in an async way
//and only on demand so we can't ensure it already exists
view.positionViewAtIndex(Math.min(imageModel.indexOf(cfg_Image), imageModel.count - 1), GridView.Beginning);
view.currentIndex = Qt.binding(() => Math.min(imageModel.indexOf(cfg_Image), imageModel.count - 1));
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment