mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
shell: Load wallpaper selector only when necessary
This commit is contained in:
parent
d8399e88be
commit
1919a39d81
3 changed files with 9 additions and 4 deletions
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue