Add scrollbar for desktop devices#4620
Open
xkello wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: