feat: add fullscreen bilingual photobooth interface

This commit is contained in:
2026-11-08 12:52:08 +01:00
parent ae004379a7
commit 16c4c03318
3 changed files with 198 additions and 11 deletions

View File

@@ -44,6 +44,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let mut detector = palm::Detector::new()?;
let ui = AppWindow::new()?;
ui.window().set_fullscreen(true);
ui.window()
.on_close_requested(|| slint::CloseRequestResponse::KeepWindowShown);
@@ -56,6 +57,7 @@ fn main() -> Result<(), Box<dyn Error>> {
let tracker = Arc::new(Mutex::new(palm::Tracker::default()));
let detection_tracker = Arc::clone(&tracker);
let ui_tracker = Arc::clone(&tracker);
// A rendezvous channel drops samples while inference is busy, avoiding a backlog.
let (detection_tx, detection_rx) = mpsc::sync_channel::<Mat>(0);
let detection_worker = thread::spawn(move || {
@@ -108,6 +110,7 @@ fn main() -> Result<(), Box<dyn Error>> {
if let (Some(app), Some(buffer)) = (ui_handle.upgrade(), buffer) {
app.set_video_frame(slint::Image::from_rgb8(buffer));
app.set_hand_detected(ui_tracker.lock().unwrap().has_palm(Instant::now()));
}
},
);