feat(signage): widget settings regrouped (main / Text and colours / More), alignment that lines up multi-line widgets, multi-line texts, gallery title, logos larger than the slide; calibration past the recognised resolution and shown the first time
Owner review 2026-11-23 of every widget: - A widget card is its main settings (the row and what needs room under it: pictures, a gallery's pictures or folder, weather details and place, a countdown's start and end, reviews' stars and author, a scrolling text's speed, a shape's colours and border, QR caption), then "Text and colours" (new LookFields.jsx: text colour, plate, font, style, size, weight, highlight, shadow, QR colours; a logo's / gallery's border), then More settings (opacity, rotation, animation, fit, typing, blink, QR logo; shadow / border only where there is no Text and colours). - Date format / separator and clock 12/24 / separator are main settings. - Alignment only where it lines something up; the TV now aligns the lines of a text, the hours (centre: days and times meet in the middle), contact rows, Wi-Fi (code left / right / above), the weather's column / card / list / hourly, reviews (stars too), a countdown, a QR caption. - Text and message: a 2-line textarea in its own row; Enter makes new lines (the TV sizes by the longest line and the number of lines). - Gallery: a title above or below the pictures (title_position). - A widget's box may reach 400 % of the slide (a logo zoomed in past the slide's edges saved again). - "Auto" stays "Auto" in Greek; scrolling text Left / Right; reviews' stars choice no longer clipped; countdown "When it ends" hint as an info tip (fields level). Calibration: an edge may go past the recognised window (down to -2000 px); the dialog's rows are centred, "Each click moves" sits above its choice, the window size is labelled "Recognised resolution" with what it means; the TV asks for its screen answer on every calibrate event and while calibrating (the outline shows the first time), the dialog sends "on" again after 1.5 s. NumberInput takes a leading minus when min < 0. E2E: waits for the Add-a-slide dialog to go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -57,6 +57,7 @@ REVIEWS = "signage.reviews" # the venue's reviews, typed in by hand
|
||||
MAX_WIDGETS = "signage.max_widgets" # widgets a slide may hold (owner review 6: Performance; 10 recommended)
|
||||
MAX_WIDGETS_CAP = 50 # never more, whatever the setting
|
||||
AREA_MAX = 4000 # px a screen's picture area may cut off one edge (6R.13)
|
||||
AREA_OUT = 2000 # px it may reach past an edge of the window the TV reported (owner 2026-11-23)
|
||||
AREA_KEYS = ("area_left", "area_top", "area_right", "area_bottom")
|
||||
CALIBRATE_S = 15 * 60 # a calibration nobody ends stops by itself
|
||||
_viewports: dict = {} # device id → {width, height, ratio} (what the TV reported; memory only)
|
||||
@@ -199,19 +200,24 @@ class MenuList(_Strict):
|
||||
return out
|
||||
|
||||
|
||||
BOX_MAX = 400 # % of the slide a widget's box may reach (owner 2026-11-23)
|
||||
|
||||
|
||||
class Box(_Strict):
|
||||
"""Where a widget moved by hand sits (2026-11-21): % of the slide's (or its stack place's) width /
|
||||
height. Owner review 6: it may run off the slide, as long as a strip of it (5 %) stays on it to
|
||||
grab it back; a text, clock, QR… is as big as its content (its height sets the size)."""
|
||||
x: float = Field(ge=-100, le=100)
|
||||
y: float = Field(ge=-100, le=100)
|
||||
w: float = Field(ge=1, le=100)
|
||||
h: float = Field(ge=1, le=100)
|
||||
grab it back; a text, clock, QR… is as big as its content (its height sets the size). Owner
|
||||
2026-11-23: up to four times the slide (a picture made larger than the slide is cut off at its
|
||||
edges, zoomed in)."""
|
||||
x: float = Field(ge=-BOX_MAX, le=100)
|
||||
y: float = Field(ge=-BOX_MAX, le=100)
|
||||
w: float = Field(ge=1, le=BOX_MAX)
|
||||
h: float = Field(ge=1, le=BOX_MAX)
|
||||
|
||||
@model_validator(mode="after")
|
||||
def _inside(self):
|
||||
self.w = round(min(self.w, 100), 2)
|
||||
self.h = round(min(self.h, 100), 2)
|
||||
self.w = round(self.w, 2)
|
||||
self.h = round(self.h, 2)
|
||||
self.x = round(min(max(self.x, 5 - self.w), 95), 2)
|
||||
self.y = round(min(max(self.y, 5 - self.h), 95), 2)
|
||||
return self
|
||||
@@ -328,6 +334,7 @@ class Widget(_Strict):
|
||||
gallery_seconds: int = Field(default=5, ge=3, le=120)
|
||||
gallery_transition: Literal["fade", "slide", "zoom", "none"] = "fade"
|
||||
gallery_fit: Literal["cover", "contain"] = "cover"
|
||||
title_position: Literal["above", "below"] = "above" # its title (`text`) above or below the pictures (owner 2026-11-23)
|
||||
# more settings (6R.17), every widget: on the element that places it
|
||||
opacity: int = Field(default=100, ge=10, le=100)
|
||||
rotation: int = Field(default=0, ge=-180, le=180)
|
||||
@@ -578,10 +585,10 @@ class ScreenBody(BaseModel):
|
||||
orientation: Optional[Orientation] = None
|
||||
rotation: Optional[Literal[0, 90, 180, 270]] = None
|
||||
# its picture area (6R.13): px cut off each edge of the TV's window; how a slide of another shape fits
|
||||
area_left: Optional[int] = Field(default=None, ge=0, le=AREA_MAX)
|
||||
area_top: Optional[int] = Field(default=None, ge=0, le=AREA_MAX)
|
||||
area_right: Optional[int] = Field(default=None, ge=0, le=AREA_MAX)
|
||||
area_bottom: Optional[int] = Field(default=None, ge=0, le=AREA_MAX)
|
||||
area_left: Optional[int] = Field(default=None, ge=-AREA_OUT, le=AREA_MAX)
|
||||
area_top: Optional[int] = Field(default=None, ge=-AREA_OUT, le=AREA_MAX)
|
||||
area_right: Optional[int] = Field(default=None, ge=-AREA_OUT, le=AREA_MAX)
|
||||
area_bottom: Optional[int] = Field(default=None, ge=-AREA_OUT, le=AREA_MAX)
|
||||
fit: Optional[Literal["keep", "stretch"]] = None
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user