drop lastSpacer and fix addsplitters

work/spdx
Michail Vourlakos 4 years ago
parent 177f8f9b39
commit 98e89d6e39

@ -24,7 +24,6 @@ var layoutE;
var root;
var metrics;
var plasmoid;
var lastSpacer;
var childFoundId = 11;
var inRestore=false;

@ -149,7 +149,7 @@ MouseArea {
} else {
var item = hoveredItem(mouse.x, mouse.y);
if (root.dragOverlay && item && item !== lastSpacer) {
if (root.dragOverlay) {
root.dragOverlay.currentApplet = item;
} else {
currentApplet = null;

@ -369,7 +369,7 @@ Item {
for (var i=tempLength-1; i>=0; --i) {
var applet = layoutsContainer.mainLayout.children[i];
if (applet && (applet === dndSpacer || applet === lastSpacer || applet.isInternalViewSplitter))
if (applet && (applet === dndSpacer || applet.isInternalViewSplitter))
count1--;
}
@ -378,7 +378,7 @@ Item {
for (var i=tempLength-1; i>=0; --i) {
var applet = layoutsContainer.endLayout.children[i];
if (applet && (applet === dndSpacer || applet === lastSpacer || applet.isInternalViewSplitter))
if (applet && (applet === dndSpacer || applet.isInternalViewSplitter))
count2--;
}
@ -545,7 +545,6 @@ Item {
LayoutManager.layout = layoutsContainer.mainLayout;
LayoutManager.layoutS = layoutsContainer.startLayout;
LayoutManager.layoutE = layoutsContainer.endLayout;
LayoutManager.lastSpacer = lastSpacer;
LayoutManager.metrics = metrics;
upgrader_v010_alignment();
@ -602,9 +601,6 @@ Item {
break
}
}
if (!flexibleFound) {
lastSpacer.parent = layoutsContainer.mainLayout;
}
fastLayoutManager.save();
}
@ -661,10 +657,6 @@ Item {
// Fall through to adding at the end of main layout.
appletItem.parent = layoutsContainer.mainLayout;
}
//Important, removes the first children of the layoutsContainer.mainLayout after the first applet has been added
lastSpacer.parent = root;
updateIndexes();
}
function addInternalViewSplittersInMainLayout(){
@ -875,22 +867,6 @@ Item {
sourceComponent: Debugger.DebugWindow{}
}
Item {
id: lastSpacer
parent: layoutsContainer.mainLayout
Layout.fillWidth: true
Layout.fillHeight: true
z:10
Rectangle{
anchors.fill: parent
color: "transparent"
border.color: "yellow"
border.width: 1
}
}
Loader{
anchors.fill: parent
active: debug.graphicsEnabled

@ -600,13 +600,19 @@ void LayoutManager::addJustifySplittersInMainLayout()
splitterItem->setParentItem(m_mainLayout);
if (size>0 && splitterIndex>=0) {
int validindex = (splitterIndex < size) ? splitterIndex : size-1;
bool atend = (splitterIndex >= size);
int validindex = atend ? size-1 : splitterIndex;
QQuickItem *currentitem = m_mainLayout->childItems()[validindex];
splitterItem->stackAfter(currentitem);
if (atend) {
splitterItem->stackAfter(currentitem);
} else {
splitterItem->stackBefore(currentitem);
}
} else if (size>0) {
//! add in first position
QQuickItem *currentitem = m_mainLayout->childItems()[0];
splitterItem->stackAfter(currentitem);
splitterItem->stackBefore(currentitem);
}
//! Second Splitter
@ -619,9 +625,15 @@ void LayoutManager::addJustifySplittersInMainLayout()
splitterItem2->setParentItem(m_mainLayout);
if (size2>0 && splitterIndex2>=0) {
int validindex2 = (splitterIndex2 < size2) ? splitterIndex2 : size2-1;
bool atend = (splitterIndex2 >= size2);
int validindex2 = atend ? size2-1 : splitterIndex2;
QQuickItem *currentitem2 = m_mainLayout->childItems()[validindex2];
splitterItem2->stackAfter(currentitem2);
if (atend) {
splitterItem2->stackAfter(currentitem2);
} else {
splitterItem2->stackBefore(currentitem2);
}
} else if (size2>1){
//! add in last position
QQuickItem *currentitem2 = m_mainLayout->childItems()[size2-1];

Loading…
Cancel
Save