From 4a0001ea0d9c83c32ea5e37dd648daade07e4fd6 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 22 Nov 2026 20:09:57 -0500 Subject: [PATCH] Look: active form field editor is pale yellow with a blue border; stamp group headings uppercase --- crates/ui-egui/src/panels/edit.rs | 2 +- crates/ui-egui/src/tools/forms_ui.rs | 4 ++++ crates/ui-egui/src/tools/forms_ui/editor.rs | 6 ++++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/panels/edit.rs b/crates/ui-egui/src/panels/edit.rs index f500aa4810..40b56f522a 100644 --- a/crates/ui-egui/src/panels/edit.rs +++ b/crates/ui-egui/src/panels/edit.rs @@ -199,7 +199,7 @@ pub(super) fn stamp_palette(app: &mut PdfCraftApp, ui: &mut egui::Ui) { for (n, (group, title)) in titles.iter().enumerate() { let start = kinds.len(); kinds.extend(StampKind::ALL.into_iter().filter(|k| k.group() == *group).map(|k| (*group, k))); - groups.push(TileGroup::new(1_000_000 + n, start, kinds.len() - start, title.to_string())); + groups.push(TileGroup::new(1_000_000 + n, start, kinds.len() - start, title.to_uppercase())); } let mut selection = match app.quick_tool { crate::QuickTool::Stamp(current) => kinds.iter().position(|(_, kind)| *kind == current).map(Selection::single).unwrap_or_default(), diff --git a/crates/ui-egui/src/tools/forms_ui.rs b/crates/ui-egui/src/tools/forms_ui.rs index 24edc94a79..e9da95dd06 100644 --- a/crates/ui-egui/src/tools/forms_ui.rs +++ b/crates/ui-egui/src/tools/forms_ui.rs @@ -34,6 +34,10 @@ use choice_list::choice_list; /// The page's paper: what an unbaked widget is filled with until its appearance is rendered. const PAPER: Color32 = Color32::WHITE; +/// Background of the in-place text field editor, the same in every theme (as production). +const FIELD_FILL: Color32 = Color32::from_rgb(0xFF, 0xFF, 0xF4); +/// Border of the field being edited. +const FOCUS_BLUE: Color32 = Color32::from_rgb(0x14, 0x73, 0xE6); /// The field being edited. #[derive(Clone, Debug, PartialEq)] diff --git a/crates/ui-egui/src/tools/forms_ui/editor.rs b/crates/ui-egui/src/tools/forms_ui/editor.rs index c03d337cad..9d078100b8 100644 --- a/crates/ui-egui/src/tools/forms_ui/editor.rs +++ b/crates/ui-egui/src/tools/forms_ui/editor.rs @@ -19,7 +19,7 @@ use egui::{Align, Color32, CornerRadius, FontId, Pos2, Rect, pos2, vec2}; use pdfcraft_engine::{Document, FormField, FormFieldKind, FormWidget, field_flags, form_appearance}; use pdfcraft_render::DocInfo; -use super::{Focus, PAPER, TextFrame, commit, editable_combo, field_screen_font, focused_field, list_pick_edit, widget_rect}; +use super::{FIELD_FILL, FOCUS_BLUE, Focus, TextFrame, commit, editable_combo, field_screen_font, focused_field, list_pick_edit, widget_rect}; use crate::canvas::{PageGeometry, PageSession}; /// Where a field's text is laid out: its frame on the page and the screen points per page point. @@ -381,7 +381,9 @@ pub(crate) fn show( let mut host = FieldHost { ctx: ui.ctx().clone(), view: body.view, field: f, widget: w, geo, room, text, caret: selection.caret, laid: None }; // PLAN: paints through an egui `Painter` with black text, as pdf-forms-w7's `paint_page` does; both move to the `Draw` tokens and the field's `/DA` colour together. let painter = ui.painter_at(rect.intersect(body.rect)); - painter.rect_filled(rect, CornerRadius::ZERO, PAPER); + painter.rect_filled(rect, CornerRadius::ZERO, FIELD_FILL); + // The field being typed in carries a blue border, as production draws it. + painter.rect_stroke(rect, CornerRadius::ZERO, egui::Stroke::new(1.5, FOCUS_BLUE), egui::StrokeKind::Inside); host.with(|laid, _| laid.paint(&painter)); let multiline = f.kind == FormFieldKind::Text && f.has(field_flags::MULTILINE); let editor = TextEditor::new(f.name.clone(), &mut host, Bind::bound(selection))