import QtQuick import Weave.Controls import Weave.Templates as T T.PanelLayout { id: layoutId leftPadding: leftInset + leftDock.width rightPadding: rightInset + rightDock.width topPadding: topInset + topDock.height bottomPadding: bottomInset + bottomDock.height implicitWidth: leftDock.implicitWidth + rightDock.implicitWidth + Math.max(implicitContentWidth, topDock.implicitWidth, bottomDock.implicitWidth) implicitHeight: Math.max( implicitContentHeight + topDock.implicitHeight + bottomDock.implicitHeight, leftDock.implicitHeight, rightDock.implicitHeight) TableLayout.minimumWidth: leftDock.minimumWidth + rightDock.minimumWidth + Math.max(minimumContentWidth, topDock.minimumWidth, bottomDock.minimumWidth) TableLayout.preferredWidth: leftDock.preferredWidth + rightDock.preferredWidth + Math.max(preferredContentWidth, topDock.preferredWidth, bottomDock.preferredWidth) TableLayout.minimumHeight: Math.max( minimumContentHeight + topDock.minimumHeight + bottomDock.minimumHeight, leftDock.minimumHeight, rightDock.minimumHeight) TableLayout.preferredHeight: Math.max( preferredContentHeight + topDock.preferredHeight + bottomDock.preferredHeight, leftDock.preferredHeight, rightDock.preferredHeight) dockThreshold: Theme.component.menu.minHeight / 2 resizeMargin: Theme.semantic.spacing.xxs/2 leftDock { y: topInset z: leftDock.dropTarget ? 1 : 0 width: leftDock.contentModel.count > 0 ? Math.max(leftDock.minimumWidth, Math.min( leftDockWidth, width - Math.max(minimumContentWidth, topDock.minimumWidth, bottomDock.minimumWidth) - rightDock.minimumWidth)) : 0 height: height - topInset - bottomInset minimumWidth: leftDock.contentItem ? leftDock.contentItem.TableLayout.minimumWidth : leftDock.implicitContentWidth minimumHeight: leftDock.contentItem ? leftDock.contentItem.TableLayout.minimumHeight : leftDock.implicitContentHeight preferredWidth: leftDock.contentItem ? leftDock.contentItem.TableLayout.preferredWidth : leftDock.implicitContentWidth preferredHeight: leftDock.contentItem ? leftDock.contentItem.TableLayout.preferredHeight : leftDock.implicitContentHeight objectName: layoutId.objectName + "Left"; contentItem: Flickable { id: leftFlickableId contentWidth: leftRowId.width + leftDividerId.width contentHeight: leftRowId.height visible: layoutId.leftDock.contentModel.count > 0 clip: contentWidth > width || contentHeight > height || contentX !== originX || contentY !== originY TableLayout.minimumWidth: leftDividerId.width + leftRowId.minimumColumnWidth TableLayout.minimumHeight: leftRowId.minimumHeight TableLayout.preferredWidth: leftDividerId.width + leftRowId.preferredWidth TableLayout.preferredHeight: leftRowId.preferredHeight TableLayoutRow { id: leftRowId width: Math.max(leftFlickableId.width - leftDividerId.width, minimumWidth) height: Math.max(leftFlickableId.height, minimumHeight) horizontalItemFillMode: TableLayout.Preferred verticalItemFillMode: TableLayout.Preferred Repeater { model: layoutId.leftDock.contentModel } } children: Rectangle { id: leftDividerId x: leftFlickableId.width - width width: Theme.component.divider.borderWidth height: leftFlickableId.height color: Theme.component.divider.strong.borderColor } } } rightDock { x: width - rightPadding y: topInset z: layoutId.rightDock.dropTarget ? 1 : 0 width: rightDock.contentModel.count > 0 ? Math.max(rightDock.minimumWidth, Math.min( rightDockWidth, width - Math.max(minimumContentWidth, topDock.minimumWidth, bottomDock.minimumWidth) - leftDock.width)) : 0 height: height - topInset - bottomInset minimumWidth: rightDock.contentItem ? rightDock.contentItem.TableLayout.minimumWidth : rightDock.implicitContentWidth minimumHeight: rightDock.contentItem ? rightDock.contentItem.TableLayout.minimumHeight : rightDock.implicitContentHeight preferredWidth: rightDock.contentItem ? rightDock.contentItem.TableLayout.preferredWidth : rightDock.implicitContentWidth preferredHeight: rightDock.contentItem ? rightDock.contentItem.TableLayout.preferredHeight : rightDock.implicitContentHeight objectName: layoutId.objectName + "Right"; contentItem: Flickable { id: rightFlickableId contentWidth: rightRowId.width + rightDividerId.width contentHeight: rightRowId.height visible: layoutId.rightDock.contentModel.count > 0 clip: contentWidth > width || contentHeight > height || contentX !== originX || contentY !== originY TableLayout.minimumWidth: rightDividerId.width + rightRowId.minimumColumnWidth TableLayout.minimumHeight: rightRowId.minimumHeight TableLayout.preferredWidth: rightDividerId.width + rightRowId.preferredWidth TableLayout.preferredHeight: rightRowId.preferredHeight TableLayoutRow { id: rightRowId x: rightDividerId.width width: Math.max(rightFlickableId.width - rightDividerId.width, minimumWidth) height: Math.max(rightFlickableId.height, minimumHeight) horizontalItemFillMode: TableLayout.Preferred verticalItemFillMode: TableLayout.Preferred layoutDirection: Qt.RightToLeft Repeater { model: layoutId.rightDock.contentModel } } children: Rectangle { id: rightDividerId width: Theme.component.divider.borderWidth height: rightFlickableId.height color: Theme.component.divider.strong.borderColor } } } topDock { x: leftPadding y: topInset z: layoutId.topDock.dropTarget ? 1 : 0 width: width - leftPadding - rightPadding height: topDock.contentModel.count > 0 ? Math.max(topDock.minimumHeight, Math.min(topDockHeight, height - minimumContentHeight - bottomDock.minimumHeight)) : 0 minimumWidth: topDock.contentItem ? topDock.contentItem.TableLayout.minimumWidth : topDock.implicitContentWidth minimumHeight: topDock.contentItem ? topDock.contentItem.TableLayout.minimumHeight : topDock.implicitContentHeight preferredWidth: topDock.contentItem ? topDock.contentItem.TableLayout.preferredWidth : topDock.implicitContentWidth preferredHeight: topDock.contentItem ? topDock.contentItem.TableLayout.preferredHeight : topDock.implicitContentHeight objectName: layoutId.objectName + "Top"; contentItem: Flickable { id: topFlickableId contentWidth: topRowId.width contentHeight: topRowId.height + topDividerId.height visible: layoutId.topDock.contentModel.count > 0 clip: contentWidth > width || contentHeight > height || contentX !== originX || contentY !== originY TableLayout.minimumWidth: topRowId.minimumColumnWidth TableLayout.minimumHeight: topDividerId.height + topRowId.minimumHeight TableLayout.preferredWidth: topRowId.preferredWidth TableLayout.preferredHeight: topDividerId.height + topRowId.preferredHeight TableLayoutRow { id: topRowId width: Math.max(topFlickableId.width, minimumWidth) height: Math.max(topFlickableId.height - topDividerId.height, minimumHeight) horizontalItemFillMode: TableLayout.Preferred verticalItemFillMode: TableLayout.Preferred Repeater { model: layoutId.topDock.contentModel } } children: Rectangle { id: topDividerId y: topFlickableId.height - height width: topFlickableId.width height: Theme.component.divider.borderWidth color: Theme.component.divider.strong.borderColor } } } bottomDock { x: leftPadding y: height - bottomPadding z: layoutId.bottomDock.dropTarget ? 1 : 0 width: width - leftPadding - rightPadding height: bottomDock.contentModel.count > 0 ? Math.max(bottomDock.minimumHeight, Math.min(bottomDockHeight, height - minimumContentHeight - topDock.height)) : 0 minimumWidth: bottomDock.contentItem ? bottomDock.contentItem.TableLayout.minimumWidth : bottomDock.implicitContentWidth minimumHeight: bottomDock.contentItem ? bottomDock.contentItem.TableLayout.minimumHeight : bottomDock.implicitContentHeight preferredWidth: bottomDock.contentItem ? bottomDock.contentItem.TableLayout.preferredWidth : bottomDock.implicitContentWidth preferredHeight: bottomDock.contentItem ? bottomDock.contentItem.TableLayout.preferredHeight : bottomDock.implicitContentHeight objectName: layoutId.objectName + "Bottom"; contentItem: Flickable { id: bottomFlickableId contentWidth: bottomRowId.width contentHeight: bottomRowId.height + topDividerId.height visible: layoutId.bottomDock.contentModel.count > 0 clip: contentWidth > width || contentHeight > height || contentX !== originX || contentY !== originY TableLayout.minimumWidth: bottomRowId.minimumColumnWidth TableLayout.minimumHeight: bottomDividerId.height + bottomRowId.minimumHeight TableLayout.preferredWidth: bottomRowId.preferredWidth TableLayout.preferredHeight: bottomDividerId.height + bottomRowId.preferredHeight TableLayoutRow { id: bottomRowId y: bottomDividerId.height width: Math.max(bottomFlickableId.width, minimumWidth) height: Math.max(bottomFlickableId.height - bottomDividerId.height, minimumHeight) horizontalItemFillMode: TableLayout.Preferred verticalItemFillMode: TableLayout.Preferred Repeater { model: layoutId.bottomDock.contentModel } } children: Rectangle { id: bottomDividerId width: bottomFlickableId.width height: Theme.component.divider.borderWidth color: Theme.component.divider.strong.borderColor } } } contentItem: Item { id: content Repeater { model: layoutId.contentModel } } data: T.CellBackground { parent: layoutId.dropTarget anchors.fill: parent borderColor: Theme.generic.color.blue._400._100 z: 1000 borderWidth: Theme.generic.borderWidth._4 leftBorderWidth: (layoutId.dropAlignment & Qt.AlignLeft) ? undefined : 0 rightBorderWidth: (layoutId.dropAlignment & Qt.AlignRight) ? undefined : 0 topBorderWidth: (layoutId.dropAlignment & Qt.AlignTop) ? undefined : 0 bottomBorderWidth: (layoutId.dropAlignment & Qt.AlignBottom) ? undefined : 0 } }