// Icons sf-ui does not have (shuffle, repeat, heart, lyrics, queue), drawn // the same way: strokes on a 32 grid. Any other name goes to sf-ui's Icon. import { Tv, Icon } from "@sf-ui/sf-ui.slint"; export component SpIcon inherits Rectangle { in property name; in property ink: Tv.text; in property size: 32 * Tv.u; width: self.size; height: self.size; property own: self.name == "shuffle" || self.name == "repeat" || self.name == "repeat-one" || self.name == "heart" || self.name == "heart-filled" || self.name == "lyrics" || self.name == "queue" || self.name == "devices"; property filled: self.name == "heart-filled"; if !root.own: Icon { name: root.name; ink: root.ink; size: root.size; } if root.own: Path { width: 100%; height: 100%; viewbox-width: 32; viewbox-height: 32; stroke: root.ink; stroke-width: root.size * 2.4 / 32; fill: root.filled ? root.ink : transparent; commands: root.name == "shuffle" ? "M 4 9 L 9 9 C 15 9 17 23 23 23 L 28 23 M 24.5 19.5 L 28 23 L 24.5 26.5 M 4 23 L 9 23 C 11.5 23 13 21 14.5 18 M 17.5 14 C 19 11 20.5 9 23 9 L 28 9 M 24.5 5.5 L 28 9 L 24.5 12.5" : root.name == "repeat" ? "M 6 16 L 6 12.5 C 6 10 7.5 8.5 10 8.5 L 26 8.5 M 22.5 5 L 26 8.5 L 22.5 12 M 26 16 L 26 19.5 C 26 22 24.5 23.5 22 23.5 L 6 23.5 M 9.5 27 L 6 23.5 L 9.5 20" : root.name == "repeat-one" ? "M 6 16 L 6 12.5 C 6 10 7.5 8.5 10 8.5 L 26 8.5 M 22.5 5 L 26 8.5 L 22.5 12 M 26 16 L 26 19.5 C 26 22 24.5 23.5 22 23.5 L 6 23.5 M 9.5 27 L 6 23.5 L 9.5 20 M 14.5 14 L 16.5 12.8 L 16.5 19.5" : root.name == "heart" || root.name == "heart-filled" ? "M 16 26.5 L 6.2 16.8 C 3.2 13.8 3.6 9 7.4 7.4 C 10.4 6.1 13.8 7.3 16 10.2 C 18.2 7.3 21.6 6.1 24.6 7.4 C 28.4 9 28.8 13.8 25.8 16.8 Z" : root.name == "lyrics" ? "M 16 4 C 18.5 4 20.5 6 20.5 8.5 L 20.5 15 C 20.5 17.5 18.5 19.5 16 19.5 C 13.5 19.5 11.5 17.5 11.5 15 L 11.5 8.5 C 11.5 6 13.5 4 16 4 Z M 7.5 14.5 C 7.5 19.5 11.3 23.5 16 23.5 C 20.7 23.5 24.5 19.5 24.5 14.5 M 16 23.5 L 16 28 M 11 28 L 21 28" : root.name == "queue" ? "M 5 8 L 22 8 M 5 14 L 22 14 M 5 20 L 13 20 M 18 18.5 L 18 27.5 L 26 23 Z" : root.name == "devices" ? "M 4 7 L 22 7 L 22 20 L 4 20 Z M 9 25 L 17 25 M 25 11 L 29 11 L 29 26 L 25 26 Z" : ""; } }