Commit 1919a39d authored by Devin Lin's avatar Devin Lin 🎨
Browse files

shell: Load wallpaper selector only when necessary

parent d8399e88
Pipeline #195399 passed with stage
in 1 minute and 14 seconds
......@@ -22,7 +22,7 @@ GridView {
clip: true
readonly property int reservedSpaceForLabel: metrics.height
readonly property real effectiveContentWidth: width - leftMargin - rightMargin
required property real effectiveContentWidth
cellWidth: effectiveContentWidth / Math.min(Math.floor(effectiveContentWidth / (PlasmaCore.Units.iconSizes.huge + Kirigami.Units.largeSpacing * 2)), 8)
cellHeight: cellWidth + reservedSpaceForLabel
......
......@@ -164,6 +164,7 @@ Item {
interactive: root.interactive
leftMargin: column.horizontalMargin
rightMargin: column.horizontalMargin
effectiveContentWidth: swipeView.width - leftMargin - rightMargin
Layout.fillWidth: true
Layout.fillHeight: true
}
......
......@@ -34,10 +34,15 @@ AppletConfiguration {
}
//END model
// the wallpaper selector is quite heavy, so only load it when needed
Loader {
id: wallpaperSelectorLoader
asynchronous: true
active: true
active: false
onLoaded: {
wallpaperSelectorLoader.item.open();
}
sourceComponent: WallpaperSelector {
visible: false
......@@ -88,7 +93,7 @@ AppletConfiguration {
opacityAnim.from = 1;
opacityAnim.to = 0;
opacityAnim.restart();
wallpaperSelectorLoader.item.open();
wallpaperSelectorLoader.active = true;
}
}
......@@ -104,7 +109,6 @@ AppletConfiguration {
text: i18n("Configure")
onClicked: {
appComponent.visible = true;
wallpaperSelectorLoader.item.close()
}
}
}
......
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