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

@ -36,7 +36,7 @@ MouseEventListener {
height: mainLayout.Layout.minimumHeight
property int margin: stripe.height + units.gridUnit * 2
property Item draggingApplet
onPressAndHold: {
print(favoritesView.contains(mapToItem(favoritesView, mouse.x, mouse.y)))
if (!root.locked && !favoritesView.contains(mapToItem(favoritesView, mouse.x, mouse.y))) {

View file

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

View file

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