fix(slint): correct BP marking and widen the output-device list

The BP badge marked every ALSA device; it now marks only the direct
hardware PCMs (hw:/front:/iec958:/hdmi:), matching Tauri — sysdefault
and plug devices are not bit-perfect. The device list also opens at
480px (right-anchored) so the full card + PCM id name is readable
instead of being elided in a 300px control.

cc
This commit is contained in:
vicrodh committed 2026-05-19 00:03:06 -06:00
1 parent 9cf2c5588f
commit 87cf74764c
3 files changed
+26 -6

No files matched your search

+11 -2
View File
@@ -27,9 +27,16 @@ export component QbzSelect inherits Rectangle {
in property <[bool]> badges: [];
in property <int> current-index: 0;
in property <length> menu-width: 240px;
// Optional: a wider open list than the collapsed control, for long
// option labels (device names). 0px keeps the list at `menu-width`.
in property <length> popup-width: 0px;
in property <bool> enabled: true;
callback selected(int);
// Resolved width of the open list.
private property <length> list-width:
root.popup-width > root.menu-width ? root.popup-width : root.menu-width;
width: root.menu-width;
height: 34px;
border-radius: Radius.sm;
@@ -79,9 +86,11 @@ export component QbzSelect inherits Rectangle {
}
popup := PopupWindow {
x: 0;
// Right-anchored so a list wider than the control grows leftward
// and stays on-screen.
x: root.menu-width - root.list-width;
y: root.height + 4px;
width: root.menu-width;
width: root.list-width;
height: root.options.length * 32px + 10px;
Rectangle {