fix(qt): Shift and Ctrl work on every select-mode click target, not only the row body

Excel-style selection (750c59034) read the modifiers only where a row BODY
took the click. Every other target a select-mode surface draws dropped them,
so a Shift-click there was a plain toggle:

  - the track row's checkbox disc passed Qt.NoModifier;
  - QbzCheckbox and SelectCheck emitted toggled() with no argument, so the
    Library album rows, the local album rows and the folder rows, which
    already expected `function (mods)`, received undefined;
  - AlbumCard emitted selectToggled() with no argument, and the paged local
    albums grid (299dcde5b) spelled the drop out as Qt.NoModifier.

Some targets were never selection targets at all: in select mode the artist
and album names on a track row, the artist and label on a Library album row
and the artist line of an album card still navigated, leaving the page and
the selection mid-gesture. The row links stand down in select mode so the
click reaches the row body with its modifiers, and the card's artist line
toggles like its artwork and title. A hover-only tooltip on the pulled but
cached glyph no longer eats the row's click.

Reproduced on the release binary in a nested KWin with injected input: in
Local Library Tracks, the checkbox discs of rows 1, Shift 4 and Ctrl 6
selected 3 rows; the same clicks on the row bodies selected 5. No list
view, Flickable or wheel code changes; tst_wheel passes unchanged.

tst_multi_select clicks each of these targets through the real TrackRow,
AlbumListRow, AlbumCard, QbzCheckbox and SelectCheck.

cc
This commit is contained in:
vicrodh committed 2026-09-14 10:30:34 -06:00
1 parent 7d1a144c89
commit 7c9bf8043f
12 files changed
+360 -23

No files matched your search

+16 -6
View File
@@ -213,7 +213,10 @@ Rectangle {
/// Park the select indicator bottom-right of the art instead of top-right.
property bool selectMarkBottom: false
property bool selected: false
signal selectToggled()
/// `modifiers` rides straight off the click: a grid host turns Shift into
/// a range (controls/SelectionModel.qml). Every select-mode target on the
/// card — artwork, title, artist line — emits it.
signal selectToggled(int modifiers)
// Album blacklist ("Block this album") — LIVE since QbzBlacklist landed
// (`blockAlbum(id, title, artist, coverUrl)`). Kept as a property, not
@@ -561,7 +564,7 @@ Rectangle {
}
// .slint:169 — in select mode the card click TOGGLES.
if (root.selectMode) {
root.selectToggled()
root.selectToggled(mouse.modifiers)
return
}
if (root.pulledDead)
@@ -993,7 +996,7 @@ Rectangle {
// .slint:465 — the title carries the SAME target
// as the artwork, select mode included.
if (root.selectMode) {
root.selectToggled()
root.selectToggled(mouse.modifiers)
return
}
if (root.pulledDead)
@@ -1009,7 +1012,8 @@ Rectangle {
width: parent.width
height: 18
text: root.artist
color: (root.artistId !== "" || root.hostArtistLink)
color: !root.selectMode
&& (root.artistId !== "" || root.hostArtistLink)
&& artistArea.containsMouse
? theme.textPrimary : theme.textMuted
font.pixelSize: theme.fontLink - 1
@@ -1019,9 +1023,15 @@ Rectangle {
id: artistArea
anchors.fill: parent
hoverEnabled: true
cursorShape: root.artistId !== "" || root.hostArtistLink
cursorShape: root.selectMode || root.artistId !== "" || root.hostArtistLink
? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: {
onClicked: function (mouse) {
// In select mode the artist line is the card too:
// opening the artist mid-selection would drop it.
if (root.selectMode) {
root.selectToggled(mouse.modifiers)
return
}
if (root.artistId !== "")
QbzArtist.openArtist(root.artistId)
else if (root.hostArtistLink)