From d68d3f481c2c6df5da96a2817d3de2dd5b8bbc53 Mon Sep 17 00:00:00 2001 From: bubulux Date: Wed, 25 Nov 2026 16:02:22 +0100 Subject: [PATCH] Camera buttons: black fill, white outline and icons; size per device (#426) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every camera button, the stepped controls and the last-photo thumbnail are black with a full white outline and white icons (no see-through fill, no muted outline), so they read over any picture. Their size, with the shutter, is chosen per device in Setup › Camera: small, medium or large. Co-Authored-By: Claude Opus 5.5 --- apps/mobile/src/apps/Camera.tsx | 25 ++++++++++++++++--------- apps/mobile/src/apps/Setup.tsx | 6 ++++++ apps/mobile/src/settings.ts | 11 +++++++++++ docs/features/capture.md | 2 +- 4 files changed, 34 insertions(+), 10 deletions(-) diff --git a/apps/mobile/src/apps/Camera.tsx b/apps/mobile/src/apps/Camera.tsx index a481f1b7..d91e849c 100644 --- a/apps/mobile/src/apps/Camera.tsx +++ b/apps/mobile/src/apps/Camera.tsx @@ -22,6 +22,7 @@ import { allLayouts, chooseLayout, useLayout } from "../camera/layouts"; import { captureFact, collecting, endCollection, frameBox, frames, liveView, nextFolder, startCollection, toggles, type FrameChoice } from "../camera/state"; import { Button, Empty, FIXED, Hint, Icon, ListRow, makeStyles, num, RADIUS, SectionLabel, Seg, Sheet, SheetList, SIZE, Slider, toast, type, useTheme, Block, type IconName } from "../ui"; import { registerApp } from "./registry"; +import { useCameraButtons } from "../settings"; /** * The camera (docs/features/camera-layouts.md, docs/rewrite/03-capture.md): the phone takes photos; everything else @@ -34,6 +35,7 @@ const sideways = (e: Edge) => e === "left" || e === "right"; const JUSTIFY: Record = { start: "flex-start", center: "center", end: "flex-end", between: "space-between", around: "space-around" }; function Camera({ active }: { active: boolean }) { + const sizes = useCameraButtons(); const s = useStyles(); const { width, height } = useWindowDimensions(); const project = useProject(); @@ -166,7 +168,7 @@ function Camera({ active }: { active: boolean }) { if (c.kind === "readout") { const r = readout(i.control); return r ? {r.text} : null; } if (c.kind === "shutter") return ( void shoot()} - style={({ pressed }) => [s.shutter, pressed && { transform: [{ scale: 0.94 }] }, (!ready || busy) && { opacity: 0.6 }]}> + style={({ pressed }) => [s.shutter, { width: sizes.shutter, height: sizes.shutter, borderRadius: sizes.shutter / 2 }, pressed && { transform: [{ scale: 0.94 }] }, (!ready || busy) && { opacity: 0.6 }]}> ); if (i.control === "lenses") { if (lensList.length < 2) return null; @@ -200,7 +202,7 @@ function Camera({ active }: { active: boolean }) { case "layout": return btn(undefined, () => setSheet("layout")); case "uploads": return btn(undefined, () => openApp("setup", "uploads"), { text: counts.waiting ? String(counts.waiting) : undefined, warn: counts.stuck > 0 }); case "last": return ( - last && openApp("media", last.id)} style={s.thumb}> + last && openApp("media", last.id)} style={[s.thumb, { width: sizes.size, height: sizes.size }]}> {last && } ); @@ -367,15 +369,20 @@ function NameInput({ value, onChange, placeholder }: { value: string; onChange: return ; } -/** A camera control (ux-5-phone.md): outlined when off, filled in the accent colour when on; with text it is a pill. */ +/** + * A camera control (ux-5-phone.md): black with a white outline and a white icon when off, so it reads over any + * picture (#426: no see-through fill, no muted outline); filled in the accent colour when on; with text a pill. + * Its size is this device's choice (Setup › Camera buttons). + */ function CamButton({ icon, text, label, on, warn, disabled, onPress }: { icon?: IconName; text?: string; label: string; on?: boolean; warn?: boolean; disabled?: boolean; onPress: () => void }) { const s = useStyles(); const { c } = useTheme(); - const fg = on ? c.onAccent : disabled ? "rgba(255,255,255,.4)" : FIXED.white; + const sizes = useCameraButtons(); + const fg = on ? c.onAccent : FIXED.white; return ( [s.cam, text !== undefined && s.camPill, on && { backgroundColor: c.accent, borderColor: c.accent }, warn && { borderColor: FIXED.record }, pressed && !on && { backgroundColor: "rgba(255,255,255,.16)" }]}> - {icon && } + style={({ pressed }) => [s.cam, { minWidth: sizes.size, height: sizes.size, borderRadius: sizes.size / 2 }, text !== undefined && s.camPill, on && { backgroundColor: c.accent, borderColor: c.accent }, warn && { borderColor: FIXED.record }, pressed && { opacity: 0.7 }, disabled && { opacity: 0.45 }]}> + {icon && } {text !== undefined && {text}} ); @@ -400,14 +407,14 @@ const useStyles = makeStyles(() => ({ tagWarn: { backgroundColor: FIXED.record }, strip: { flexDirection: "row", gap: 8, alignItems: "center" }, stripV: { flexDirection: "column" }, - stepped: { flexDirection: "row", alignItems: "center", gap: 4, padding: 3, borderRadius: 28, borderWidth: 2, borderColor: "rgba(255,255,255,.5)" }, + stepped: { flexDirection: "row", alignItems: "center", gap: 4, padding: 3, borderRadius: 28, borderWidth: 2, borderColor: FIXED.white, backgroundColor: FIXED.black }, steppedValue: { ...type("label", "bold"), color: FIXED.white, minWidth: 44, textAlign: "center", ...num }, ctl: { alignItems: "center", gap: 2 }, ctlLabel: { ...type("caption", "bold"), fontSize: 10, color: FIXED.white, opacity: 0.85 }, - thumb: { width: SIZE.touchMin, height: SIZE.touchMin, borderRadius: RADIUS.sm, overflow: "hidden", borderWidth: 2, borderColor: "rgba(255,255,255,.5)", backgroundColor: "rgba(255,255,255,.08)" }, + thumb: { width: SIZE.touchMin, height: SIZE.touchMin, borderRadius: RADIUS.sm, overflow: "hidden", borderWidth: 2, borderColor: FIXED.white, backgroundColor: FIXED.black }, shutter: { width: SIZE.shutter, height: SIZE.shutter, borderRadius: SIZE.shutter / 2, borderWidth: 4, borderColor: FIXED.white, alignItems: "center", justifyContent: "center" }, shutterInner: { width: SIZE.shutter - 16, height: SIZE.shutter - 16, borderRadius: (SIZE.shutter - 16) / 2, backgroundColor: FIXED.white }, - cam: { minWidth: SIZE.touchMin, height: SIZE.touchMin, borderRadius: SIZE.touchMin / 2, borderWidth: 2, borderColor: "rgba(255,255,255,.7)", alignItems: "center", justifyContent: "center", flexDirection: "row", gap: 4 }, + cam: { minWidth: SIZE.touchMin, height: SIZE.touchMin, borderRadius: SIZE.touchMin / 2, borderWidth: 2, borderColor: FIXED.white, backgroundColor: FIXED.black, alignItems: "center", justifyContent: "center", flexDirection: "row", gap: 4 }, camPill: { paddingHorizontal: 14 }, camText: { ...type("label", "bold"), ...num }, previewChip: { position: "absolute", left: 12, right: 12, top: "45%", flexDirection: "row", gap: 6, alignItems: "center", justifyContent: "center", backgroundColor: FIXED.white, borderRadius: 20, paddingVertical: 8 }, diff --git a/apps/mobile/src/apps/Setup.tsx b/apps/mobile/src/apps/Setup.tsx index f5b8abfe..2a41e978 100644 --- a/apps/mobile/src/apps/Setup.tsx +++ b/apps/mobile/src/apps/Setup.tsx @@ -237,6 +237,7 @@ function PendingNote() { } function CameraPage({ back }: { back: () => void }) { + const local = settings.use(); const { layout } = useLayout(); const own = ownLayouts.use(); const { c } = useTheme(); @@ -244,6 +245,11 @@ function CameraPage({ back }: { back: () => void }) { const edit = (p: Parameters[1]) => editLayout(layout.id, p); return ( }> + + Buttons on this device + setSettings({ cameraButtons: v })} options={[{ id: "s", label: "Small" }, { id: "m", label: "Medium" }, { id: "l", label: "Large" }]} /> + The size of the camera's buttons and shutter here only: small suits a phone, large a tablet. + Camera layout on this device {allLayouts().map((l) => chooseLayout(l.id)} />)} {own.length ? "" : "Layouts of your own are made in the Studio (Camera layouts). "}Which controls a layout shows, and where, is arranged in the Studio; its look and options can be changed here too. diff --git a/apps/mobile/src/settings.ts b/apps/mobile/src/settings.ts index 154be5fb..2df2f86b 100644 --- a/apps/mobile/src/settings.ts +++ b/apps/mobile/src/settings.ts @@ -12,9 +12,20 @@ export interface LocalSettings { /** Keep the active project's thumbnails and previews on the phone (Media without a connection). */ keepProject: boolean; logging: boolean; + /** How large the camera's buttons are on this device (#426): small on a phone, large on a tablet. */ + cameraButtons?: CameraButtonSize; } +export type CameraButtonSize = "s" | "m" | "l"; +/** The camera's button sizes (dp): the button, its icon, the shutter. */ +export const CAMERA_BUTTONS: Record = { + s: { size: 40, icon: 18, shutter: 64 }, + m: { size: 48, icon: 22, shutter: 76 }, + l: { size: 60, icon: 28, shutter: 92 }, +}; export const settings = persisted("settings.v2", { offlineMode: false, keepProject: false, logging: false }); +/** This device's camera button sizes. */ +export const useCameraButtons = () => CAMERA_BUTTONS[settings.use().cameraButtons ?? "m"]; export function setSettings(change: Partial) { settings.set((s) => ({ ...s, ...change })); diff --git a/docs/features/capture.md b/docs/features/capture.md index 1511a5c7..fd32970d 100644 --- a/docs/features/capture.md +++ b/docs/features/capture.md @@ -10,7 +10,7 @@ The phone takes photos. A capture is one photo: queued at once, visible in Media - **Real lenses only** ([phone app](phone-app.md#this-device-srcdevicets-srclensests)): a lens is opened as the logical camera at the lens's zoom, or as a camera of its own. No digital zoom, so every photo is the full picture of one real lens and its EXIF describes it. A phone with one lens shows no lens rail. - **Lens names**: as the phone calls them (0.5×, 1×, 5×), or by the reported full-frame focal length (Setup, Camera; the account's preference). - **Built-in layout**: held upright, the lens rail above the control row; in landscape the control row stands at the right (beside the tab bar), the lens rail at the far left. Control row: uploads (count, red when something is stuck; opens Setup, Uploads), the last photo (opens it in Media), the shutter, the torch (filled when on). A strip over the picture names the project and the lens in use. -- Camera buttons are outlined when off and filled in the accent colour when on. +- Camera buttons are black with a white outline and a white icon when off, so they read over any picture, and filled in the accent colour when on (#426). Their size (with the shutter and the last-photo thumbnail) is chosen per device in Setup › Camera: small (40 dp), medium (48), large (60), kept in this device's settings (`cameraButtons`). ## What a capture produces (`src/media/pipeline.ts`)