pragma ComponentBehavior: Bound import QtQuick import Weave.Controls import Weave.Templates as T T.PanelContainer { id: containerId TableLayout.minimumWidth: leftPadding + rightPadding + Math.max( contentItem ? contentItem.minimumWidth : implicitContentWidth, implicitBackgroundWidth) TableLayout.preferredWidth: leftPadding + rightPadding + Math.max( contentItem ? contentItem.preferredWidth : implicitContentWidth, implicitBackgroundWidth) TableLayout.minimumHeight: topPadding + bottomPadding + (contentItem ? contentItem.minimumHeight : implicitContentHeight) TableLayout.preferredHeight: { if (explicitDockedHeight && !TableLayout.isBottomItem) { return dockedHeight } else if (contentItem) { return contentItem.preferredHeight + topPadding + bottomPadding } else { return implicitContentHeight + topPadding + bottomPadding } } TableLayout.verticalFillMode: explicitDockedHeight && !TableLayout.isBottomItem ? TableLayout.Fixed : undefined implicitWidth: implicitContentWidth + leftPadding + rightPadding implicitHeight: implicitContentHeight + topPadding + bottomPadding bottomPadding: implicitBackgroundHeight dockThreshold: Theme.component.menu.minHeight / 2 tabBar: PanelTabBar { container: containerId visible: !containerId.headerVisible || contentModel.count > 1 } placeholderDelegate: T.PanelPlaceholder { background: Rectangle { color: Theme.semantic.container.background.color } } contentItem: TableLayoutColumn { id: contentId rowItem: containerId horizontalItemFillMode: TableLayout.Preferred verticalItemFillMode: TableLayout.Fixed PanelContainerHeader { id: headerId readonly property T.Panel onlyPanel: containerId.panelModel.count === 1 ? (containerId.panelModel.items, containerId.panelModel.get(0)) : null container: containerId contentVisible: containerId.panelModel.count < 2 icon: onlyPanel ? onlyPanel.icon : undefined text: onlyPanel ? onlyPanel.text : "" closeButtonVisible: onlyPanel && onlyPanel.closeButtonVisible visible: containerId.headerVisible } Rectangle { implicitHeight: Theme.component.divider.borderWidth color: Theme.component.divider.strong.borderColor visible: containerId.headerVisible } TableLayoutLoader { id: tabBarId sourceComponent: containerId.tabBar } TableLayoutStack { id: tabStackId TableLayout.verticalFillMode: TableLayout.Expanding horizontalItemFillMode: TableLayout.Preferred verticalItemFillMode: TableLayout.Preferred objectName: containerId.objectName currentIndex: containerId.currentIndex Repeater { model: containerId.panelItemModel } } T.CellBackground { parent: containerId.dropTarget === containerId ? tabStackId : containerId.dropTarget anchors.fill: parent borderColor: Theme.generic.color.blue._400._100 borderWidth: Theme.generic.borderWidth._4 leftBorderWidth: (containerId.dropAlignment & Qt.AlignLeft) ? undefined : 0 rightBorderWidth: (containerId.dropAlignment & Qt.AlignRight) ? undefined : 0 topBorderWidth: (containerId.dropAlignment & Qt.AlignTop) ? undefined : 0 bottomBorderWidth: (containerId.dropAlignment & Qt.AlignBottom) ? undefined : 0 TableLayout.exclude: true } } background: Rectangle { id: backgroundId color: Theme.semantic.backgroundColor.surface._100 implicitWidth: containerId.TableLayout.isBottomItem ? 0 : panelResizeHandleId.implicitWidth implicitHeight: containerId.TableLayout.isBottomItem ? 0 : panelResizeHandleId.implicitHeight PanelResizeHandle { id: panelResizeHandleId y: backgroundId.height - height width: backgroundId.width resizeItem: containerId visible: !containerId.TableLayout.isBottomItem orientation: Qt.Vertical } } }