Themes
The station has two looks, and each profile has its own (Profile.theme, a
StationTheme). It's picked beside the profile in the Manager (On Demand →
Profiles), or on the TV with Theme in the station menu, which changes it for
whoever's watching. It's part of the profile, so it follows them to every
screen. A profile that hasn't picked gets the old station-wide setting
(stationTheme, from when there was one look for everybody), else Modern; so
does the "Who's watching?" screen, where it's nobody yet.
- 90s Cable: the yellow and blue of the weather and guide channels. Yellow headings, cyan details, hard drop shadows, square plates with a pale border, a lit row as a bright blue bar, a poster in focus in a yellow frame.
- Modern: posters over glows of colour taken from the poster in focus, under
a little grain (
ModernBackdrop); white type, rounded corners, a white ring. The default.
What follows it #
The theme was first for the apps and chrome only, with the broadcast channels 90s Cable in both. That changed: the channels the station draws follow it too, one at a time.
So far:
- Apps: On Demand (rows, walls, search, lists, the card, the drawer, Up Next, the resume question), its door, and Home.
- The guide: the TV Guide, and the guides of group and sport channels.
- Weather: every page. Modern's backdrop takes the sky's colours (day, twilight, night), its icons are the system's symbols, and the crawl is a still line of figures.
- Maps: the MBTA's departures, nearby map and subway diagram, and the world's regions. What's on a map keeps its own colours in both (the T's lines, vehicles, radar, quakes, planes); the theme is the header, the labels and the panels.
- Radio and Station Status.
- News and Did You Know? Modern drops the crawl and the strip along the bottom: the story on screen says what's next.
- Over the picture: the Select menu, the now/next banner, the channel bug, a sport channel's banner, strip and coming-up card, the replay, buffering and flaky-signal tags, the ad break, and On Demand's player bar and paused menu (dark glass in Modern, so they read over any picture).
- Search, the profile picker, and the stand-by and loading cards. The cards' lines are written in capitals with names in them; Modern keeps the capitals and sets them small, as labels.
Still 90s Cable (or their own) whichever is picked: the Video Store, the resume question's rows it shares with On Demand's card, the credits over a Plex music video, the tuner, the test pattern, the screensavers and the iPhone's remote.
How a screen follows it #
RootView (Packages/Sources/StationUI/App/RootView.swift) takes the look of whoever's watching
(StationTheme.of, defined with StationTheme and .key in
Packages/Sources/StationCore/Core/StationThemeKind.swift) and puts it in the environment
(\.stationTheme); a view reads it there, never the setting itself, so the
snapshot renderer can draw both (cable-*.png beside ondemand-*.png).
The looks differ in a few roles, not in every line, and those roles, modifiers,
and views (plus ModuleHeader in Packages/Sources/StationUI/Station/ChannelModules.swift)
are in Packages/Sources/StationUI/Core/StationTheme.swift:
| Role | Use |
|---|---|
theme.heading, theme.accent |
A title's colour, and the line under it. |
themedShadow() |
90s Cable's hard shadow under text. |
themedFocus(lit:corner:scale:glow:) |
A poster or tile, and how it's marked in focus. |
themedRow(lit:corner:rest:ring:) |
The fill of a row, pill or field; theme.rowText(lit:) for its text. |
themedPanel(corner:modern:) |
A box over the screen. |
ThemeBackdrop, ThemeHeaderBand, ThemeFooterBand |
What's behind the screen, its header and its footer. |
themedText(_:_:_:shadow:) |
A line of type: face, colour (ThemeInk) and 90s Cable's shadow in one. |
ThemedPlate |
A panel of figures: the slate-blue plate, or a pane of glass. |
themedChip() |
A label over a map. |
ThemeNightBackdrop |
Behind a programme: the night sky, or Modern's glows. |
ModuleHeader |
A module channel's header, in either look. |
A view drawn once and kept (.equatable(): the guide's rows, the maps' line
layers) is given the theme, or rebuilt with .id(theme), so a change of look
reaches it.
A new look is a case of StationTheme and a branch in each of those.
Phin Tech docs
Rabbit Ears Manager in the store →