fix(qt): put the local albums scrollbar and A-Z strip on the real edge

LocalAlbumsTab pads its content 32px on the right, and both the scrollbar and
the jump strip lived inside that padding — so the bar sat 32px from the
window edge (52 with the strip up) while LibraryView.qml:1281 puts the same
control at 4, or 34 to clear its strip. Side by side the local grid's bar
reads as floating away from the edge.

The collection now takes two measurements, both from the WINDOW's right edge:
`scrollBarInset` (where the bar should land) and `hostRightInset` (how far
the component's own edge already is from it). The bar's margin is their
difference, which goes negative and overhangs — safe, because the component
root is a plain Item; the `clip: true` in that file is on the ListView, a
sibling. Both default to 0, so LocalArtistsTab and LocalFoldersTab, which
have not opted in, are untouched.

The A-Z strip moves out to 12 from the window edge, matching
LibraryView.qml:1269.

cc
This commit is contained in:
vicrodh committed 2026-08-18 18:41:28 -06:00
1 parent c0fe8a80d3
commit ed081cac6b
2 files changed
+21

No files matched your search

@@ -42,6 +42,17 @@ Item {
/// { albumId: true } — the host owns the selection set.
property var selected: ({})
/// The scrollbar belongs on the WINDOW's right edge, but hosts inset
/// their content (LocalAlbumsTab pads 32, plus 20 more to clear the A-Z
/// strip), which dragged the bar visibly inward compared with the rest of
/// the app. Both are measured from the window's right edge:
/// `scrollBarInset` is where the bar should land (LibraryView uses 4, or
/// 34 with the strip up) and `hostRightInset` is how far this component's
/// own right edge already is from it. Defaults of 0 leave callers that
/// have not opted in exactly where they were.
property int scrollBarInset: 0
property int hostRightInset: 0
signal openRequested(string id)
signal playRequested(string id)
signal enqueueRequested(string id, string mode)
@@ -439,6 +450,10 @@ Item {
QbzScrollBar {
anchors.right: parent.right
// Negative when the host insets its content — the bar overhangs to
// reach the real edge. Safe: `root` is a plain Item and does not clip
// (the `clip: true` in this file is on the ListView, a sibling).
anchors.rightMargin: root.scrollBarInset - root.hostRightInset
anchors.top: parent.top
anchors.bottom: parent.bottom
target: list