Warning, /plasma/qqc2-breeze-style/style/qtquickcontrols/TabBar.qml is written in an unsupported language. File is not indexed.
0001 //NOTE: replace this
0002
0003 import QtQuick
0004 import QtQuick.Templates as T
0005 import org.kde.kirigami as Kirigami
0006
0007 import org.kde.breeze.impl as Impl
0008
0009 T.TabBar {
0010 id: control
0011
0012 readonly property bool __isHeader: control.position === T.TabBar.Header
0013 readonly property bool __isFooter: control.position === T.TabBar.Footer
0014
0015 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
0016 contentWidth + leftPadding + rightPadding)
0017 implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
0018 contentHeight + topPadding + bottomPadding)
0019
0020 spacing: -1
0021 padding: 0
0022
0023 // Add space for the separator above the footer
0024 topPadding: __isFooter && background && background.hasOwnProperty("separator") ?
0025 background.separator.height + verticalPadding : verticalPadding
0026 // Add space for the separator below the header
0027 bottomPadding: __isHeader && background && background.hasOwnProperty("separator") ?
0028 background.separator.height + verticalPadding : verticalPadding
0029
0030 Kirigami.Theme.inherit: !__isHeader
0031 Kirigami.Theme.colorSet: Kirigami.Theme.Header
0032
0033 contentItem: ListView {
0034 model: control.contentModel
0035 currentIndex: control.currentIndex
0036
0037 spacing: control.spacing
0038 orientation: ListView.Horizontal
0039 boundsBehavior: Flickable.StopAtBounds
0040 flickableDirection: Flickable.AutoFlickIfNeeded
0041 snapMode: ListView.SnapToItem
0042 }
0043
0044 background: Rectangle {
0045 // Enough height for Buttons/ComboBoxes/TextFields with smallSpacing padding on top and bottom
0046 implicitHeight: Impl.Units.mediumControlHeight + (Kirigami.Units.smallSpacing * 2) + (separator.visible ? separator.height : 0)
0047 color: Kirigami.Theme.backgroundColor
0048 property Item separator: Kirigami.Separator {
0049 parent: background
0050 visible: control.__isHeader || control.__isFooter
0051 width: parent.width
0052 y: control.__isFooter ? 0 : parent.height - height
0053 }
0054 }
0055 }