diff --git a/tests/ui_rendering.rs b/tests/ui_rendering.rs index 5c01a91..d423db7 100644 --- a/tests/ui_rendering.rs +++ b/tests/ui_rendering.rs @@ -61,7 +61,7 @@ fn check_transitions(repaint: RepaintBufferType, buffer_count: usize) { let instructions = frames.render(&ui, &window); for _ in 0..2 { ui.set_countdown(3); - ui.set_flash_opacity(0.75); + ui.set_flash_opacity(0.95); for _ in 0..3 { frames.render(&ui, &window); } diff --git a/ui/app-window.slint b/ui/app-window.slint index f6293f3..f1da9eb 100644 --- a/ui/app-window.slint +++ b/ui/app-window.slint @@ -142,6 +142,35 @@ export component AppWindow inherits Window { active: root.hand-detected; } } + if root.flash-opacity > 0: Rectangle { + // Keep the portrait below the central countdown and most of the + // monitor white so it continues to provide light for the photo. + width: min(360px * root.ui-scale, root.width * 0.65, root.height * 0.36); + height: self.width * 200 / 360 + 40px * root.ui-scale; + x: (root.width - self.width) / 2; + y: root.height - self.height - root.inset - root.safe-area-insets.bottom; + background: transparent; + pose-label := Text { + x: 0px; + y: 0px; + width: parent.width; + height: 32px * root.ui-scale; + text: "Pose!"; + color: #20302b77; + font-size: 26px * root.ui-scale; + font-weight: 600; + horizontal-alignment: center; + vertical-alignment: center; + } + Image { + x: 0px; + y: pose-label.y + pose-label.height + 8px * root.ui-scale; + width: parent.width; + height: parent.height - self.y; + source: @image-url("assets/photo-pose.svg"); + image-fit: contain; + } + } if root.countdown > 0: Text { width: root.width; height: root.height; diff --git a/ui/assets/photo-pose.svg b/ui/assets/photo-pose.svg new file mode 100644 index 0000000..f6de444 --- /dev/null +++ b/ui/assets/photo-pose.svg @@ -0,0 +1,27 @@ + + + + + + + + + +