improve LayoutManager qml references

pull/4/head
Michail Vourlakos
parent e81ef199b3
commit 81335bc92f

@ -96,9 +96,9 @@ MouseArea {
if ((plasmoid.formFactor === PlasmaCore.Types.Vertical && posInItem.y < item.height/2) ||
(plasmoid.formFactor !== PlasmaCore.Types.Vertical && posInItem.x < item.width/2)) {
root.layoutManager.insertBefore(item, placeHolder);
root.layoutManagerInsertBefore(item, placeHolder);
} else {
root.layoutManager.insertAfter(item, placeHolder);
root.layoutManagerInsertAfter(item, placeHolder);
}
}
@ -198,7 +198,7 @@ MouseArea {
placeHolder.height = currentApplet.height;
handle.width = currentApplet.width;
handle.height = currentApplet.height;
root.layoutManager.insertBefore(currentApplet, placeHolder);
root.layoutManagerInsertBefore(currentApplet, placeHolder);
currentApplet.parent = root;
currentApplet.x = lastX-appletX;
currentApplet.y = lastY-appletY;
@ -221,7 +221,7 @@ MouseArea {
configurationArea.isResizingLeft = false;
configurationArea.isResizingRight = false;
root.layoutManager.insertBefore(placeHolder, currentApplet);
root.layoutManagerInsertBefore(placeHolder, currentApplet);
placeHolder.parent = configurationArea;
currentApplet.z = 1;
@ -231,7 +231,7 @@ MouseArea {
handle.y = relevantLayout.y + currentApplet.y;
// handle.width = currentApplet.width;
// handle.height = currentApplet.height;
root.layoutManager.save();
root.layoutManagerSave();
}
onWheel: {
@ -489,7 +489,7 @@ MouseArea {
onCheckedChanged: {
currentApplet.lockZoom = checked;
root.layoutManager.saveLocks();
root.layoutManagerSaveLocks();
}
}

@ -51,7 +51,7 @@ Item{
property rect efGeometry
property string layoutColor: root.latteViewManagedLayout ? root.latteViewManagedLayout.color : "blue"
property string layoutColor: latteView && latteView.managedLayout ? latteView.managedLayout.color : "blue"
Item{

@ -193,7 +193,7 @@ Item{
Connections{
target: universalLayoutManager
onCurrentLayoutIsSwitching: {
if (Latte.WindowSystem.compositingActive && root.latteViewManagedLayout && root.latteViewManagedLayout.name === layoutName) {
if (Latte.WindowSystem.compositingActive && latteView && latteView.managedLayout && latteView.managedLayout.name === layoutName) {
manager.inTempHiding = true;
manager.inForceHiding = true;
root.clearZoom();

@ -338,7 +338,6 @@ DragDrop.DropArea {
}
property var iconsArray: [16, 22, 32, 48, 64, 96, 128, 256]
property var layoutManager: LayoutManager
property Item dragOverlay
property Item toolBox
@ -717,7 +716,7 @@ DragDrop.DropArea {
LayoutManager.root = root;
LayoutManager.layout = layoutsContainer.mainLayout;
LayoutManager.layoutS = layoutsContainer.startLayout;
layoutManager.layoutE = layoutsContainer.endLayout;
LayoutManager.layoutE = layoutsContainer.endLayout;
LayoutManager.lastSpacer = lastSpacer;
LayoutManager.restore();
plasmoid.action("configure").visible = !plasmoid.immutable;
@ -947,12 +946,12 @@ DragDrop.DropArea {
container.visible = true;
if(pos>=0 ){
layoutManager.insertAtIndex(container, pos);
LayoutManager.insertAtIndex(container, pos);
} else {
layoutManager.insertAtIndex(container, Math.floor(layoutsContainer.mainLayout.count / 2));
LayoutManager.insertAtIndex(container, Math.floor(layoutsContainer.mainLayout.count / 2));
}
layoutManager.save();
LayoutManager.save();
}
}
@ -1071,6 +1070,22 @@ DragDrop.DropArea {
}
}
function layoutManagerInsertBefore(place, item) {
LayoutManager.insertBefore(place, item);
}
function layoutManagerInsertAfter(place, item) {
LayoutManager.insertAfter(place, item);
}
function layoutManagerSave() {
LayoutManager.save();
}
function layoutManagerSaveLocks() {
LayoutManager.saveLocks();
}
function mouseInCanBeHoveredApplet(){
if (latteApplet && latteApplet.containsMouse())
return true;
@ -1120,7 +1135,7 @@ DragDrop.DropArea {
item.destroy();
}
layoutManager.save();
LayoutManager.save();
}
function setHoveredIndex(ind) {

Loading…
Cancel
Save