[FormLayout] Propagate FormData.enabled also to label
ClosedPublic

Authored by broulik on Mar 11 2020, 10:26 AM.

Details

Summary

Allows to mark the section as disabled even when the control itself is not, e.g. when you have a RowLayout and don't want to disable the entire row.
This was possible with a checkable section but not the plain label buddy variant.

Test Plan

In the following example I don't want the BusyIndicator disabled but still have the rest of the row (the label *and* its section label) disabled.

Kirigami.FormLayout {
    RowLayout {
        Kirigami.FormData.label: "Foo"
        Kirigami.FormData.enabled: !something.busy

        QQC2.CheckBox {
            text: "Enabled"
            enabled: !something.busy
        }
        
        QQC2.BusyIndicator {
            running: something.busy
            visible: running
        }
    }
}

Diff Detail

Repository
R169 Kirigami
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Mar 11 2020, 10:26 AM
Restricted Application added a project: Kirigami. · View Herald TranscriptMar 11 2020, 10:26 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Mar 11 2020, 10:26 AM
broulik edited the summary of this revision. (Show Details)
mart accepted this revision.Mar 11 2020, 3:54 PM
This revision is now accepted and ready to land.Mar 11 2020, 3:54 PM
This revision was automatically updated to reflect the committed changes.