FormLayout: Fix label height if wide mode is false
ClosedPublic

Authored by jbbgameich on Nov 6 2019, 4:50 PM.

Details

Summary

previously the height of the label was based on the content's height. However this doesn't work in non wide mode. With this change it preserves the previous behaviour in wide mode were it makes sense but uses a constant height in non-wide mode.

Before:

After:

Test Plan

FormLayouts with large content items don't have large margins between the items anymore when wideMode = false.

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.
jbbgameich created this revision.Nov 6 2019, 4:50 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptNov 6 2019, 4:50 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
jbbgameich requested review of this revision.Nov 6 2019, 4:50 PM
jbbgameich edited the summary of this revision. (Show Details)Nov 6 2019, 4:53 PM
jbbgameich edited the test plan for this revision. (Show Details)
mart added a subscriber: mart.Nov 6 2019, 5:14 PM
mart added inline comments.
src/controls/FormLayout.qml
277

fontmetrics is the default font height, and this being an heading may be more (when is heading)
does it work if instead you do here
return implicitHeight ?

jbbgameich added inline comments.Nov 6 2019, 5:24 PM
src/controls/FormLayout.qml
277

It works but produces a slightly smaller margin. But it looks good as well so I'll update the diff.

jbbgameich updated this revision to Diff 69355.Nov 6 2019, 5:25 PM
jbbgameich edited the test plan for this revision. (Show Details)

Use implicit height instead of font metrics

mart accepted this revision.Nov 6 2019, 5:26 PM
This revision is now accepted and ready to land.Nov 6 2019, 5:26 PM
This revision was automatically updated to reflect the committed changes.