Print/OCR look: page size pill shrink-wrapped, no camera quad or bar on a document that forbids changes

This commit is contained in:
Dylan M. Taylor committed 2026-11-22 05:04:05 -05:00
1 parent 2454dcca3a
commit 24377f04ff
2 files changed
+7 -2

No files matched your search

+2 -1
View File
@@ -1553,7 +1553,8 @@ fn page_body(ui: &mut egui::Ui, body: &PageBody<'_>, callbacks: &mut PageCallbac
// A full-screen key's turn first, then the display time's.
out.turn = out.turn.or(frame.step);
}
if cx.tool == QuickTool::EnhanceCamera {
// A document that forbids changes has nothing to enhance: production shows the page without a quad or the bar.
if cx.tool == QuickTool::EnhanceCamera && cx.can_modify {
let quad = crate::camera_ui::show_quad(ui, body, session, cx.can_modify, cx.current);
let bar = crate::camera_ui::bar(ui, body, session, cx.can_modify);
out.action = bar.or(quad);
+5 -1
View File
@@ -22,7 +22,11 @@ pub(super) fn page_size_hint(ui: &mut egui::Ui, body: &PageBody<'_>, page: &pdfc
}
let text = units.size(f64::from(page.width), f64::from(page.height));
// PLAN: a card notice is the framework's floating label with no interaction; its own surface padding is the inset.
let builder = egui::UiBuilder::new().max_rect(body.rect).layout(egui::Layout::bottom_up(egui::Align::Min)).sense(egui::Sense::hover());
// Shrink-wrapped to its text, a little in from the corner, as production's pill sits.
let font = egui::TextStyle::Body.resolve(ui.style());
let wide = ui.painter().layout_no_wrap(text.to_string(), font, egui::Color32::WHITE).size().x + 40.0;
let corner = egui::Rect::from_min_max(egui::pos2(body.rect.min.x + 10.0, body.rect.min.y), egui::pos2(body.rect.min.x + 10.0 + wide, body.rect.max.y - 10.0));
let builder = egui::UiBuilder::new().max_rect(corner).layout(egui::Layout::bottom_up(egui::Align::Min)).sense(egui::Sense::hover());
ui.scope_builder(builder, |ui| {
Bar::new(Tone::Neutral, text).layout(NoticeLayout::Card).icon(NoticeIcon::None).show(ui);
});