pragma ComponentBehavior: Bound import QtQuick import Weave.Templates as T import Weave.Controls T.TabBar { id: root implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding) spacing: style === TabBar.Underline && !fullWidth ? Theme.component.tab.underline.marginRight : 0 hoverEnabled: root.enabled contentItem: ListView { id: listView clip: true model: root.contentModel currentIndex: root.currentIndex spacing: root.spacing orientation: (root.style === TabBar.Underline || root.accentEdge === TabBar.TopEdge || root.accentEdge === TabBar.BottomEdge) ? ListView.Horizontal : ListView.Vertical boundsBehavior: Flickable.StopAtBounds flickableDirection: Flickable.AutoFlickIfNeeded snapMode: ListView.SnapToItem T.MouseWheelFilter.enabled: true ScrollBar.vertical: ScrollBar { active: listView.contentHeight > listView.height } footer: (root.style === TabBar.Canvas && root.addTabButtonVisible) ? addTabButtonComponent : null Component { id: addTabButtonComponent IconButton { id: addTabButton icon.name: Theme.icon.extraSmall("operator-plus") icon.color: addTabButton.pressed ? Theme.component.iconbutton.icon.fill.pressed : ((addTabButton.enabled && addTabButton.hovered) || addTabButton.visualFocus) ? Theme.component.iconbutton.icon.fill.hover : Theme.component.iconbutton.icon.fill.default checkable: false onClicked: root.addTabButtonClicked() leftPadding: !mirrored ? 0 : _triangleWidth rightPadding: mirrored ? Theme.component.tablist.canvas.paddingRight : _triangleWidth leftInset: mirrored ? _triangleWidth : 0 rightInset: !mirrored ? _triangleWidth : 0 property real _triangleWidth: Math.round(bgItem.height * Theme.autodeskAngleTan) background: Item { id: bgItem implicitWidth: Theme.component.tab.icon.width implicitHeight: listView.height opacity: root.enabled ? 1.0 : Theme.component.tab.opacity.disabled Rectangle { id: bgRect width: bgItem.width + addTabButton._triangleWidth x: -addTabButton._triangleWidth height: bgItem.height color: addTabButton.pressed ? Theme.component.tablist.canvas.backgroundColor.selected : (addTabButton.enabled && addTabButton.hovered) ? Theme.component.tablist.canvas.backgroundColor.hover : Theme.component.tab.box.backgroundColor.default transform: Matrix4x4 { matrix: Qt.matrix4x4( 1, root.style === TabBar.Canvas ? -Theme.autodeskAngleTan : 0, 0, addTabButton._triangleWidth, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1) } } } } } } background: Item { implicitHeight: underlineRect.height implicitWidth: 1 Rectangle { id: underlineRect visible: root.style === TabBar.Underline width: parent.width height: Theme.component.tab.underline.borderBottomWidth y: parent.height - height - Theme.component.tab.underline.boxShadowY.focus color: Theme.component.tab.underline.borderBottomColor } } }