Commit 194483b0 authored by Eike Hein's avatar Eike Hein

Save an object per panel applet

Summary:
Instead of Item { Loader {} } just make the applet
container the Loader. Also saves some prop bindings
for sizing and centering the BusyIndicator, which
still appears correct.

Some props marked read-only as a bonus.

Reviewers: #plasma, mart

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9152
parent 1a45aaf9
......@@ -246,7 +246,9 @@ function checkLastSpacer() {
//BEGIN components
Component {
id: appletContainerComponent
Item {
// This loader conditionally manages the BusyIndicator, it's not
// loading the applet. The applet becomes a regular child item.
Loader {
id: container
visible: false
property bool animationsEnabled: true
......@@ -277,31 +279,25 @@ function checkLastSpacer() {
Layout.maximumWidth: (currentLayout.isLayoutHorizontal ? (applet && applet.Layout.maximumWidth > 0 ? applet.Layout.maximumWidth : (Layout.fillWidth ? root.width : root.height)) : root.height)
Layout.maximumHeight: (!currentLayout.isLayoutHorizontal ? (applet && applet.Layout.maximumHeight > 0 ? applet.Layout.maximumHeight : (Layout.fillHeight ? root.height : root.width)) : root.width)
property int oldX: x
property int oldY: y
readonly property int oldX: x
readonly property int oldY: y
property Item applet
onAppletChanged: {
if (!applet) {
destroy();
}
}
active: applet && applet.busy
sourceComponent: PlasmaComponents.BusyIndicator {}
Layout.onMinimumWidthChanged: movingForResize = true;
Layout.onMinimumHeightChanged: movingForResize = true;
Layout.onMaximumWidthChanged: movingForResize = true;
Layout.onMaximumHeightChanged: movingForResize = true;
Loader {
z: 1000
anchors.centerIn: parent
active: applet && applet.busy
sourceComponent: PlasmaComponents.BusyIndicator {
width: Math.min(container.width, container.height)
height: width
}
}
onXChanged: {
if (movingForResize) {
movingForResize = false;
......
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