diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-07 12:26:11 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-07 12:26:11 +0100 |
| commit | 6dfbf712c8ad829d3f936e69a3e7fbadfc99c47a (patch) | |
| tree | 8dbd1277e7198e086cee49cd3832698582e1ccab /desktop/modules | |
| parent | 27e5bfb21627c73b53623c5ccbf93841a221bfb2 (diff) | |
| download | quickshell-6dfbf712c8ad829d3f936e69a3e7fbadfc99c47a.tar.gz quickshell-6dfbf712c8ad829d3f936e69a3e7fbadfc99c47a.zip | |
sonix: folders breadcrumbs read as a path from "SD card /"
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules')
| -rw-r--r-- | desktop/modules/sonix/Sonix.js | 2 | ||||
| -rw-r--r-- | desktop/modules/sonix/SonixFolders.qml | 4 | ||||
| -rw-r--r-- | desktop/modules/sonix/test_sonix.js | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/desktop/modules/sonix/Sonix.js b/desktop/modules/sonix/Sonix.js index 55b8ac4..fe5a711 100644 --- a/desktop/modules/sonix/Sonix.js +++ b/desktop/modules/sonix/Sonix.js @@ -105,7 +105,7 @@ function query(o) { // Breadcrumbs from the card root to path; a path outside the card is the root. function crumbs(path, root) { - const out = [{ name: "Card", path: root }]; + const out = [{ name: "SD card /", path: root }]; if (!path || path.indexOf(root + "/") !== 0) return out; let at = root; const parts = path.slice(root.length + 1).split("/"); diff --git a/desktop/modules/sonix/SonixFolders.qml b/desktop/modules/sonix/SonixFolders.qml index 4f3f2d7..8d94a73 100644 --- a/desktop/modules/sonix/SonixFolders.qml +++ b/desktop/modules/sonix/SonixFolders.qml @@ -89,12 +89,14 @@ Column { width: fo.width spacing: 6 Repeater { + id: crumbList model: S.crumbs(fo.path, fo.root) delegate: Text { textFormat: Text.PlainText required property var modelData required property int index - text: (index > 0 ? "› " : "") + modelData.name + // A path: "SD card / A / B", the root carrying its own slash. + text: modelData.name + (index > 0 && index < crumbList.count - 1 ? " /" : "") font { family: Theme.fontFamily; pixelSize: Theme.fontSize - 2 } color: modelData.path === fo.path ? Theme.text : Theme.accent MouseArea { diff --git a/desktop/modules/sonix/test_sonix.js b/desktop/modules/sonix/test_sonix.js index 7847e41..2fc044b 100644 --- a/desktop/modules/sonix/test_sonix.js +++ b/desktop/modules/sonix/test_sonix.js @@ -90,13 +90,13 @@ assert.strictEqual(S.stamp(new Date(2026, 10, 7, 9, 5, 3)), "bootlogo-20261107-0 assert.strictEqual(S.query({ do: "play_path", path: "/mnt/sd_0/a b&c.flac" }), "do=play_path&path=%2Fmnt%2Fsd_0%2Fa%20b%26c.flac"); -assert.deepStrictEqual(S.crumbs("/mnt/sd_0", "/mnt/sd_0"), [{ name: "Card", path: "/mnt/sd_0" }]); +assert.deepStrictEqual(S.crumbs("/mnt/sd_0", "/mnt/sd_0"), [{ name: "SD card /", path: "/mnt/sd_0" }]); assert.deepStrictEqual(S.crumbs("/mnt/sd_0/A/B", "/mnt/sd_0"), [ - { name: "Card", path: "/mnt/sd_0" }, + { name: "SD card /", path: "/mnt/sd_0" }, { name: "A", path: "/mnt/sd_0/A" }, { name: "B", path: "/mnt/sd_0/A/B" }, ]); -assert.deepStrictEqual(S.crumbs("/elsewhere", "/mnt/sd_0"), [{ name: "Card", path: "/mnt/sd_0" }]); +assert.deepStrictEqual(S.crumbs("/elsewhere", "/mnt/sd_0"), [{ name: "SD card /", path: "/mnt/sd_0" }]); assert.strictEqual(S.parentOf("/mnt/sd_0/A/B", "/mnt/sd_0"), "/mnt/sd_0/A"); assert.strictEqual(S.parentOf("/mnt/sd_0/A", "/mnt/sd_0"), "/mnt/sd_0"); |
