feat(qbz-qt): port the quality badge 1:1 from the Tauri original

The port had reinvented this badge: an icon-only replica with no MP3 tier, no
full or compact form, and none of the playback states. QualityBadge.svelte and
QualityBadgeStatic.svelte in the archived Tauri tree are the reference, and
every number here comes from their CSS.

Four modes, the union of both originals: full (the 136x36 pill with tier row
and bit-rate), compact (the narrow-bar "24/96" form from issue #303), bare
(full's content without the pill chrome, for toolbars) and iconOnly (the
Hi-Res brand mark alone, or a framed 30px square for CD/MP3 so both line up in
a grid). Tier resolution follows the original's order, MP3 first so it can
never come out as CD.

The four playback states come with it: system resampling, ALSA plughw
fallback, deliberate quality adjustment and confirmed bit-perfect, each with
its own border hue and indicator glyph, plus the rich hover tooltip carrying
source, output, the reason and the fix. Rows that only advertise stored
quality leave the flags false, which is exactly what QualityBadgeStatic was.

QualityMini becomes an alias over iconOnly mode rather than a second drawing
of the same thing, so the six existing call sites keep working while there is
one badge again.

Brings the assets the port was missing: cd.svg, mp3.svg and the LINE Seed JP
face the badge is set in. Their tint is baked to #b3b3b3 because Tauri applied
it with a CSS filter and QML has none on the software path. Adds theme.alphaTier(pct)
so the badge names the alpha ramp the design specifies instead of a raw index.

build.rs now collects the whole asset tree recursively — the hand-written root
list meant a new asset compiled clean and failed at runtime with "Cannot open".

18/18 tests; offscreen smoke clean.

cc
This commit is contained in:
vicrodh committed 2026-07-28 12:49:50 -06:00
1 parent aabde3be63
commit 71c2356f7b
8 files changed
+428 -38

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" standalone="no"?>
<svg fill="#b3b3b3" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="128" width="128" version="1.1" id="_x32_" viewBox="0 0 512 512" xml:space="preserve">
<style type="text/css">
.st0{fill:#000000;}
</style>
<g>
<path class="st0" d="M508.797,215.893c-9.977-62.966-42.222-117.038-87.362-155.217C376.304,22.48,318.172,0,256.298,0 c-13.335,0-26.842,1.043-40.405,3.195c-62.966,9.985-117.038,42.23-155.217,87.37C22.48,135.689,0,193.829,0,255.703 c0,13.334,1.043,26.841,3.204,40.404c9.976,62.966,42.222,117.039,87.362,155.218C135.697,489.52,193.829,512,255.703,512 c13.334,0,26.841-1.043,40.404-3.204c62.966-9.976,117.039-42.222,155.218-87.361C489.52,376.304,512,318.172,512,256.298 C512,242.963,510.957,229.456,508.797,215.893z M425.274,399.387c-33.166,39.165-79.838,67.025-134.514,75.714 c-11.794,1.866-23.5,2.771-35.057,2.771c-53.56,0-103.924-19.456-143.09-52.598c-39.165-33.166-67.024-79.838-75.714-134.514 c-1.866-11.794-2.771-23.5-2.771-35.057c0-53.56,19.448-103.924,52.598-143.09c33.166-39.173,79.838-67.025,134.514-75.714 c11.794-1.866,23.499-2.771,35.057-2.771c53.56,0,103.924,19.448,143.089,52.598c39.165,33.166,67.025,79.838,75.714,134.514 c1.866,11.794,2.771,23.499,2.771,35.057C477.872,309.858,458.416,360.222,425.274,399.387z"/>
<path class="st0" d="M345.77,309.735l80.132,47.919c6.284-10.514,11.607-21.575,15.772-33.174l-87.508-32.286 C351.916,298.332,349.047,304.209,345.77,309.735z"/>
<path class="st0" d="M287.899,355.69l28.414,88.853c35.587-11.322,66.21-32.212,89.505-59.192l-70.628-60.953 C322.867,338.662,306.728,349.723,287.899,355.69z"/>
<path class="st0" d="M70.35,187.552l87.435,32.286c2.25-6.137,5.119-12.015,8.396-17.541l-80.067-47.854 C79.839,164.893,74.516,175.954,70.35,187.552z"/>
<path class="st0" d="M224.135,156.311l-28.407-88.853c-35.579,11.386-66.275,32.22-89.562,59.273l70.628,60.936 C189.102,173.354,205.314,162.285,224.135,156.311z"/>
<path class="st0" d="M250.804,223.254c-18.087,2.869-30.42,19.864-27.55,37.942c2.869,18.095,19.856,30.419,37.942,27.55 c18.079-2.87,30.419-19.848,27.55-37.942C285.877,232.725,268.891,220.384,250.804,223.254z"/>
<path class="st0" d="M339.062,256.086c0-4.328-0.342-8.714-1.044-13.106c-6.504-40.894-41.757-70.041-81.933-70.041 c-4.328,0-8.706,0.342-13.106,1.035c-40.893,6.513-70.034,41.765-70.041,81.933c0,4.328,0.342,8.706,1.035,13.107 c6.52,40.893,41.765,70.041,81.941,70.041c4.328,0,8.705-0.334,13.107-1.035C309.906,331.514,339.062,296.27,339.062,256.086z M265.801,317.796c-3.325,0.53-6.626,0.783-9.886,0.783c-30.199,0-56.836-21.968-61.711-52.778c-0.53-3.334-0.79-6.634-0.79-9.895 c0-30.199,21.975-56.836,52.785-61.702c3.325-0.53,6.627-0.79,9.887-0.79c30.207,0,56.844,21.975,61.71,52.777 c0.53,3.334,0.791,6.636,0.791,9.896C318.587,286.293,296.612,312.93,265.801,317.796z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" standalone="no"?>
<svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" fill="#b3b3b3" width="128" height="128" viewBox="0 0 32 32" id="icon"><defs><style>.cls-1{fill:none;}</style></defs><title>MP3</title><path d="M28,9H22v2h6v4H24v2h4v4H22v2h6a2,2,0,0,0,2-2V11A2,2,0,0,0,28,9Z"/><path d="M14,23H12V9h6a2,2,0,0,1,2,2v5a2,2,0,0,1-2,2H14Zm0-7h4V11H14Z"/><polygon points="8 9 6.49 14 6 15.98 5.54 14 4 9 2 9 2 23 4 23 4 15 3.84 13 4.42 15 6 19.63 7.58 15 8.16 13 8 15 8 23 10 23 10 9 8 9"/><rect id="_Transparent_Rectangle_" data-name="&lt;Transparent Rectangle&gt;" class="cls-1" width="32" height="32"/></svg>

After

Width:  |  Height:  |  Size: 658 B