fix: refine light photobooth UI for Linux KMS

This commit is contained in:
2026-11-08 12:59:01 +01:00
parent 16c4c03318
commit 2ec88c5236
5 changed files with 99 additions and 158 deletions

View File

@@ -1,6 +1,9 @@
# Photobooth app conventions # Photobooth app conventions
- Use primary color `#84bf65` and secondary color `#4caee3` throughout the UI and camera overlays. - Use primary color `#84bf65` and secondary color `#4caee3` throughout the UI and camera overlays.
- Keep the UI professional, with playful, concise instructions in German and English directly below. - Use a professional light UI with clear, concise instructions in German and matching English directly below. Avoid playful copy.
- Show the camera edge to edge, preserving aspect ratio with a centered cover crop. - Show the camera edge to edge, preserving aspect ratio with a centered cover crop.
- Make sensible, focused commits using Conventional Commits (`feat:`, `fix:`, `docs:`, etc.). - Make sensible, focused commits using Conventional Commits (`feat:`, `fix:`, `docs:`, etc.).
- Target the Linux KMS backend: let the backend choose screen dimensions and fullscreen behavior. Do not force window sizes or fullscreen in application code.
- Brand the header as `winf photobooth`, using the standard winf.at favicon, without a tagline or live-camera badge.
- Size instruction panels to their content and use consistent padding at the screen edges.

View File

