containment:use static dragoverlay

--do not create/destroy it, its time we get
into rearrange widgets mode
pull/19/head
Michail Vourlakos 5 years ago
parent b2ae994614
commit d7b56b9316

@ -364,7 +364,7 @@ Item {
property var iconsArray: [16, 22, 32, 48, 64, 96, 128, 256] property var iconsArray: [16, 22, 32, 48, 64, 96, 128, 256]
property Item dragOverlay property Item dragOverlay: _dragOverlay
property Item toolBox property Item toolBox
property Item latteAppletContainer property Item latteAppletContainer
property Item latteApplet property Item latteApplet
@ -669,32 +669,10 @@ Item {
} }
Plasmoid.onUserConfiguringChanged: { Plasmoid.onUserConfiguringChanged: {
if (plasmoid.immutable) {
if (dragOverlay) {
dragOverlay.destroy();
}
return;
}
// console.debug("user configuring", plasmoid.userConfiguring)
if (plasmoid.userConfiguring) { if (plasmoid.userConfiguring) {
// console.log("applets------");
for (var i = 0; i < plasmoid.applets.length; ++i) { for (var i = 0; i < plasmoid.applets.length; ++i) {
// console.log("applet:"+i);
plasmoid.applets[i].expanded = false; plasmoid.applets[i].expanded = false;
} }
if (!dragOverlay) {
var component = Qt.createComponent("editmode/ConfigOverlay.qml");
if (component.status === Component.Ready) {
dragOverlay = component.createObject(root);
} else {
console.log("Could not create ConfigOverlay");
console.log(component.errorString());
}
component.destroy();
}
} }
} }
@ -702,26 +680,6 @@ Item {
plasmoid.action("configure").visible = !plasmoid.immutable; plasmoid.action("configure").visible = !plasmoid.immutable;
plasmoid.action("configure").enabled = !plasmoid.immutable; plasmoid.action("configure").enabled = !plasmoid.immutable;
///Set Preferred Sizes///
///Notice: they are set here because if they are set with a binding
///they break the !immutable experience, the latteView becomes too small
///to add applets
/* if (plasmoid.immutable) {
if(root.isHorizontal) {
root.Layout.preferredWidth = (plasmoid.configuration.alignment === LatteCore.Types.Justify ?
layoutsContainer.width + 0.5*iconMargin : layoutsContainer.mainLayout.width + iconMargin);
} else {
root.Layout.preferredHeight = (plasmoid.configuration.alignment === LatteCore.Types.Justify ?
layoutsContainer.height + 0.5*iconMargin : layoutsContainer.mainLayout.height + iconMargin);
}
} else {
if (root.isHorizontal) {
root.Layout.preferredWidth = Screen.width;
} else {
root.Layout.preferredHeight = Screen.height;
}
}*/
visibilityManager.updateMaskArea(); visibilityManager.updateMaskArea();
} }
//////////////END OF CONNECTIONS //////////////END OF CONNECTIONS
@ -1396,6 +1354,10 @@ Item {
id: colorizerManager id: colorizerManager
} }
EditMode.ConfigOverlay{
id: _dragOverlay
}
Item { Item {
id: dndSpacer id: dndSpacer

Loading…
Cancel
Save