feat(qt): Shift ranges in My QBZ collections

A collection keeps its selection in Rust by persisted position, and
detailToggleItemSelect only toggled. It now takes `shift`: a plain or Ctrl
click toggles and becomes the anchor, a Shift click adds every row between
the anchor and the clicked one in the order the rows are DRAWN (filtered and
sorted, not the position order), and the anchor is dropped wherever the
selection is cleared. The list rows, their checkbox and the grid cards pass
Shift through; the kiosk list passes false.

In select mode a row's artwork still started playback and its title and
subtitle still opened the item or the artist. They stand down now, so the
click selects.

cc
This commit is contained in:
vicrodh committed 2026-09-14 10:31:13 -06:00
1 parent 0fc19ac7fb
commit ee3a186f6d
8 files changed
+158 -24

No files matched your search

@@ -171,7 +171,9 @@ Rectangle {
}
onClicked: function (mouse) {
if (mouse.button !== Qt.LeftButton) return
if (root.selectMode) QbzMyQbz.detailToggleItemSelect(root.itemPosition)
if (root.selectMode)
QbzMyQbz.detailToggleItemSelect(root.itemPosition,
(mouse.modifiers & Qt.ShiftModifier) !== 0)
else root.openThis()
}
}
@@ -247,7 +249,10 @@ Rectangle {
visible: root.selectMode
anchors.centerIn: parent
on: root.selected
onToggled: QbzMyQbz.detailToggleItemSelect(root.itemPosition)
onToggled: function (mods) {
QbzMyQbz.detailToggleItemSelect(root.itemPosition,
(mods & Qt.ShiftModifier) !== 0)
}
}
}
@@ -295,6 +300,10 @@ Rectangle {
MouseArea {
id: artArea
anchors.fill: parent
// In select mode the whole row selects (Shift / Ctrl
// included): the artwork, title and artist stop playing
// or navigating so the click reaches the row body.
enabled: !root.selectMode
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: QbzMyQbz.playItem(root.sourceItemId)
@@ -321,6 +330,7 @@ Rectangle {
MouseArea {
id: titleArea
anchors.fill: parent
enabled: !root.selectMode
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.openThis()
@@ -343,6 +353,7 @@ Rectangle {
MouseArea {
id: subArea
anchors.fill: parent
enabled: !root.selectMode
hoverEnabled: true
cursorShape: root.subtitleIsLink ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: {
@@ -1193,7 +1193,10 @@ Rectangle {
// selection checkbox rather than bolt one on.
selectMode: root.selectMode
selected: gcell.cSelected
onSelectToggled: QbzMyQbz.detailToggleItemSelect(gcell.cPosition)
onSelectToggled: function (mods) {
QbzMyQbz.detailToggleItemSelect(gcell.cPosition,
(mods & Qt.ShiftModifier) !== 0)
}
// Card body click, non-select mode only (the card
// routes a select-mode click to `selectToggled`).
onOpenRequested: QbzMyQbz.openItem(gcell.cSource,