feat(ui): speaker glyph + searchable output-device select
QbzSelect badges now render a "BP" tag for bit-perfect outputs and a speaker glyph (volume-2) for the rest (real outputs that play audio but not bit-perfect) — an addition, not a replacement. Only the device select passes badges, so other selects are unchanged. Add opt-in `searchable`: long output lists overflowed at 1440p, so the open list gets a case-insensitive filter box and a 360px scroll cap. Filtering hides non-matching rows by visibility only (model order intact, so selected(i) keeps the original index). Backed by a new Rust TextUtil.contains-ci pure callback (Slint 1.16 has no contains builtin). cc
This commit is contained in:
5 files changed
+167
-41
No files matched your search
@@ -3712,6 +3712,17 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
});
|
||||
}
|
||||
|
||||
// Case-insensitive substring test backing the searchable QbzSelect
|
||||
// (Slint 1.16 has no `contains` builtin). Pure + stateless, so a single
|
||||
// registration at setup serves every searchable list.
|
||||
window
|
||||
.global::<TextUtil>()
|
||||
.on_contains_ci(|haystack: slint::SharedString, needle: slint::SharedString| {
|
||||
haystack
|
||||
.to_lowercase()
|
||||
.contains(needle.to_lowercase().as_str())
|
||||
});
|
||||
|
||||
// Genre filter — selection is per context ("discover" / "favorites").
|
||||
// Toggling / clearing re-fetches the discover index (discover context)
|
||||
// or re-derives the favorites tab (favorites context).
|
||||
|
||||
Reference in new issue
Block a user