10import QtQuick.Controls
12import QtQuick.Templates as T
13import org.kde.ksvg as KSvg
15import org.kde.plasma.core as PlasmaCore
16import org.kde.kirigami as Kirigami
17import "private" as Private
22 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
23 implicitContentWidth + leftPadding + rightPadding,
24 implicitIndicatorWidth + leftPadding + rightPadding)
25 implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
26 implicitContentHeight + topPadding + bottomPadding,
27 implicitIndicatorHeight + topPadding + bottomPadding)
29 baselineOffset: contentItem.y + contentItem.baselineOffset
35 bottomPadding: (background as
KSvg.
FrameSvgItem)?.margins.bottom ?? undefined
39 icon.width:
Kirigami.Units.iconSizes.smallMedium
40 icon.height:
Kirigami.Units.iconSizes.smallMedium
42 Kirigami.MnemonicData.enabled: control.enabled && control.visible
44 Kirigami.MnemonicData.label: control.text
48 enabled: !(RegExp(/\&[^\&]/).test(control.text))
49 sequence: control.Kirigami.MnemonicData.sequence
50 onActivated: control.animateClick()
53 contentItem: Private.IconLabel {
54 mirrored: control.mirrored
56 display: control.display
57 spacing: control.spacing
58 iconItem.implicitWidth: control.icon.width
59 iconItem.implicitHeight: control.icon.height
60 iconItem.source: control.icon.name || control.icon.source
61 iconItem.active: control.visualFocus
62 label.text: control.Kirigami.MnemonicData.richTextLabel
63 label.color: control.visualFocus ?
Kirigami.Theme.highlightColor :
Kirigami.Theme.textColor
65 parent: control.contentItem.label
66 width: Math.min(parent.width, parent.contentWidth)
68 anchors.left: parent.left
69 anchors.top: parent.bottom
71 visible: control.visualFocus
76 visible: !control.ListView.view || !control.ListView.view.highlightItem
77 imagePath:
"widgets/tabbar"
78 prefix: control.T.TabBar.position === T.TabBar.Footer ?
"south-active-tab" :
"north-active-tab"
81 if (!visible || control.checked) {
83 }
else if (control.T.TabBar.position === T.TabBar.Footer) {