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:
if (control.action) {
51 control.action.trigger()
52 }
else if (control.checkable && !control.checked) {
62 contentItem: Private.IconLabel {
63 mirrored: control.mirrored
65 display: control.display
66 spacing: control.spacing
67 iconItem.implicitWidth: control.icon.width
68 iconItem.implicitHeight: control.icon.height
69 iconItem.source: control.icon.name || control.icon.source
70 iconItem.active: control.visualFocus
71 label.text: control.Kirigami.MnemonicData.richTextLabel
72 label.color: control.visualFocus ?
Kirigami.Theme.highlightColor :
Kirigami.Theme.textColor
74 parent: control.contentItem.label
75 width: Math.min(parent.width, parent.contentWidth)
77 anchors.left: parent.left
78 anchors.top: parent.bottom
80 visible: control.visualFocus
85 visible: !control.ListView.view || !control.ListView.view.highlightItem
86 imagePath:
"widgets/tabbar"
87 prefix: control.T.TabBar.position === T.TabBar.Footer ?
"south-active-tab" :
"north-active-tab"
90 if (!visible || control.checked) {
92 }
else if (control.T.TabBar.position === T.TabBar.Footer) {