fix(slint): instant local queue, mouse nav buttons, narrower toolbar controls

- Local Library Tracks: build the play queue from the already-loaded rows
  (instant) instead of re-querying the DB + filling covers on every click.
- Mouse back/forward buttons now drive history nav over track rows and album
  cards (a TouchArea swallows them, so each interactive surface forwards them;
  the AppShell catcher only saw the gaps).
- ExpandableSearch open width trimmed 20px (no longer rides over left controls
  on small screens).
- QbzSelect toolbar (Group/Sort/filter) trimmed 40px total.

cc
This commit is contained in:
vicrodh committed 2026-05-30 16:53:11 -06:00
1 parent 13f43b802b
commit 89734ae3ab
7 files changed
+54 -22

No files matched your search

+11 -1
View File
@@ -13,7 +13,7 @@ import { Theme } from "../foundation/semantic-colors.slint";
import { Typography } from "../foundation/typography.slint";
import { Radius } from "../foundation/radius.slint";
import { Spacing } from "../foundation/spacing.slint";
import { AlbumCardItem } from "../state.slint";
import { AlbumCardItem, NavState } from "../state.slint";
import { QbzIcon } from "../primitives/QbzIcon.slint";
import { QualityBadge } from "../primitives/QualityBadge.slint";
import { ContextMenu } from "../primitives/ContextMenu.slint";
@@ -56,6 +56,16 @@ component OverlayButton inherits Rectangle {
clicked => {
root.clicked();
}
// Forward the mouse back/forward buttons to history nav (a TouchArea
// swallows them, so they never reach the AppShell catcher).
pointer-event(e) => {
if (e.kind == PointerEventKind.down && e.button == PointerEventButton.back) {
NavState.request-back();
}
if (e.kind == PointerEventKind.down && e.button == PointerEventButton.forward) {
NavState.request-forward();
}
}
}
}
@@ -12,7 +12,9 @@ import { QbzIcon } from "QbzIcon.slint";
export component ExpandableSearch inherits Rectangle {
in property <string> placeholder: "Search…";
in property <length> max-open-width: 216px;
// Trimmed 20px so the open field doesn't ride over the controls to its
// left on small screens.
in property <length> max-open-width: 196px;
in-out property <bool> open: false;
in-out property <string> query;
// Bootstrap-style small variant. Default is the standard size.
@@ -53,8 +53,8 @@ export component QbzSelect inherits Rectangle {
callback selected(int);
// Toolbar (sm) selects — Group / Sort / filter — were unnecessarily wide;
// trim 20px from the effective width (button + list).
private property <length> eff-width: root.menu-width - (root.sm ? 20px : 0px);
// trim 40px from the effective width (button + list).
private property <length> eff-width: root.menu-width - (root.sm ? 40px : 0px);
// Resolved width of the open list.
private property <length> list-width:
root.popup-width > root.eff-width ? root.popup-width : root.eff-width;
+10 -1
View File
@@ -18,7 +18,7 @@
import { Theme } from "../foundation/semantic-colors.slint";
import { Typography } from "../foundation/typography.slint";
import { Radius } from "../foundation/radius.slint";
import { TrackItem, DragActions, NowPlayingState } from "../state.slint";
import { TrackItem, DragActions, NowPlayingState, NavState } from "../state.slint";
import { QbzIcon } from "QbzIcon.slint";
import { TrackPlayCell } from "TrackPlayCell.slint";
import { TrackContextMenu } from "TrackContextMenu.slint";
@@ -81,6 +81,15 @@ export component TrackRow inherits Rectangle {
property <length> down-y;
property <bool> dragging: false;
pointer-event(e) => {
// The mouse back/forward buttons drive history nav. A TouchArea
// swallows these (they never reach the AppShell catcher), so each
// interactive row forwards them itself.
if (e.kind == PointerEventKind.down && e.button == PointerEventButton.back) {
NavState.request-back();
}
if (e.kind == PointerEventKind.down && e.button == PointerEventButton.forward) {
NavState.request-forward();
}
if (e.kind == PointerEventKind.down) {
ta.down-x = root.absolute-position.x + ta.mouse-x;
ta.down-y = root.absolute-position.y + ta.mouse-y;