use the lastspacer when needed

This commit is contained in:
Marco Martin 2015-07-09 13:29:26 +02:00
parent 4024edb277
commit 4500b17a92

View file

@ -99,6 +99,26 @@ Item {
scrollUpIndicator.opacity = 0; scrollUpIndicator.opacity = 0;
scrollDownIndicator.opacity = 0; scrollDownIndicator.opacity = 0;
} }
function checkLastSpacer() {
appletsSpace.lastSpacer.parent = root
var expands = false;
for (var container in appletsSpace.layout.children) {
var item = appletsSpace.layout.children[container];
if (item.Layout && item.Layout.fillHeight) {
expands = true;
}
}
if (!expands) {
appletsSpace.lastSpacer.parent = appletsSpace.layout;
}
}
//END functions //END functions
//BEGIN slots //BEGIN slots
@ -165,10 +185,8 @@ Item {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: applet && applet.Layout.fillHeight Layout.fillHeight: applet && applet.Layout.fillHeight
Layout.onFillHeightChanged: { Layout.onFillHeightChanged: {
if (plasmoid.formFactor == PlasmaCore.Types.Vertical) {
checkLastSpacer(); checkLastSpacer();
} }
}
Connections { Connections {
target: plasmoid target: plasmoid