From 9feec20019b374438728f8a11a59b7e1e3477f47 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Sat, 14 Nov 2026 12:31:25 +0100 Subject: [PATCH] Move reference import hint into example artwork footer --- crates/midra-layout/src/gui.rs | 30 +++++++++++++++++------------- crates/midra-layout/src/main.rs | 25 ++++++++++++++++++------- docs/midralayout/changelog.md | 2 ++ 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/crates/midra-layout/src/gui.rs b/crates/midra-layout/src/gui.rs index a37b84f..2098191 100644 --- a/crates/midra-layout/src/gui.rs +++ b/crates/midra-layout/src/gui.rs @@ -2247,22 +2247,23 @@ impl Editor { self.reference .as_ref() .map(|r| format!("Reference: {} · {} × {} px", r.name, r.size[0], r.size[1])) - .unwrap_or_else(|| { - "Drop a reference image here · Import → Reference image…".into() - }), + .unwrap_or_default(), palette.muted, ) }; - // Size reference status to its actual text, including wrapped warnings. - let status = ui.painter().layout( - text, - FontId::proportional(12.0), - color, - (r.width() - 32.0).max(1.0), - ); - let canvas_top = 64.0 + extra_height + status.size().y + 8.0; - ui.painter() - .galley(ink.point(16.0, 64.0 + extra_height), status, color); + // Only reserve a status row for an imported image, warning or error. + let mut canvas_top = 64.0 + extra_height; + if !text.is_empty() { + let status = ui.painter().layout( + text, + FontId::proportional(12.0), + color, + (r.width() - 32.0).max(1.0), + ); + canvas_top += status.size().y + 8.0; + ui.painter() + .galley(ink.point(16.0, 64.0 + extra_height), status, color); + } let area = Rect::from_min_max( r.min + Vec2::new(8.0, canvas_top), r.max - Vec2::new(8.0, 48.0), @@ -2593,6 +2594,9 @@ impl Editor { if self.reference.is_none() && output != [1920, 1080] { screen_title(&screen, &self.backdrop_title, output); } + if self.reference.is_none() { + screen_reference_hint(&screen, output); + } if self.edit_content && let Some(i) = self.layout.selected() { diff --git a/crates/midra-layout/src/main.rs b/crates/midra-layout/src/main.rs index d3eee5c..fe81a19 100644 --- a/crates/midra-layout/src/main.rs +++ b/crates/midra-layout/src/main.rs @@ -136,13 +136,6 @@ fn screen_artwork(ink: &Ink, title: &str) { ink.line([0.0, y as f32 / 2.0], [960.0, y as f32 / 2.0], palette.grid); } ink.text(24.0, 462.0, "Ideas worth sharing.", 27.0, palette.muted); - ink.text( - 24.0, - 503.0, - "Illustrative reference artwork · opacity 65%", - 12.0, - palette.muted, - ); } fn screen_title(ink: &Ink, title: &str, output: [u32; 2]) { @@ -160,3 +153,21 @@ fn screen_title(ink: &Ink, title: &str, output: [u32; 2]) { banner.rect(0.0, 0.0, width, height, palette.banner); banner.text(24.0, 10.0, title, 13.0, palette.muted); } + +fn screen_reference_hint(ink: &Ink, output: [u32; 2]) { + let size = Vec2::new(output[0] as f32, output[1] as f32) / 2.0; + let rect = Rect::from_min_max(ink.origin, ink.point(size.x, size.y)); + let painter = ink + .painter + .with_clip_rect(ink.painter.clip_rect().intersect(rect)); + let color = theme::palette(ink.painter.ctx()).muted; + let text = painter.layout( + "Illustrative reference artwork · Drag & drop an image or use Import → Reference image…" + .into(), + FontId::proportional(12.0 * ink.scale), + color, + (size.x - 48.0).max(1.0) * ink.scale, + ); + let pos = ink.point(24.0, size.y - 14.0) - Vec2::new(0.0, text.size().y); + painter.galley(pos, text, color); +} diff --git a/docs/midralayout/changelog.md b/docs/midralayout/changelog.md index 14b87ff..e1f74cc 100644 --- a/docs/midralayout/changelog.md +++ b/docs/midralayout/changelog.md @@ -4,6 +4,8 @@ ## Unreleased +- Move the reference drag/drop/import hint into the example artwork footer and reclaim its separate viewport status row. Image details and warnings remain above the view. + - Default backdrop title is “Example Conference Name”; edit/reset it in Options → Example backdrop or Settings → Reference images. Project v7 saves the title and migrates v1–6. - Add persistent Move/Pan/Zoom icons (V/H/Z). Zoom supports click, Alt-click out and horizontal drag; Space/middle-drag pans from any tool. Escape cancels camera drags; grid/pivot choices stay independent.