The Slint reference is 3,885 lines of .slint across ten files plus 5,514 lines
of Rust glue over the shared qbz-mixtape crate. None of it existed in the Qt
port; the nav flyout carried a "GAP:" comment and two disabled entries.
Rust (flat in src/, per QTBUG-93443): three bridges rather than one God-object
— QbzMyQbz (grids + detail + edit + cover + mix), QbzMyQbzAdd (the app-wide
picker, kept apart so TrackRow, PlayerBar and the Local Library bulk bars
cannot couple to detail state) and QbzDisco (artist-scoped, reached from the
artist page, never coexisting with the MyQBZ views). Twelve controllers behind
them, ported function by function from myqbz{,_detail,_play,_edit,_cover,_mix,
_add,_prefs,_view_prefs,_builder}.rs. src/toast_qt.rs finally gives the port a
toast host.
QML in qml/views/myqbz/ plus four global overlays. Reused rather than forked:
TrackRow, TrackListHeader, QualityBadgeFull, QbzContextMenu, CardMenu,
QbzCheckbox, QbzSkeleton, QbzScrollBar, RoundedImage. LocalSegToggle and
LocalMultiSelectBar are PROMOTED to controls/QbzSegToggle and
controls/QbzMultiSelectBar (they were ports of shared Slint primitives that
MyQBZ needs too) — a move plus an import fix, with the Local metrics kept as
the defaults so the four Local Library toggles are byte-unchanged and the MyQBZ
call sites pass ViewToggle's own numbers.
Every list is windowed at write time: GridView/ListView with reuseItems and a
cacheBuffer, and expanded mode is an outer recycled ListView whose delegate is
a Column + Repeater, because a nested ListView inside a recycled delegate
cannot size itself. Single-row updates patch in place; replacing the array
resets contentY and throws the user to the top.
Shared controls gained the arms the new views need, with the numbers taken from
the .slint and not guessed: SettingsButton (btnHeight / minWidth /
trailingIconName), QbzEmptyState's four metrics, QbzSelect's `sm` variant
(30px, r6, no outline, 12px label, 14px chevron, 40px narrower —
QbzSelect.slint:74-148), QbzContextMenu.openBelowLeft, and QbzLineEdit gains a
distinct `accepted` signal fired on ENTER ONLY: a modal that submits on
`committed` submits TWICE, because closing it removes focus and fires
`committed` again — a rename would have run twice and a create made two
collections. clearSearch() no longer assigns root.text either; that JS write
destroyed the call site's binding permanently, so Rust could never re-seed the
field after one click on the X.
SourceIcon gained the plain "qobuz" arm it was missing, which had every Qobuz
row in a collection drawing itself as a local file.
Two icons (turntable, image) are baked from the Slint masters into the seven
full tint dirs and registered in MASTERS; three more (circle-check-big,
circle-alert, triangle-alert) back the toast. A missing tint dir or glyph
renders nothing and logs nothing, so this class never surfaces in a build.
cc
54 lines
1.9 KiB
QML
54 lines
1.9 KiB
QML
// QbzLoadingDots — the three-dot "still resolving" indicator
|
|
// (primitives/LoadingDots.slint). Mounted in the MyQBZ detail row's 160px
|
|
// quality cell while the badge has not resolved yet.
|
|
//
|
|
// A CHEAPER APPROXIMATION, on purpose. Slint runs a per-dot triangle wave off
|
|
// `animation-tick()` — phase offsets 0 / 0.18 / 0.36 over 900ms,
|
|
// `opacity: 0.25 + 0.55 * tri` (so 0.25 … 0.80, LoadingDots.slint:15-20).
|
|
// That is a per-DELEGATE animation, and in a windowed list of hundreds of rows
|
|
// it is exactly what the port's perf rule forbids. So the phase comes IN as an
|
|
// int 0..2 and the HOST owns one `Timer { interval: 300; repeat: true }` for
|
|
// the whole view, gated `<any row resolving> && visible && windowShowing`
|
|
// (PlaylistView.qml:156-159 + :173-179 — freeze on not-visible or minimized,
|
|
// NEVER on lost focus: a tiling desktop keeps windows visible and unfocused).
|
|
//
|
|
// The dot row CENTRES itself in whatever host it is given, because the .slint
|
|
// component inherits Rectangle and therefore fills its cell and centres its
|
|
// layout (:26-35) — it is not left-aligned at x=0.
|
|
//
|
|
// Slint's optional `label` arm (:36-41) is unused by MyQBZ and not ported.
|
|
|
|
import QtQuick
|
|
import com.blitzfc.qbz
|
|
import "../theme"
|
|
|
|
Item {
|
|
id: root
|
|
|
|
/// 0..2 — which dot is lit. Cycled by ONE Timer in the host view.
|
|
property int phase: 0
|
|
|
|
QbzTheme { id: theme }
|
|
|
|
implicitWidth: 3 * 8 + 2 * 8
|
|
implicitHeight: 8
|
|
|
|
Row {
|
|
anchors.centerIn: parent
|
|
spacing: 8
|
|
Repeater {
|
|
// A STATIC model (3), so the delegates are built once and only
|
|
// their opacity binding re-evaluates.
|
|
model: 3
|
|
delegate: Rectangle {
|
|
required property int index
|
|
width: 8
|
|
height: 8
|
|
radius: 4
|
|
color: theme.textSecondary
|
|
opacity: root.phase === index ? 0.8 : 0.25
|
|
}
|
|
}
|
|
}
|
|
}
|