Move reference import hint into example artwork footer

This commit is contained in:
Dandaedre 2026-11-14 12:31:25 +01:00
parent e8dfdb03ef
commit 9feec20019
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
3 changed files with 37 additions and 20 deletions

View File

@ -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()
{

View File

@ -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);
}

View File

@ -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.