Add a phone preview Rotation setting; improve landscape layout

This commit is contained in:
James Babcock committed 2026-09-08 02:43:51 -07:00
1 parent 3d39d27456
commit 1154474754
9 files changed
+165 -74

No files matched your search

+40 -41
View File
@@ -20,9 +20,9 @@
acts as star, and this component sits in a bounded (star-row) parent,
where that would balloon the first grid to fill all remaining height. -->
<GridLayout row="0" rows="auto" columns="*,*,*,auto,auto" class="controls-tab-bar">
<Button col="0" text="Settings" tap="{{ onSettingsTabTap }}" class="{{ settingsTabClass }}" />
<Button col="1" text="Watch" tap="{{ onWatchTabTap }}" class="{{ watchTabClass }}" />
<Button col="2" text="Ring" tap="{{ onRingTabTap }}" class="{{ ringTabClass }}" />
<Button col="0" text="Settings" textWrap="false" tap="{{ onSettingsTabTap }}" class="{{ settingsTabClass }}" />
<Button col="1" text="Watch" textWrap="false" tap="{{ onWatchTabTap }}" class="{{ watchTabClass }}" />
<Button col="2" text="Ring" textWrap="false" tap="{{ onRingTabTap }}" class="{{ ringTabClass }}" />
<!-- A Button can't hold an image, so these are button-styled tiles. The
explicit star row makes the cell fill the tile's height so the icon's
center alignment has room to work in. -->
@@ -34,48 +34,47 @@
</GridLayout>
</GridLayout>
<!-- Settings tab -->
<StackLayout row="1" visibility="{{ settingsTabVisibility }}">
<GridLayout rows="auto" columns="auto,*" class="settings-row">
<Label col="0" text="Screen size" class="settings-row-label" verticalAlignment="center" />
<Button col="1" text="{{ displayModeLabel }}" tap="{{ onDisplayModeTap }}" class="mode-button" horizontalAlignment="left" />
</GridLayout>
<GridLayout rows="auto" columns="auto,*,auto" class="settings-row">
<Label col="0" text="☀" class="brightness-icon" verticalAlignment="center" />
<Slider col="1" width="100%" minValue="0" maxValue="100" value="{{ brightnessPercent }}" valueChange="{{ onBrightnessChange }}" isEnabled="{{ brightnessSliderEnabled }}" />
<StackLayout col="2" orientation="horizontal" verticalAlignment="center" class="auto-toggle">
<Label text="Auto" verticalAlignment="center" />
<Switch checked="{{ brightnessAuto }}" checkedChange="{{ onBrightnessAutoChange }}" />
</StackLayout>
</GridLayout>
</StackLayout>
<GridLayout row="1" layoutChanged="{{ onControlsContentLayoutChanged }}">
<!-- Settings tab -->
<StackLayout visibility="{{ settingsTabVisibility }}">
<GridLayout rows="auto" columns="auto,*" class="settings-row">
<Label col="0" text="Screen size" class="settings-row-label" verticalAlignment="center" />
<Button col="1" text="{{ displayModeLabel }}" tap="{{ onDisplayModeTap }}" class="mode-button" horizontalAlignment="left" />
</GridLayout>
<GridLayout rows="auto" columns="auto,*,auto" class="settings-row">
<Label col="0" text="☀" class="brightness-icon" verticalAlignment="center" />
<Slider col="1" width="100%" minValue="0" maxValue="100" value="{{ brightnessPercent }}" valueChange="{{ onBrightnessChange }}" isEnabled="{{ brightnessSliderEnabled }}" />
<StackLayout col="2" orientation="horizontal" verticalAlignment="center" class="auto-toggle">
<Label text="Auto" verticalAlignment="center" />
<Switch checked="{{ brightnessAuto }}" checkedChange="{{ onBrightnessAutoChange }}" />
</StackLayout>
</GridLayout>
</StackLayout>
<!-- Watch tab: centered in the leftover height, capped at the 1.5:1 face
aspect (watchFaceWidth = min(available, 1.5 x face height). -->
<StackLayout row="1" visibility="{{ watchTabVisibility }}" width="{{ watchFaceWidth }}" horizontalAlignment="center" verticalAlignment="center">
<GridLayout class="touchpad" tap="{{ onPadTap }}" doubleTap="{{ onPadDoubleTap }}" longPress="{{ onPadLongPress }}" swipe="{{ onPadSwipe }}" touch="{{ onPadTouch }}">
<!-- Watch tab: centered in the leftover height, capped at the 1.5:1 face
aspect (watchFaceWidth = min(available, 1.5 x face height). -->
<GridLayout visibility="{{ watchTabVisibility }}" width="{{ watchFaceWidth }}" height="{{ watchFaceHeight }}" horizontalAlignment="center" verticalAlignment="center" class="touchpad" tap="{{ onPadTap }}" doubleTap="{{ onPadDoubleTap }}" longPress="{{ onPadLongPress }}" swipe="{{ onPadSwipe }}" touch="{{ onPadTouch }}">
<Label text="{{ padFocusLine }}" class="pad-focus" horizontalAlignment="center" verticalAlignment="center" />
<Label text="▲▼ swipe ● select ●● back ‒ menu" class="pad-legend" horizontalAlignment="center" verticalAlignment="bottom" />
</GridLayout>
</StackLayout>
<!-- Ring tab: a touchpad on the ring's own scheme. Vertical swipes only
(the ring has no horizontal axis) and no focus/status line; portrait
like the ring's pad itself. The auto rows hold the cosmetic markings the
physical ring has on its touch strip (they don't take touches); the star
rows are the seven equal gaps around them, edges included. -->
<GridLayout row="1" visibility="{{ ringTabVisibility }}" class="touchpad ring-touchpad"
rows="*,auto,*,auto,*,auto,*,auto,*,auto,*,auto,*"
horizontalAlignment="center" verticalAlignment="center"
tap="{{ onRingPadTap }}" doubleTap="{{ onRingPadDoubleTap }}"
longPress="{{ onRingPadLongPress }}" swipe="{{ onRingPadSwipe }}"
touch="{{ onRingPadTouch }}">
<Label row="1" class="ring-pad-marking" isUserInteractionEnabled="false" />
<Label row="3" class="ring-pad-marking" isUserInteractionEnabled="false" />
<Label row="5" class="ring-pad-marking" isUserInteractionEnabled="false" />
<Label row="7" class="ring-pad-marking" isUserInteractionEnabled="false" />
<Label row="9" class="ring-pad-marking" isUserInteractionEnabled="false" />
<Label row="11" class="ring-pad-marking" isUserInteractionEnabled="false" />
<!-- Ring tab: a touchpad on the ring's own scheme. Vertical swipes only
(the ring has no horizontal axis) and no focus/status line; portrait
like the ring's pad itself. The auto rows hold the cosmetic markings the
physical ring has on its touch strip (they don't take touches); the star
rows are the seven equal gaps around them, edges included. -->
<GridLayout visibility="{{ ringTabVisibility }}" height="{{ ringTouchpadHeight }}" class="touchpad ring-touchpad"
rows="*,auto,*,auto,*,auto,*,auto,*,auto,*,auto,*"
horizontalAlignment="center" verticalAlignment="center"
tap="{{ onRingPadTap }}" doubleTap="{{ onRingPadDoubleTap }}"
longPress="{{ onRingPadLongPress }}" swipe="{{ onRingPadSwipe }}"
touch="{{ onRingPadTouch }}">
<Label row="1" class="ring-pad-marking" isUserInteractionEnabled="false" />
<Label row="3" class="ring-pad-marking" isUserInteractionEnabled="false" />
<Label row="5" class="ring-pad-marking" isUserInteractionEnabled="false" />
<Label row="7" class="ring-pad-marking" isUserInteractionEnabled="false" />
<Label row="9" class="ring-pad-marking" isUserInteractionEnabled="false" />
<Label row="11" class="ring-pad-marking" isUserInteractionEnabled="false" />
</GridLayout>
</GridLayout>
</GridLayout>