// First-run pairing guide for the Apple Siri Remote. The frosted pane behind // it is drawn by the glass layer (see `glass-over` in app.slint). import { BackGlyph, TvGlyph, PlayPauseGlyph, MuteGlyph, PlusGlyph, MinusGlyph, PowerGlyph, CheckIcon, AlertIcon } from "icons.slint"; // Pulsing ring that draws the eye to a button. component Pulse inherits Rectangle { in property size; in property tint; in property delay; property phase: mod((animation-tick() + root.delay) / 1400ms, 1); width: self.size * (1 + 0.9 * self.phase); height: self.width; border-radius: self.width / 2; border-width: 3px; border-color: root.tint.with-alpha(0.9 * (1 - self.phase)); background: root.tint.with-alpha(0.18 * (1 - self.phase)); } component RemoteButton inherits Rectangle { in property u; // back | tv | playpause | mute | plus in property glyph; in property hot; in property accent; property ink: self.hot ? self.accent.brighter(0.5) : #e8e8ea; property g: 26 * self.u; width: 52 * self.u; height: self.width; border-radius: self.width / 2; background: self.hot ? #2a2a2e : #1b1b1d; drop-shadow-blur: 3 * self.u; drop-shadow-color: #00000080; drop-shadow-offset-y: 1 * self.u; if root.hot: Pulse { size: root.width; tint: root.accent; x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; } if root.hot: Pulse { size: root.width; tint: root.accent; delay: 700ms; x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; } if root.glyph == "back": BackGlyph { x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; width: root.g; height: root.g; ink: root.ink; } if root.glyph == "tv": TvGlyph { x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; width: root.g; height: root.g; ink: root.ink; } if root.glyph == "playpause": PlayPauseGlyph { x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; width: root.g; height: root.g; ink: root.ink; } if root.glyph == "mute": MuteGlyph { x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; width: root.g; height: root.g; ink: root.ink; } if root.glyph == "plus": PlusGlyph { x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; width: root.g; height: root.g; ink: root.ink; } } // Apple Siri Remote (2nd gen, aluminium), drawn front-on. export component SiriRemote inherits Rectangle { in property u; in property accent; width: 150 * self.u; height: 560 * self.u; border-radius: 44 * self.u; background: #c4c8ce; border-width: 2px; border-color: #ffffff40; drop-shadow-blur: 30 * self.u; drop-shadow-color: #000000a0; drop-shadow-offset-y: 16 * self.u; // Siri button on the right edge. Rectangle { x: parent.width - 2 * root.u; y: 200 * root.u; width: 5 * root.u; height: 46 * root.u; border-radius: 2 * root.u; background: #8b9097; } // Power button. Rectangle { x: parent.width - 34 * root.u; y: 16 * root.u; width: 18 * root.u; height: 18 * root.u; border-radius: self.width / 2; background: #1b1b1d; PowerGlyph { x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; width: 12 * root.u; height: 12 * root.u; ink: #d0d0d4; } } // Clickpad: outer touch ring and center. Rectangle { x: (parent.width - self.width) / 2; y: 44 * root.u; width: 128 * root.u; height: self.width; border-radius: self.width / 2; background: @radial-gradient(circle, #2b2c30 0%, #1a1b1d 100%); Rectangle { x: (parent.width - self.width) / 2; y: (parent.height - self.height) / 2; width: 64 * root.u; height: self.width; border-radius: self.width / 2; background: #232427; border-width: 1px; border-color: #ffffff14; } for d in [{ x: 0.5, y: 0.1 }, { x: 0.5, y: 0.9 }, { x: 0.1, y: 0.5 }, { x: 0.9, y: 0.5 }]: Rectangle { x: parent.width * d.x - 2.5 * root.u; y: parent.height * d.y - 2.5 * root.u; width: 5 * root.u; height: self.width; border-radius: self.width / 2; background: #ffffff60; } } // Button grid below the clickpad. property col1: 18 * root.u; property col2: root.width - 18 * root.u - 52 * root.u; RemoteButton { u: root.u; accent: root.accent; x: root.col1; y: 200 * root.u; glyph: "back"; hot: true; } RemoteButton { u: root.u; accent: root.accent; x: root.col2; y: 200 * root.u; glyph: "tv"; } RemoteButton { u: root.u; accent: root.accent; x: root.col1; y: 268 * root.u; glyph: "playpause"; } RemoteButton { u: root.u; accent: root.accent; x: root.col1; y: 336 * root.u; glyph: "mute"; } // Volume rocker: + is the one to hold. Rectangle { x: root.col2; y: 268 * root.u; width: 52 * root.u; height: 120 * root.u; border-radius: self.width / 2; background: #1b1b1d; RemoteButton { u: root.u; accent: root.accent; x: 0; y: 0; glyph: "plus"; hot: true; background: transparent; } MinusGlyph { x: (parent.width - self.width) / 2; y: parent.height - 52 * root.u + (52 * root.u - self.height) / 2; width: 26 * root.u; height: 26 * root.u; ink: #e8e8ea; } } } component Step inherits Rectangle { in property u; in property n; in property label; in property accent; // The glass bead behind the number is drawn by the glass layer (app.slint), // on the same 48 px square. Text { x: 0; y: 0; width: 48 * root.u; height: 48 * root.u; text: root.n; color: root.accent.brighter(0.6); font-size: 22 * root.u; font-weight: 700; horizontal-alignment: center; vertical-alignment: center; } Text { x: 72 * root.u; y: 6 * root.u; width: parent.width - 72 * root.u; text: root.label; wrap: word-wrap; font-size: 26 * root.u; color: #ffffffe0; } } // Pane content; `state` is the remote status from sf-remote. The text column // starts at (content-x, content-y); `steps` and `pill-y` are offsets from // there, shared with the glass beads and pills in app.slint. export component PairingGuide inherits Rectangle { in property u; in property state; in property accent: #ff7a35; in property content-x; in property content-y; in property <[length]> steps; in property pill-y; property ok: self.state == "paired" || self.state == "connected"; property broken: self.state == "no-adapter"; SiriRemote { u: root.u; accent: root.accent; x: (root.content-x - self.width) / 2; y: (parent.height - self.height) / 2; } Rectangle { x: root.content-x; y: root.content-y; width: parent.width - root.content-x - 88 * root.u; height: parent.height - root.content-y; Text { x: 0; y: 0; width: parent.width; text: "Párosítsd a Siri Remote-ot"; font-weight: 700; font-size: 52 * root.u; letter-spacing: -1 * root.u; color: #ffffff; overflow: elide; } Step { u: root.u; accent: root.accent; x: 0; y: root.steps[0]; width: parent.width; height: 64 * root.u; n: 1; label: "Vidd a távirányítót a TV közelébe."; } Step { u: root.u; accent: root.accent; x: 0; y: root.steps[1]; width: parent.width; height: 100 * root.u; n: 2; label: "Tartsd nyomva egyszerre a Vissza és a Hangerő + gombot, kb. 5 másodpercig."; } Step { u: root.u; accent: root.accent; x: 0; y: root.steps[2]; width: parent.width; height: 64 * root.u; n: 3; label: "Engedd el. A TV magától megtalálja és párosítja."; } // Live status, on the glass pill drawn by app.slint (520 x 64). Rectangle { x: 0; y: root.pill-y; width: 520 * root.u; height: 64 * root.u; // Searching: three breathing dots. Done: check mark. Error: alert. if !root.ok && !root.broken: HorizontalLayout { x: 0; width: 56 * root.u; spacing: 8 * root.u; alignment: start; for i in 3: Rectangle { property p: mod((animation-tick() + i * 180ms) / 900ms, 1); y: (parent.height - self.height) / 2; width: 10 * root.u; height: self.width; border-radius: self.width / 2; background: root.accent.brighter(0.4); opacity: 0.25 + 0.75 * abs(sin(self.p * 180deg)); } } if root.ok: CheckIcon { x: 24 * root.u; y: (parent.height - self.height) / 2; width: 32 * root.u; height: 32 * root.u; ink: #34c759; } if root.broken: AlertIcon { x: 24 * root.u; y: (parent.height - self.height) / 2; width: 32 * root.u; height: 32 * root.u; ink: #ff9f0a; } Text { x: root.ok || root.broken ? 72 * root.u : 64 * root.u; width: parent.width - 96 * root.u; height: parent.height; vertical-alignment: center; font-size: 24 * root.u; font-weight: 500; color: #ffffff; overflow: elide; text: root.ok ? "Sikeres párosítás" : root.broken ? "Nem található Bluetooth adapter" : root.state == "pairing" ? "Párosítás…" : "Távirányító keresése…"; } } // Skip chip (glass in app.slint, 200 x 64). Text { x: 544 * root.u; y: root.pill-y; width: 200 * root.u; height: 64 * root.u; horizontal-alignment: center; vertical-alignment: center; text: "Kihagyás"; font-size: 24 * root.u; font-weight: 600; color: #ffffffd0; } } }