7import QtQuick.Templates as T
8import QtQuick.Controls as Controls
11import org.kde.kirigami as Kirigami
13import "private" as Private
48 property string description:
""
54 property var leading: null
59 property real leadingPadding:
Kirigami.Units.smallSpacing
65 property var trailing: null
70 property real trailingPadding:
Kirigami.Units.smallSpacing
76 property alias descriptionItem: internalDescriptionItem
79 width:
Kirigami.Units.iconSizes.smallMedium
80 height:
Kirigami.Units.iconSizes.smallMedium
83 horizontalPadding: Private.FormCardUnits.horizontalPadding
84 verticalPadding: Private.FormCardUnits.verticalPadding
86 implicitWidth: contentItem.implicitWidth + leftPadding + rightPadding
87 implicitHeight: contentItem.implicitHeight + topPadding + bottomPadding
89 focusPolicy:
Qt.StrongFocus
93 Layout.fillWidth:
true
95 contentItem: ColumnLayout {
96 spacing: Private.FormCardUnits.verticalSpacing
103 Private.ContentItemLoader {
104 Layout.rightMargin: visible ? root.leadingPadding : 0
105 visible: root.leading
106 implicitHeight: visible ? root.leading.implicitHeight : 0
107 implicitWidth: visible ? root.leading.implicitWidth : 0
108 contentItem: root.leading
113 Layout.rightMargin: Private.FormCardUnits.horizontalSpacing
114 focusPolicy:
Qt.NoFocus
116 checkState: root.checkState
117 nextCheckState: root.nextCheckState
129 onClicked: root.clicked()
130 onPressAndHold: root.pressAndHold()
131 onDoubleClicked: root.doubleClicked()
136 enabled: root.enabled
137 checked: root.checked
139 Accessible.ignored:
true
143 visible: root.icon.name.length > 0 || root.icon.source.toString().length > 0
144 source: root.icon.name.length > 0 ? root.icon.name : root.icon.source
145 color: root.icon.color
146 Layout.rightMargin: visible ? Private.FormCardUnits.horizonalSpacing : 0
147 implicitWidth: visible ? root.icon.width : 0
148 implicitHeight: visible ? root.icon.height : 0
153 color: root.enabled ?
Kirigami.Theme.textColor :
Kirigami.Theme.disabledTextColor
154 elide:
Text.ElideRight
157 Layout.fillWidth:
true
158 Accessible.ignored:
true
161 Private.ContentItemLoader {
162 Layout.leftMargin: visible ? root.trailingPadding : 0
163 visible: root.trailing
164 implicitHeight: visible ? root.trailing.implicitHeight : 0
165 implicitWidth: visible ? root.trailing.implicitWidth : 0
166 contentItem: root.trailing
171 id: internalDescriptionItem
173 Layout.fillWidth:
true
174 text: root.description
175 color:
Kirigami.Theme.disabledTextColor
176 visible: root.description !==
""