mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
feat(Paned): it is possible to define the default area to resize when window is resized
This commit is contained in:
parent
cf031ea434
commit
c6d0d18884
2 changed files with 23 additions and 9 deletions
|
|
@ -26,8 +26,10 @@ Item {
|
|||
|
||||
property alias childA: contentA.data
|
||||
property alias childB: contentB.data
|
||||
property bool defaultClosed
|
||||
property bool defaultClosed: false
|
||||
property int closingEdge: Qt.LeftEdge
|
||||
property int defaultChildAWidth
|
||||
property bool resizeAInPriority: false
|
||||
|
||||
// User limits: string or int values.
|
||||
// By default: no limits.
|
||||
|
|
@ -107,6 +109,8 @@ Item {
|
|||
// width(B) > maximum width(B).
|
||||
else if (maximumRightLimit != null && theoreticalBWidth > maximumRightLimit) {
|
||||
contentA.width = container.width - handle.width - maximumRightLimit
|
||||
} else if (resizeAInPriority) {
|
||||
contentA.width = container.width - handle.width - contentB.width
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -210,10 +214,12 @@ Item {
|
|||
_minimumLeftLimit = _parseLimit(minimumLeftLimit)
|
||||
_minimumRightLimit = _parseLimit(minimumRightLimit)
|
||||
|
||||
_isClosed = defaultClosed
|
||||
contentA.width = _getLimitValue(_minimumLeftLimit)
|
||||
contentA.width = (defaultChildAWidth == null)
|
||||
? _getLimitValue(_minimumLeftLimit)
|
||||
: defaultChildAWidth
|
||||
|
||||
_applyLimits()
|
||||
_isClosed = defaultClosed
|
||||
_savedContentAWidth = contentA.width
|
||||
}
|
||||
|
||||
Item {
|
||||
|
|
|
|||
|
|
@ -6,16 +6,18 @@ import QtQuick.Controls 2.0
|
|||
import Linphone 1.0
|
||||
|
||||
Window {
|
||||
minimumHeight: 480
|
||||
minimumWidth: 780
|
||||
|
||||
id: window
|
||||
|
||||
minimumHeight: 480
|
||||
minimumWidth: 960
|
||||
|
||||
Paned {
|
||||
anchors.fill: parent
|
||||
defaultChildAWidth: 250
|
||||
maximumLeftLimit: 300
|
||||
minimumLeftLimit: 50
|
||||
|
||||
// Calls list.
|
||||
childA: Rectangle {
|
||||
anchors.fill: parent
|
||||
color: 'yellow'
|
||||
|
|
@ -25,13 +27,17 @@ Window {
|
|||
}
|
||||
}
|
||||
|
||||
// Call / Chat.
|
||||
childB: Paned {
|
||||
anchors.fill: parent
|
||||
closingEdge: Qt.RightEdge
|
||||
defaultChildAWidth: 300
|
||||
defaultClosed: true
|
||||
minimumLeftLimit: '40%'
|
||||
minimumRightLimit: 200
|
||||
minimumLeftLimit: 250
|
||||
minimumRightLimit: 350
|
||||
resizeAInPriority: true
|
||||
|
||||
// Call.
|
||||
childA: Rectangle {
|
||||
anchors.fill: parent
|
||||
color: 'orange'
|
||||
|
|
@ -41,9 +47,11 @@ Window {
|
|||
}
|
||||
}
|
||||
|
||||
// Chat.
|
||||
childB: Rectangle {
|
||||
anchors.fill: parent
|
||||
color: 'green'
|
||||
|
||||
Text {
|
||||
text: 'hello2'
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue