refactor(slint): extract toast into qbz-slint-common crate

New shared crate qbz-slint-common (will also host the artwork primitives via a
dependency-inversion pass). toast.rs is a clean leaf over qbz-ui: only Slint
types (AppWindow, ToastKind, ToastState) + slint core (Timer/Weak). Moved
verbatim; the only edit is the import (`crate::` -> `qbz_ui::`). Bin re-exports
via `pub use qbz_slint_common::toast;` so all 154 call sites across 21 files are
unchanged. slint dep is `default-features = false` (adversarial review: a
default-features slint here would turn on the default renderer for the whole
build via feature unification). `cargo check -p qbz` green.

cc
This commit is contained in:
vicrodh committed 2026-06-25 18:15:03 -06:00
1 parent 6f9ad4668e
commit d1437c70eb
7 files changed
+27 -2

No files matched your search

+9
View File
@@ -5545,6 +5545,7 @@ dependencies = [
"qbz-playlist-import",
"qbz-plex",
"qbz-qobuz",
"qbz-slint-common",
"qbz-text-utils",
"qbz-theme",
"qbz-ui",
@@ -5953,6 +5954,14 @@ dependencies = [
"uuid 1.22.0",
]
[[package]]
name = "qbz-slint-common"
version = "0.1.0"
dependencies = [
"qbz-ui",
"slint",
]
[[package]]
name = "qbz-text-utils"
version = "0.1.0"
+1
View File
@@ -25,6 +25,7 @@ members = [
"qbz-ui",
"qbz-dac-wizard",
"qbz-text-utils",
"qbz-slint-common",
"qbz",
"qbz-credentials",
"qbz-media-controls",
+11
View File
@@ -0,0 +1,11 @@
[package]
name = "qbz-slint-common"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
description = "Shared Slint-coupled frontend helpers for the qbz app (toast; artwork primitives later)."
[dependencies]
qbz-ui = { path = "../qbz-ui" }
slint = { version = "=1.16.1", default-features = false, features = ["std", "compat-1-2"] }
+3
View File
@@ -0,0 +1,3 @@
//! Shared Slint-coupled helpers extracted from the qbz binary. Depends on
//! qbz-ui for the generated types (AppWindow, the globals, structs).
pub mod toast;
@@ -16,7 +16,7 @@ use std::time::Duration;
use slint::{ComponentHandle, Timer, TimerMode, Weak};
use crate::{AppWindow, ToastKind, ToastState};
use qbz_ui::{AppWindow, ToastKind, ToastState};
thread_local! {
// Single reusable auto-hide timer. Reused (stop + start) so a fresh
+1
View File
@@ -48,6 +48,7 @@ qbz-music-link = { path = "../qbz-music-link" }
qbz-ui = { path = "../qbz-ui" }
qbz-dac-wizard = { path = "../qbz-dac-wizard" }
qbz-text-utils = { path = "../qbz-text-utils" }
qbz-slint-common = { path = "../qbz-slint-common" }
log = { workspace = true }
env_logger = "0.11"
tokio = { workspace = true }
+1 -1
View File
@@ -113,7 +113,7 @@ mod share;
mod sidebar;
mod suggestions;
mod theme;
mod toast;
pub use qbz_slint_common::toast;
mod tray;
mod tray_settings;
mod ui_prefs;