mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-02 09:48:50 +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
|
clip: true
|
||||||
|
|
||||||
readonly property int reservedSpaceForLabel: metrics.height
|
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)
|
cellWidth: effectiveContentWidth / Math.min(Math.floor(effectiveContentWidth / (PlasmaCore.Units.iconSizes.huge + Kirigami.Units.largeSpacing * 2)), 8)
|
||||||
cellHeight: cellWidth + reservedSpaceForLabel
|
cellHeight: cellWidth + reservedSpaceForLabel
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,7 @@ Item {
|
||||||
interactive: root.interactive
|
interactive: root.interactive
|
||||||
leftMargin: column.horizontalMargin
|
leftMargin: column.horizontalMargin
|
||||||
rightMargin: column.horizontalMargin
|
rightMargin: column.horizontalMargin
|
||||||
|
effectiveContentWidth: swipeView.width - leftMargin - rightMargin
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,10 +34,15 @@ AppletConfiguration {
|
||||||
}
|
}
|
||||||
//END model
|
//END model
|
||||||
|
|
||||||
|
// the wallpaper selector is quite heavy, so only load it when needed
|
||||||
Loader {
|
Loader {
|
||||||
id: wallpaperSelectorLoader
|
id: wallpaperSelectorLoader
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
active: true
|
active: false
|
||||||
|
|
||||||
|
onLoaded: {
|
||||||
|
wallpaperSelectorLoader.item.open();
|
||||||
|
}
|
||||||
|
|
||||||
sourceComponent: WallpaperSelector {
|
sourceComponent: WallpaperSelector {
|
||||||
visible: false
|
visible: false
|
||||||
|
|
@ -88,7 +93,7 @@ AppletConfiguration {
|
||||||
opacityAnim.from = 1;
|
opacityAnim.from = 1;
|
||||||
opacityAnim.to = 0;
|
opacityAnim.to = 0;
|
||||||
opacityAnim.restart();
|
opacityAnim.restart();
|
||||||
wallpaperSelectorLoader.item.open();
|
wallpaperSelectorLoader.active = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -104,7 +109,6 @@ AppletConfiguration {
|
||||||
text: i18n("Configure")
|
text: i18n("Configure")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
appComponent.visible = true;
|
appComponent.visible = true;
|
||||||
wallpaperSelectorLoader.item.close()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue