Commit 0eab04a3 authored by Marco Martin's avatar Marco Martin

try harder to make the selected wallpaper visible

Summary:
qml gridview don't have an official way to ensure the
current index is visible when the view is first instantiated,
the only way we have is to do positionViewAtIndex when we know the
proper space has already been allocated (Component.onCompleted
is way too early) we used to do that on onCountChanged, but that
too seems to early sometimes, as the selected wallpaper
is visible only sometimes, attaching it to onContentHeightChanged
seems to be more reliable (for all branches)

Test Plan: proper wallpaper is visible every time the window opens

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: hein, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D4648
parent 81e728c5
......@@ -294,11 +294,10 @@ ColumnLayout {
color: cfg_Color
}
onCountChanged: {
onContentHeightChanged: {
wallpapersGrid.currentIndex = imageWallpaper.wallpaperModel.indexOf(cfg_Image);
wallpapersGrid.positionViewAtIndex(wallpapersGrid.currentIndex, GridView.Visible)
}
Connections {
target: root
onRestoreIndex: {
......
Markdown is supported
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