Changeset View
Changeset View
Standalone View
Standalone View
src/controls/FormLayout.qml
Show First 20 Lines • Show All 264 Lines • ▼ Show 20 Line(s) | 252 | Kirigami.Heading { | |||
---|---|---|---|---|---|
265 | Layout.columnSpan: item.Kirigami.FormData.isSection ? lay.columns : 1 | 265 | Layout.columnSpan: item.Kirigami.FormData.isSection ? lay.columns : 1 | ||
266 | Layout.preferredHeight: item.Kirigami.FormData.label.length > 0 ? Math.max(implicitHeight, item.Kirigami.FormData.buddyFor.height) : Kirigami.Units.smallSpacing | 266 | Layout.preferredHeight: item.Kirigami.FormData.label.length > 0 ? Math.max(implicitHeight, item.Kirigami.FormData.buddyFor.height) : Kirigami.Units.smallSpacing | ||
267 | 267 | | |||
268 | Layout.alignment: item.Kirigami.FormData.isSection | 268 | Layout.alignment: item.Kirigami.FormData.isSection | ||
269 | ? Qt.AlignLeft | 269 | ? Qt.AlignLeft | ||
270 | : (root.wideMode | 270 | : (root.wideMode | ||
271 | ? (Qt.AlignRight | Qt.AlignTop) | 271 | ? (Qt.AlignRight | Qt.AlignTop) | ||
272 | : (Qt.AlignLeft | Qt.AlignBottom)) | 272 | : (Qt.AlignLeft | Qt.AlignBottom)) | ||
273 | verticalAlignment: root.wideMode ? Text.AlignVCenter : Text.AlignBottom | 273 | verticalAlignment: root.wideMode ? Text.AlignTop : Text.AlignBottom | ||
274 | 274 | | |||
275 | //Layout.topMargin: item.Kirigami.FormData.buddyFor.y | 275 | //Layout.topMargin: item.Kirigami.FormData.buddyFor.y | ||
276 | onItemChanged: { | 276 | onItemChanged: { | ||
277 | if (!item) { | 277 | if (!item) { | ||
278 | labelItem.destroy(); | 278 | labelItem.destroy(); | ||
279 | } | 279 | } | ||
280 | } | 280 | } | ||
281 | Shortcut { | 281 | Shortcut { | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 289 | CheckBox { | |||
323 | } | 323 | } | ||
324 | onCheckedChanged: { | 324 | onCheckedChanged: { | ||
325 | item.Kirigami.FormData.checked = checked | 325 | item.Kirigami.FormData.checked = checked | ||
326 | } | 326 | } | ||
327 | contentItem: Kirigami.Heading { | 327 | contentItem: Kirigami.Heading { | ||
328 | id: labelItemHeading | 328 | id: labelItemHeading | ||
329 | level: labelItem.item.Kirigami.FormData.isSection ? 3 : 5 | 329 | level: labelItem.item.Kirigami.FormData.isSection ? 3 : 5 | ||
330 | text: labelItem.text | 330 | text: labelItem.text | ||
331 | verticalAlignment: root.wideMode ? Text.AlignVCenter : Text.AlignBottom | 331 | verticalAlignment: root.wideMode ? Text.AlignTop : Text.AlignBottom | ||
332 | enabled: labelItem.item.Kirigami.FormData.enabled | 332 | enabled: labelItem.item.Kirigami.FormData.enabled | ||
333 | leftPadding: parent.indicator.width | 333 | leftPadding: parent.indicator.width | ||
334 | } | 334 | } | ||
335 | Rectangle { | 335 | Rectangle { | ||
336 | enabled: labelItem.indicator.enabled | 336 | enabled: labelItem.indicator.enabled | ||
337 | anchors.left: labelItemHeading.left | 337 | anchors.left: labelItemHeading.left | ||
338 | anchors.right: labelItemHeading.right | 338 | anchors.right: labelItemHeading.right | ||
339 | anchors.top: labelItemHeading.bottom | 339 | anchors.top: labelItemHeading.bottom | ||
340 | anchors.leftMargin: labelItemHeading.leftPadding | 340 | anchors.leftMargin: labelItemHeading.leftPadding | ||
341 | height: 1 * Kirigami.Units.devicePixelRatio | 341 | height: 1 * Kirigami.Units.devicePixelRatio | ||
342 | color: Kirigami.Theme.highlightColor | 342 | color: Kirigami.Theme.highlightColor | ||
343 | visible: labelItem.activeFocus && labelItem.indicator.visible | 343 | visible: labelItem.activeFocus && labelItem.indicator.visible | ||
344 | } | 344 | } | ||
345 | } | 345 | } | ||
346 | } | 346 | } | ||
347 | } | 347 | } |