Make BasicListItem more useful by giving it a subtitle property
ClosedPublic

Authored by ngraham on Apr 21 2020, 10:28 PM.

Details

Summary

Right now BasicListItem is quite limited and therefore not very useful.

We have this paradigm *all over the place* of a double-height list item with an
icon, a title, and a smaller/lighter subtitle below it. Right now neither
BasicListItem nor SwipeListItem supports this natively, so wherever we use this,
we have to manufacture it by hand, leading to every implementation looking
inconsistent. That seems like a shame.

This patch addresses that situation by adding support for this paradigm to
BasicListItem, which is given a subtitle property that will display a second
label in a smaller, lighter font below the title label (I did not use level 4
and 5 Headings because this would result in an appearance change for list
items without subtitles, as the level 4 Heading is larger than the Label).
It is also changed to be allowed to not display an icon, which is more common
with title+subtitle list items.

Then a BasicListItem can be used as the contentItem for SwipeListItems,
producing the desired visual consistency wherever we use either of the list
items.

Test Plan

Test with D29075:

No visual or behavioral changes for BasicListItems not using subtitles

Open Kirigami gallery or Discover. No visual changes there

Diff Detail

Repository
R169 Kirigami
Branch
more-capable-BasicListItem (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 26137
Build 26155: arc lint + arc unit
ngraham created this revision.Apr 21 2020, 10:28 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptApr 21 2020, 10:28 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Apr 21 2020, 10:28 PM
ngraham edited the test plan for this revision. (Show Details)Apr 24 2020, 2:27 PM
mart added inline comments.Apr 30 2020, 2:51 PM
src/controls/BasicListItem.qml
120 ↗(On Diff #80815)

from plasma style, can't be used

ngraham edited the test plan for this revision. (Show Details)Apr 30 2020, 2:52 PM
cblack added a subscriber: cblack.Apr 30 2020, 2:54 PM
cblack added inline comments.
src/controls/BasicListItem.qml
31 ↗(On Diff #80815)
@since 5.70
@since org.kde.kirigami 2.12
ngraham updated this revision to Diff 81592.Apr 30 2020, 3:01 PM
ngraham marked 2 inline comments as done.

Address review comments

mart accepted this revision.Apr 30 2020, 3:18 PM
This revision is now accepted and ready to land.Apr 30 2020, 3:18 PM
This revision was automatically updated to reflect the committed changes.