Conversation
Withalion
left a comment
There was a problem hiding this comment.
Okay, so I'm not against the approach you chose it sounds good. However the idea is that if you are using MMListView component you are not supposed to know/care that it's a ListView wrapped in ScrollView or that you need to wrap it again in ScrollView. The API for MMListView should stay the same and if necessary the component needs to deal with scrollbar internally.
Fair point, didn't think of this. Reverted files to their master version and updated |
…ar-for-desktop-lists
Coverage Report for CI Build 34356898153Coverage increased (+0.03%) to 59.575%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions4 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
📦 Build Artifacts Ready
|
Withalion
left a comment
There was a problem hiding this comment.
MMFormPage layout is broken. In MMFormGalleryEditor there should be some spacing between the photos and scrollbar, currently the scrollbar overlays the photos. MMProjectStatusPage not every element inside the MMListView gets it's width updated when scrollbar appears. Scrollbar is doing some weird things in MMChangelogPage, but it might be due to how the content is loaded.
There is a check in code_style.yml called no_stackview, which checks if there is any occurrence of StackView component in our code and throws error if it finds something. Make similar checks for ListView and Scrollview, fix any issues it finds so your PR will be complaint.
The approach looks good!
Thanks, went through all of these.
Added |
📦 Build Artifacts Ready
|
…ar-for-desktop-lists
📦 Build Artifacts Ready
|
Withalion
left a comment
There was a problem hiding this comment.
Looks good, just some minor things now
| run: | | ||
| # MMListView.qml is the approved wrapper — exclude it from the search. | ||
| # Any other QML file with a bare "ListView" is using the raw Qt component | ||
| # instead of the wrapper, which breaks Squish test support. |
There was a problem hiding this comment.
doesn't break Squish, they are just not supposed to use it :)
| # MMScrollView.qml and MMListView.qml are the approved wrappers (the | ||
| # latter uses a plain ScrollView internally) — exclude both from the | ||
| # search. Any other QML file with a bare "ScrollView" is using the raw | ||
| # Qt component instead of the wrapper, which breaks Squish test support. |
| // Drop-in replacement for ListView that also shows a scrollbar on desktop. | ||
| // Rooted in a plain Item rather than ScrollView, so only the properties | ||
| // aliased below are exposed - ScrollView/Pane/Control have their own | ||
| // contentWidth/spacing/padding that would otherwise shadow ListView's. |
There was a problem hiding this comment.
| // Drop-in replacement for ListView that also shows a scrollbar on desktop. | |
| // Rooted in a plain Item rather than ScrollView, so only the properties | |
| // aliased below are exposed - ScrollView/Pane/Control have their own | |
| // contentWidth/spacing/padding that would otherwise shadow ListView's. | |
| // Drop-in replacement for ListView that also shows a scrollbar on desktop. |
There was a problem hiding this comment.
Don't shrink the photo cards here. Rather make the cards keep the original size and if scrollbar is necessary increase the ListView height by the margin.
| ScrollBar.vertical.policy: ScrollBar.AlwaysOff | ||
| ScrollBar.horizontal.policy: ScrollBar.AlwaysOff | ||
| ScrollBar.horizontal.interactive: true |
There was a problem hiding this comment.
- let the
ScrollViewelement decide the necessity of scrollbar - I would remove the interactive property assignment
|
|
||
| width: parent.width | ||
| ScrollBar.horizontal.policy: ScrollBar.AlwaysOff | ||
| ScrollBar.vertical.policy: ScrollBar.AlwaysOff |
There was a problem hiding this comment.
Any reason why we want to force this?
| height: parent.height | ||
|
|
||
| contentWidth: availableWidth // to only scroll vertically | ||
| ScrollBar.vertical.policy: ScrollBar.AlwaysOff |
There was a problem hiding this comment.
any reason why we want to force this?
|
Thanks for the attempt, but the amount of changes and the impact is too risky to merge. Let's see if we'll be able to find a good solution to this.. |
Description
Adds a proper scrollbar for desktop builds. Mobile builds rely on touch/flick scrolling and never had or needed a visible scrollbar, but on desktop there was no scroll indicator at all, and once turned on in
ScrollViewit was drawn over the left side of content instead of reserving space for itself.ListViewbased lists had no scrollbar handling at all, so the same content-overlap problem applied there too, across many pages.Fixes: #4127
Original PR: #4145
Problem
The obvious first approach was to just declare
ScrollBar.verticaldirectly on the sharedMMListViewcomponent, sinceListView/Flickableauto-positions an attached scrollbar correctly on its own. The problem is that aListView's scrollbar is drawn as an overlay on top of its content -Flickablehas no concept ofpaddingthe way aControldoes, so there's nothing built in to reserve space for it.In practice, that meant every delegate, header, footer, and section-delegate across the ~17 different lists in the app would need to know a scrollbar might be there and manually subtract its width from their own sizing to avoid being drawn underneath it. That's a lot of duplicated logic to keep in sync, easy to miss in a new or existing list, and it still didn't cover every case cleanly (e.g. footers/section headers don't automatically inherit a delegate's width-adjustment logic, so each one needed the same fix repeated separately). Wrapping each list in
MMScrollViewinstead moves that reservation into one realpaddingvalue on aControl, so no list, delegate, or header needs to know a scrollbar exists at all.What changed
rightPaddingto the sharedMMScrollViewcomponent so the scrollbar reserves its own space instead of overlapping content, headers, footers, etc.ListViewin the app (via the sharedMMListViewcomponent) inMMScrollView, rather than handling scrollbars per-list.ScrollViewis able to reuse aListViewas its own scrollable content directly, so this didn't require a rewrite of any list, just a wrapper, and now every list in the app shares the exact same scrollbar behavior and styling from one place instead of duplicating it.Behaviour
Desktop - scrollbar visible, correctly positioned on the right edge, content no longer drawn underneath it:
Desktop - scrollbar hides and shows as needed:
Screencast.From.2026-07-22.18-38-09.webm
Mobile — no scrollbar shown, touch scrolling behaves exactly as before: