mirror of
https://github.com/KDE/latte-dock.git
synced 2025-02-11 01:58:44 +03:00
drop lastSpacer and fix addsplitters
This commit is contained in:
parent
177f8f9b39
commit
98e89d6e39
@ -24,7 +24,6 @@ var layoutE;
|
|||||||
var root;
|
var root;
|
||||||
var metrics;
|
var metrics;
|
||||||
var plasmoid;
|
var plasmoid;
|
||||||
var lastSpacer;
|
|
||||||
|
|
||||||
var childFoundId = 11;
|
var childFoundId = 11;
|
||||||
var inRestore=false;
|
var inRestore=false;
|
||||||
|
@ -149,7 +149,7 @@ MouseArea {
|
|||||||
} else {
|
} else {
|
||||||
var item = hoveredItem(mouse.x, mouse.y);
|
var item = hoveredItem(mouse.x, mouse.y);
|
||||||
|
|
||||||
if (root.dragOverlay && item && item !== lastSpacer) {
|
if (root.dragOverlay) {
|
||||||
root.dragOverlay.currentApplet = item;
|
root.dragOverlay.currentApplet = item;
|
||||||
} else {
|
} else {
|
||||||
currentApplet = null;
|
currentApplet = null;
|
||||||
|
@ -369,7 +369,7 @@ Item {
|
|||||||
|
|
||||||
for (var i=tempLength-1; i>=0; --i) {
|
for (var i=tempLength-1; i>=0; --i) {
|
||||||
var applet = layoutsContainer.mainLayout.children[i];
|
var applet = layoutsContainer.mainLayout.children[i];
|
||||||
if (applet && (applet === dndSpacer || applet === lastSpacer || applet.isInternalViewSplitter))
|
if (applet && (applet === dndSpacer || applet.isInternalViewSplitter))
|
||||||
count1--;
|
count1--;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,7 +378,7 @@ Item {
|
|||||||
|
|
||||||
for (var i=tempLength-1; i>=0; --i) {
|
for (var i=tempLength-1; i>=0; --i) {
|
||||||
var applet = layoutsContainer.endLayout.children[i];
|
var applet = layoutsContainer.endLayout.children[i];
|
||||||
if (applet && (applet === dndSpacer || applet === lastSpacer || applet.isInternalViewSplitter))
|
if (applet && (applet === dndSpacer || applet.isInternalViewSplitter))
|
||||||
count2--;
|
count2--;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -545,7 +545,6 @@ Item {
|
|||||||
LayoutManager.layout = layoutsContainer.mainLayout;
|
LayoutManager.layout = layoutsContainer.mainLayout;
|
||||||
LayoutManager.layoutS = layoutsContainer.startLayout;
|
LayoutManager.layoutS = layoutsContainer.startLayout;
|
||||||
LayoutManager.layoutE = layoutsContainer.endLayout;
|
LayoutManager.layoutE = layoutsContainer.endLayout;
|
||||||
LayoutManager.lastSpacer = lastSpacer;
|
|
||||||
LayoutManager.metrics = metrics;
|
LayoutManager.metrics = metrics;
|
||||||
|
|
||||||
upgrader_v010_alignment();
|
upgrader_v010_alignment();
|
||||||
@ -602,9 +601,6 @@ Item {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!flexibleFound) {
|
|
||||||
lastSpacer.parent = layoutsContainer.mainLayout;
|
|
||||||
}
|
|
||||||
|
|
||||||
fastLayoutManager.save();
|
fastLayoutManager.save();
|
||||||
}
|
}
|
||||||
@ -661,10 +657,6 @@ Item {
|
|||||||
// Fall through to adding at the end of main layout.
|
// Fall through to adding at the end of main layout.
|
||||||
appletItem.parent = layoutsContainer.mainLayout;
|
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(){
|
function addInternalViewSplittersInMainLayout(){
|
||||||
@ -875,22 +867,6 @@ Item {
|
|||||||
sourceComponent: Debugger.DebugWindow{}
|
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{
|
Loader{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
active: debug.graphicsEnabled
|
active: debug.graphicsEnabled
|
||||||
|
@ -600,13 +600,19 @@ void LayoutManager::addJustifySplittersInMainLayout()
|
|||||||
splitterItem->setParentItem(m_mainLayout);
|
splitterItem->setParentItem(m_mainLayout);
|
||||||
|
|
||||||
if (size>0 && splitterIndex>=0) {
|
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];
|
QQuickItem *currentitem = m_mainLayout->childItems()[validindex];
|
||||||
|
|
||||||
|
if (atend) {
|
||||||
splitterItem->stackAfter(currentitem);
|
splitterItem->stackAfter(currentitem);
|
||||||
|
} else {
|
||||||
|
splitterItem->stackBefore(currentitem);
|
||||||
|
}
|
||||||
} else if (size>0) {
|
} else if (size>0) {
|
||||||
//! add in first position
|
//! add in first position
|
||||||
QQuickItem *currentitem = m_mainLayout->childItems()[0];
|
QQuickItem *currentitem = m_mainLayout->childItems()[0];
|
||||||
splitterItem->stackAfter(currentitem);
|
splitterItem->stackBefore(currentitem);
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Second Splitter
|
//! Second Splitter
|
||||||
@ -619,9 +625,15 @@ void LayoutManager::addJustifySplittersInMainLayout()
|
|||||||
splitterItem2->setParentItem(m_mainLayout);
|
splitterItem2->setParentItem(m_mainLayout);
|
||||||
|
|
||||||
if (size2>0 && splitterIndex2>=0) {
|
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];
|
QQuickItem *currentitem2 = m_mainLayout->childItems()[validindex2];
|
||||||
|
|
||||||
|
if (atend) {
|
||||||
splitterItem2->stackAfter(currentitem2);
|
splitterItem2->stackAfter(currentitem2);
|
||||||
|
} else {
|
||||||
|
splitterItem2->stackBefore(currentitem2);
|
||||||
|
}
|
||||||
} else if (size2>1){
|
} else if (size2>1){
|
||||||
//! add in last position
|
//! add in last position
|
||||||
QQuickItem *currentitem2 = m_mainLayout->childItems()[size2-1];
|
QQuickItem *currentitem2 = m_mainLayout->childItems()[size2-1];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user