Commit 97e81ff1 authored by Ronan's avatar Ronan
Browse files

TMP

parent f9bebf12
......@@ -8,21 +8,28 @@ Item {
property alias childA: contentA.data
property alias childB: contentB.data
onWidthChanged: {
console.log('RESIZE', width, handleLimitRight)
if (contentB.width < handleLimitRight) {
console.log('lala', width, handleLimitRight, width - handle.width - handleLimitRight)
contentA.width = width - handle.width - handleLimitRight
} else if (contentA.width < handleLimitLeft) {
console.log('zaza', width, handleLimitLeft)
property bool useDynamicLimits: true
function updateContentA () {
// width(A) < minimum width(A)
if (contentA.width < handleLimitLeft) {
contentA.width = handleLimitLeft
} else if (contentA.width >= width - handleLimitRight - 20) {
console.log('FUCK', contentA.width , width - handleLimitRight - 20)
contentA.width - handle.width - handleLimitRight
}
// width(B) < minimum width(B)
else if (width - contentA.width - handle.width < handleLimitRight) {
contentA.width = width - handle.width - handleLimitRight
}
}
onHandleLimitLeftChanged: updateContentA()
onHandleLimitRightChanged: updateContentA()
onWidthChanged: !useDynamicLimits && updateContentA()
Component.onCompleted: {
contentA.width = handleLimitLeft
}
Rectangle {
id: contentA
......@@ -49,11 +56,16 @@ Item {
var offset = mouseX - _mouseStart
// width(B) < minimum width(B)
if (container.width - offset - contentA.width - width < handleLimitRight) {
contentA.width = container.width - width - handleLimitRight
} else if (contentA.width + offset < handleLimitLeft) {
}
// width(A) < minimum width(A)
else if (contentA.width + offset < handleLimitLeft) {
contentA.width = handleLimitLeft
} else {
}
// Resize A/B.
else {
contentA.width = contentA.width + offset
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment