Each pill now starts with the app's icon: the same coloured tile with a letter that the dock draws for that app id, so an app looks the same in both. The app id comes from windows.all (the task-bar rows carry only titles); windows without one fall back to a title-keyed tile. Pills narrower than 72px show just the centred icon. The tile drawing moves into lib/dock (app_icon, app_glyph) and the dock uses it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DPL5hm1XqzhrA4N8FyhuRa
This commit is contained in:
5 files changed
+105
-12
No files matched your search
@@ -55,3 +55,25 @@ test "render draws one tile and glyph per app, capped at max_tiles" {
|
||||
assert_eq(tile_name(apps(), 1), "b!")
|
||||
assert_eq(tile_name(apps(), 9), "")
|
||||
}
|
||||
|
||||
///|
|
||||
test "app glyph comes from the app id's last part, else the title" {
|
||||
assert_eq(app_glyph("org.gnome.Nautilus", "Files"), "N")
|
||||
assert_eq(app_glyph("foot", ""), "F")
|
||||
assert_eq(app_glyph("org.chandra.", "x"), "C")
|
||||
assert_eq(app_glyph("", " terminal"), "T")
|
||||
assert_eq(app_glyph("", ""), "?")
|
||||
}
|
||||
|
||||
///|
|
||||
test "an app's icon is its coloured tile plus glyph" {
|
||||
let ops = app_icon(20, 17, 22, "foot", "F")
|
||||
assert_eq(ops.length(), 2)
|
||||
match ops[0] {
|
||||
FillRect(f) => {
|
||||
assert_eq(f.rect.x, 9)
|
||||
assert_eq(f.color.r, tile_color("foot").r)
|
||||
}
|
||||
_ => fail("expected a tile")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user