@@ -44,7 +44,6 @@ fn main() -> Result<(), Box<dyn Error>> {
let mut detector = palm::Detector::new()?; let mut detector = palm::Detector::new()?;
let ui = AppWindow::new()?; let ui = AppWindow::new()?;
ui.window().set_fullscreen(true);
ui.window() ui.window()
.on_close_requested(|| slint::CloseRequestResponse::KeepWindowShown); .on_close_requested(|| slint::CloseRequestResponse::KeepWindowShown);

View File

@@ -4,59 +4,62 @@ component Instruction inherits Rectangle {
in property <string> english; in property <string> english;
in property <color> accent; in property <color> accent;
in property <bool> active; in property <bool> active;
background: active ? #ffffff0c : transparent; min-width: 0px;
border-radius: 18px; preferred-width: 0px;
vertical-stretch: 0;
background: active ? root.accent.with-alpha(0.13) : #f5f7f8;
border-radius: 16px;
HorizontalLayout { height: max(36px, german-text.height + 6px + english-text.height) + 36px;
padding: 18px; Rectangle {
spacing: 16px; x: 18px;
Rectangle { y: 18px;
width: 40px; width: 36px;
height: 40px; height: 36px;
vertical-stretch: 0; border-radius: 18px;
border-radius: 20px; background: root.active ? root.accent : #e6ebed;
background: root.active ? root.accent : #ffffff14; Text {
Text { text: root.number;
text: root.number; color: #20302b;
color: root.active ? #102017 : #ffffffaa; font-size: 17px;
font-size: 18px; font-weight: 700;
font-weight: 700; horizontal-alignment: center;
horizontal-alignment: center; vertical-alignment: center;
vertical-alignment: center;
}
}
VerticalLayout {
spacing: 5px;
Text {
text: root.german;
color: white;
font-size: 21px;
font-weight: 600;
wrap: word-wrap;
}
Text {
text: root.english;
color: #e5edf0bb;
font-size: 14px;
wrap: word-wrap;
}
} }
} }
german-text := Text {
x: 68px;
y: 18px;
width: parent.width - 86px;
height: self.preferred-height;
text: root.german;
color: #20302b;
font-size: 18px;
font-weight: 600;
wrap: word-wrap;
}
english-text := Text {
x: german-text.x;
y: german-text.y + german-text.height + 6px;
width: german-text.width;
height: self.preferred-height;
text: root.english;
color: #52635d;
font-size: 14px;
wrap: word-wrap;
}
} }
export component AppWindow inherits Window { export component AppWindow inherits Window {
title: "Fotomoment"; title: "winf photobooth";
preferred-width: 1280px; background: #f6f8f5;
preferred-height: 800px;
min-width: 360px;
min-height: 600px;
background: #101a20;
default-font-family: "DejaVu Sans"; default-font-family: "DejaVu Sans";
in property <image> video-frame; in property <image> video-frame;
in property <bool> hand-detected: false; in property <bool> hand-detected: false;
private property <color> primary: #84bf65; private property <color> primary: #84bf65;
private property <color> secondary: #4caee3; private property <color> secondary: #4caee3;
private property <length> inset: root.width < 600px ? 20px : 40px; private property <length> inset: root.width < 700px ? 20px : 32px;
private property <bool> compact: root.width < 800px;
Image { Image {
width: parent.width; width: parent.width;
@@ -65,129 +68,60 @@ export component AppWindow inherits Window {
image-fit: cover; image-fit: cover;
} }
// One continuous shade keeps copy readable without edges across the preview. header := Rectangle {
Rectangle {
width: parent.width;
height: parent.height;
background: @linear-gradient(180deg, #08131ba0 0%, #08131b00 23%, #08131b00 48%, #08131be8 100%);
}
HorizontalLayout {
x: root.inset + root.safe-area-insets.left; x: root.inset + root.safe-area-insets.left;
y: 30px + root.safe-area-insets.top; y: root.inset + root.safe-area-insets.top;
width: root.width - root.inset * 2 - root.safe-area-insets.left - root.safe-area-insets.right; width: self.preferred-width;
height: 44px; height: self.preferred-height;
spacing: 12px; border-radius: 18px;
VerticalLayout { background: #fffffff5;
Text { HorizontalLayout {
text: "fotomoment"; padding: 14px;
color: white; padding-right: 22px;
font-size: 25px; spacing: 12px;
font-weight: 700; Image {
source: @image-url("assets/winf-icon.png");
width: 44px;
height: 44px;
image-fit: contain;
} }
Text { Text {
text: "DEIN MOMENT. DEIN LÄCHELN."; text: "winf photobooth";
color: #ffffffa8; color: #20302b;
font-size: 9px; font-size: root.width < 500px ? 20px : 24px;
letter-spacing: 1.5px; font-weight: 600;
} vertical-alignment: center;
}
Rectangle { horizontal-stretch: 1; background: transparent; }
Rectangle {
width: root.width < 600px ? 112px : 148px;
border-radius: 22px;
background: #102027bb;
border-width: 1px;
border-color: #ffffff25;
HorizontalLayout {
padding-left: 15px;
padding-right: 15px;
spacing: 8px;
alignment: center;
Rectangle {
width: 7px;
height: 7px;
vertical-stretch: 0;
y: (parent.height - self.height) / 2;
border-radius: 4px;
background: root.primary;
}
Text {
text: root.width < 600px ? "LIVE" : "KAMERA LIVE";
color: #ffffffd9;
font-size: 10px;
font-weight: 600;
vertical-alignment: center;
}
} }
} }
} }
// Wrap the text before sizing the panel so its bottom inset stays at 16px.
panel := Rectangle { panel := Rectangle {
x: (root.width - self.width) / 2; x: root.inset + root.safe-area-insets.left;
y: root.height - self.height - root.inset - root.safe-area-insets.bottom; y: root.height - self.height - root.inset - root.safe-area-insets.bottom;
width: min(920px, root.width - root.inset * 2); width: root.width - root.inset * 2 - root.safe-area-insets.left - root.safe-area-insets.right;
height: root.width < 700px ? 300px : 210px; height: root.compact ? first.height + second.height + 44px : max(first.height, second.height) + 32px;
border-radius: 24px; border-radius: 22px;
background: #101e28e8; background: #fffffff5;
border-width: 1px; first := Instruction {
border-color: #ffffff20; x: 16px;
VerticalLayout { y: 16px;
padding: 14px; width: root.compact ? parent.width - 32px : (parent.width - 44px) / 2;
spacing: 8px; number: "1";
VerticalLayout { german: "Hebe deine offene Hand und zeige die Handfläche zur Kamera.";
padding-left: 16px; english: "Raise your open hand with your palm facing the camera.";
padding-right: 16px; accent: root.primary;
padding-top: 8px; active: !root.hand-detected;
height: 64px; }
spacing: 10px; second := Instruction {
Text { x: root.compact ? 16px : first.x + first.width + 12px;
text: root.hand-detected ? "Perfekt, bleib kurz so!" : "Na, bereit für deinen Moment?"; y: root.compact ? first.y + first.height + 12px : 16px;
color: root.hand-detected ? root.primary : white; width: first.width;
font-size: root.width < 700px ? 19px : 23px; number: "2";
font-weight: 600; german: "Halte deine Hand ruhig, bis der Kreis vollständig gefüllt ist.";
wrap: word-wrap; english: "Keep your hand steady until the circle is completely filled.";
} accent: root.secondary;
Text { active: root.hand-detected;
text: root.hand-detected ? "Perfect, hold that pose for a moment!" : "Ready for your moment?";
color: #e5edf0bb;
font-size: 13px;
}
}
if root.width >= 700px: HorizontalLayout {
spacing: 8px;
Instruction {
number: "1";
german: "Hand hoch, los geht’s!";
english: "Raise your open hand to get started.";
accent: root.primary;
active: !root.hand-detected;
}
Instruction {
number: "2";
german: "Kurz stillhalten. Gleich soweit!";
english: "Hold it steady while the circle fills.";
accent: root.secondary;
active: root.hand-detected;
}
}
if root.width < 700px: VerticalLayout {
spacing: 4px;
Instruction {
number: "1";
german: "Hand hoch, los geht’s!";
english: "Raise your open hand to get started.";
accent: root.primary;
active: !root.hand-detected;
}
Instruction {
number: "2";
german: "Kurz stillhalten. Gleich soweit!";
english: "Hold it steady while the circle fills.";
accent: root.secondary;
active: root.hand-detected;
}
}
} }
} }
} }

5
ui/assets/README.md Normal file
View File

@@ -0,0 +1,5 @@
# Branding
`winf-icon.png` is the standard 192px favicon from winf.at, bundled for offline use.
Source: https://winf.at/wp-content/uploads/2023/09/cropped-cropped-FavIcon-192x192.png

BIN
ui/assets/winf-icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB