[SwipeListItem] Take into account scrollbar visibility and form factor for handle and inline actions
ClosedPublic

Authored by ngraham on Jul 19 2019, 5:22 PM.

Details

Summary

Right now, SwipeListItem isn't as convergent as it could be. It always uses a very
large margin between actions, and its right margin doesn't take into account the
visibility of the scrollbar, so it's always too much. It also isn't RTL-friendly.

This patch makes the spacing conditional on form factor, takes into account the
scrollbar, and improves RTL friendliness.

Test Plan

No regressions in Kirigami Gallery list lage

With no scrollbar visible:

With scrollbar visible:

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.
ngraham created this revision.Jul 19 2019, 5:22 PM
Restricted Application added a project: Kirigami. · View Herald TranscriptJul 19 2019, 5:22 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Jul 19 2019, 5:22 PM
apol added a subscriber: apol.Jul 20 2019, 9:25 AM
apol added inline comments.
src/controls/templates/SwipeListItem.qml
255–256

Wouldn't checking for scrollbar visibility be enough? if there's a scrollbar but isMobile we still want the different spacing.

ngraham updated this revision to Diff 62116.Jul 20 2019, 1:49 PM
ngraham marked an inline comment as done.

Remove unnecessary !settings.isMobile checks

ngraham updated this revision to Diff 62313.Jul 22 2019, 3:48 PM

Make the scrollbar test work (thanks @mart)

ngraham edited the summary of this revision. (Show Details)Jul 22 2019, 3:48 PM
ngraham retitled this revision from [RFC] [SwipeListItem] Take into account scrollbar visibility and form factor to [SwipeListItem] Take into account scrollbar visibility and form factor for handle and inline actions.
ngraham edited the test plan for this revision. (Show Details)
ngraham updated this revision to Diff 62319.Jul 22 2019, 4:33 PM
  • Make it work when using a Flickable too
  • Make the logic more generic
  • Handle RTL too
mart accepted this revision.Jul 22 2019, 4:35 PM
This revision is now accepted and ready to land.Jul 22 2019, 4:35 PM
ngraham edited the summary of this revision. (Show Details)Jul 22 2019, 4:35 PM
ngraham edited the test plan for this revision. (Show Details)
This revision was automatically updated to reflect the committed changes.