Files
qbz/crates/qbz-qt/qml/views/local/LocalTip.qml
T
vicrodh e0fcf7a089 fix(qbz-qt): local context menus, collapsing search fields, toolbar density
Four things the owner hit in Local Library.

The context menu did nothing there — local rows and cards now mount the shared
menu the rest of the app uses, with the action set Slint gives local and Plex
items. Anything with no seam in this port (add-to-playlist, add-to-mixtape, the
tag editor, local favourites) is hidden or visibly disabled rather than a row
that silently does nothing.

The per-view search fields did not open and collapse the way the header's does.
That behaviour moved into the shared QbzLineEdit, so the Local toolbar, the
queue and the tree rail all get it from one place instead of four copies. The
queue's field also escaped its 300px column; it is width-bound now.

Filter, sorting and grouping become icon-only buttons with an explanatory
tooltip, which is what the owner asked for and what the crowding called for.

Found on the way, and affecting Qobuz cards too: the album card's ⋯ menu had no
"Play later" at all, and its "Add to queue" row dispatched play-later — the row
lied about what it did. Both fixed, with Slint's icon set for the three.

cc
2026-07-28 16:23:23 -06:00

47 lines
1.5 KiB
QML

// Hover tooltip for the Local Library's icon-only toolbar controls.
//
// Slint routes these through a shell-level overlay (TooltipState, set by
// LocalLibraryView.slint's CircleIconBtn / RailBulkBtn). This port has no
// tooltip overlay singleton, so the pattern is the one the quality badge
// already uses: a QtQuick.Controls ToolTip (a POPUP, so it survives the
// `clip: true` containers these toolbars live in) styled to the Slint
// numbers — 24px tall, radius sm, surface-elevated on a 1px border-subtle,
// 11px medium secondary text, 9px side padding, 6px above its anchor.
//
// `delay` is 0 and the caller drives `visible` from its own hover area (the
// quality-badge convention), so the tip tracks hover exactly.
import QtQuick
import QtQuick.Controls
import "../../theme"
ToolTip {
id: tip
delay: 0
timeout: -1
padding: 0
implicitHeight: 24
x: parent ? Math.round((parent.width - width) / 2) : 0
y: -height - 6
contentItem: Text {
text: tip.text
color: theme.textSecondary
font.pixelSize: 11
font.weight: theme.weightMedium
verticalAlignment: Text.AlignVCenter
leftPadding: 9
rightPadding: 9
}
background: Rectangle {
color: theme.surfaceElevated
radius: theme.radiusSm
border.width: 1
border.color: theme.borderSubtle
// The theme instance lives here because a ToolTip's default property
// is its content; ids are component-scoped, so contentItem sees it.
QbzTheme { id: theme }
}
}