PlayerBar.qml covers New/Classic/Large (full-width seekbar with times, responsive 3-column layout, glass Classic SongCard variant, right cluster), NowPlayingBar seam Loader picks per mode; Small unchanged. ViewMode flyout wired (New/Classic/Small/Large live, Miniplayer/ Immersive/Kiosk inert replicas), mode persisted to the shared ui_prefs npb_mode key, Large forces the sidebar open and docks the 208px cover (SidebarNowPlayingDock equivalent); AppShell bar height mode-aware (42/112). Empty and playing states verified per mode; user's persisted small pref restored after probes. km
74 lines
2.6 KiB
Rust
74 lines
2.6 KiB
Rust
use std::path::Path;
|
|
|
|
use cxx_qt_build::{CxxQtBuilder, QmlModule};
|
|
|
|
/// Collect every file under `dir` (recursive), crate-root-relative — the
|
|
/// baked icon variants (qml/assets/icons/<tint>/<name>.svg) are too many to
|
|
/// list by hand.
|
|
fn collect_qrc_files(dir: &Path, out: &mut Vec<String>) {
|
|
for entry in std::fs::read_dir(dir).unwrap_or_else(|e| panic!("read_dir {}: {e}", dir.display())) {
|
|
let path = entry.expect("dir entry").path();
|
|
if path.is_dir() {
|
|
collect_qrc_files(&path, out);
|
|
} else {
|
|
out.push(path.to_string_lossy().into_owned());
|
|
}
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let mut qrc_files: Vec<String> = vec![
|
|
"qml/assets/qbz-logo.png".to_string(),
|
|
"qml/assets/hi-res.svg".to_string(),
|
|
];
|
|
collect_qrc_files(Path::new("qml/assets/icons"), &mut qrc_files);
|
|
collect_qrc_files(Path::new("qml/assets/fonts"), &mut qrc_files);
|
|
// Non-QML resources land at qrc:/qt/qml/com/blitzfc/qbz/<path> — QML
|
|
// files in qml/ reference them relatively (e.g.
|
|
// "assets/icons/primary/plus.svg").
|
|
let qrc_refs: Vec<&str> = qrc_files.iter().map(String::as_str).collect();
|
|
|
|
CxxQtBuilder::new()
|
|
// Qt modules the bridge links against (Qt6 CMake in /usr/lib64/cmake).
|
|
.qt_module("Qml")
|
|
.qt_module("Quick")
|
|
.qt_module("QuickControls2")
|
|
.qml_module(QmlModule {
|
|
uri: "com.blitzfc.qbz",
|
|
rust_files: &["src/bridge.rs"],
|
|
qml_files: &[
|
|
"qml/Main.qml",
|
|
"qml/LoginScreen.qml",
|
|
"qml/AppShell.qml",
|
|
"qml/AlbumCard.qml",
|
|
"qml/AlbumView.qml",
|
|
"qml/ArtistView.qml",
|
|
"qml/SectionRail.qml",
|
|
"qml/Sidebar.qml",
|
|
"qml/HeaderBar.qml",
|
|
"qml/NowPlayingBarSmall.qml",
|
|
"qml/NowPlayingBar.qml",
|
|
"qml/PlayerBar.qml",
|
|
"qml/ViewModeMenu.qml",
|
|
"qml/QueuePanel.qml",
|
|
"qml/LyricsPanel.qml",
|
|
"qml/HomeView.qml",
|
|
"qml/LibraryView.qml",
|
|
"qml/SettingsView.qml",
|
|
"qml/SearchView.qml",
|
|
"qml/Cortinilla.qml",
|
|
"qml/PlaylistView.qml",
|
|
"qml/QbzTheme.qml",
|
|
"qml/QbzIcon.qml",
|
|
"qml/QbzScrollBar.qml",
|
|
"qml/QbzSpinner.qml",
|
|
"qml/RoundedImage.qml",
|
|
"qml/AmbientField.qml",
|
|
"qml/QbzContextMenu.qml",
|
|
],
|
|
qrc_files: &qrc_refs,
|
|
..Default::default()
|
|
})
|
|
.build();
|
|
}
|