Clicking Browser and watching nothing happen for several seconds is the one place the classroom felt broken rather than quiet. The button now becomes a throbber the instant it is pressed, and stays one until the window actually appears in the sway tree. Only a real launch spins. The dock asks sway whether Chrome is already open first, so focusing or restoring an existing window stays immediate, which is how it should feel. DVD is left alone: it has its own full-screen loading surface and does not need two answers to one click. A launch that never arrives gives up after thirty seconds, puts the icon back and says so, so a broken start cannot spin all morning. The throbber is drawn rather than a GtkSpinner: the stock one is capped well below the size of the icon it replaces, so it read as a hesitation rather than as work in progress. Pre-rendered frames swapped into the same Gtk.Image keep the button an ordinary image with ordinary clicks, and it falls back to GtkSpinner if cairo is ever missing. The pointer also turns busy while it is over the dock. Wayland gives the cursor to whichever client the pointer is over and sway offers no way to set one globally, so this only holds on our own surface — which is exactly where the pointer is at the moment a dock button is pressed. Co-Authored-By: Claude Opus 5 <[email protected]>
37 lines
939 B
Python
37 lines
939 B
Python
"""The classroom stylesheet, resolved at the room's UI scale.
|
|
|
|
The dock and the DVD control bar share this so they cannot drift apart:
|
|
one template, one set of measurements, one look.
|
|
"""
|
|
|
|
from pathlib import Path
|
|
|
|
from classroom_config import scaled
|
|
|
|
TEMPLATE = Path("/etc/ekklesia-classroom/dock/style.css.in")
|
|
|
|
# Every measurement in the template, at UI_SCALE=1.0.
|
|
MEASUREMENTS = {
|
|
"dock-radius": 24,
|
|
"dock-padding-v": 8,
|
|
"dock-padding-h": 10,
|
|
"button-radius": 16,
|
|
"button-padding": 6,
|
|
"button-size": 44,
|
|
"button-spinner": 38,
|
|
"clock-radius": 16,
|
|
"clock-padding-v": 7,
|
|
"clock-padding-h": 12,
|
|
"clock-font": 17,
|
|
}
|
|
|
|
|
|
def render(scale, template=None):
|
|
"""Resolve the measurement tokens in the stylesheet template."""
|
|
css = (template or TEMPLATE).read_text()
|
|
|
|
for token, value in MEASUREMENTS.items():
|
|
css = css.replace(f"@{token}@", str(scaled(value, scale)))
|
|
|
|
return css
|