nicer expanded applets in homescreen

This commit is contained in:
Marco Martin 2015-06-20 17:29:24 -07:00
parent b3e1fbea95
commit 434665decb
3 changed files with 9 additions and 3 deletions

View file

@ -159,6 +159,7 @@ Item {
//not used yet //not used yet
property bool animationsEnabled: false property bool animationsEnabled: false
property Item applet property Item applet
z: applet && applet.compactRepresentationItem && applet.expanded ? 99 : 0
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: applet && applet.Layout.fillHeight Layout.fillHeight: applet && applet.Layout.fillHeight
Layout.onFillHeightChanged: { Layout.onFillHeightChanged: {
@ -166,6 +167,7 @@ Item {
checkLastSpacer(); checkLastSpacer();
} }
} }
onAppletChanged: { onAppletChanged: {
if (applet.backgroundHints == PlasmaCore.Types.StandardBackground) { if (applet.backgroundHints == PlasmaCore.Types.StandardBackground) {
applet.anchors.margins = background.margins.top; applet.anchors.margins = background.margins.top;

View file

@ -42,13 +42,14 @@ Item {
} }
onFullRepresentationChanged: { onFullRepresentationChanged: {
print(fullRepresentation);
if (!fullRepresentation) { if (!fullRepresentation) {
return; return;
} }
fullRepresentation.parent = appletParent; fullRepresentation.parent = appletParent;
fullRepresentation.anchors.fill = fullRepresentation.parent; fullRepresentation.anchors.fill = fullRepresentation.parent;
fullRepresentation.anchors.margins = appletParent.margins.top;
} }
Rectangle { Rectangle {
@ -63,8 +64,11 @@ Item {
visible: plasmoid.expanded visible: plasmoid.expanded
} }
Item { PlasmaCore.FrameSvgItem {
id: appletParent id: appletParent
imagePath: "widgets/background"
visible: fullRepresentation.parent == appletParent
z: 99
opacity: plasmoid.expanded ? 1 : 0 opacity: plasmoid.expanded ? 1 : 0
anchors.top: parent.top anchors.top: parent.top
width: parent.width width: parent.width