From 95670b10ecbe5f0aff375f3f88d4156169b99aea Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 12:32:53 -0500 Subject: [PATCH 1/3] Restore home typography and status styling --- crates/ui-egui/src/app.rs | 2 +- crates/ui-egui/src/canvas/page_overlays.rs | 6 +++--- crates/ui-egui/src/home.rs | 11 ++++++----- crates/ui-egui/src/panels/tools.rs | 5 ++++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 401854b885..0ed45b86d7 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -512,7 +512,7 @@ impl PdfCraftApp { let system = craft::ui::runtime::env::system_text_scale(ctx).unwrap_or(1.0); let native = ctx.native_pixels_per_point().unwrap_or(1.0); let mut root = - RootEnv::new().mode(self.theme_preference).direction(direction).scale(Scale::new(crate::ui_scale::zoom(self.ui_scale, system, native))); + RootEnv::new().mode(self.theme_preference).density(craft::theme::Size::Comfortable).direction(direction).scale(Scale::new(crate::ui_scale::zoom(self.ui_scale, system, native))); root.motion = self.animation_effects; // Today is the session's day, the one its date formats and Fill & Sign's Date tool use: the calendars ring it // and pick it. diff --git a/crates/ui-egui/src/canvas/page_overlays.rs b/crates/ui-egui/src/canvas/page_overlays.rs index db01a2f871..df4dc8b6a6 100644 --- a/crates/ui-egui/src/canvas/page_overlays.rs +++ b/crates/ui-egui/src/canvas/page_overlays.rs @@ -524,8 +524,8 @@ impl Component for PageOverlays<'_> { [Tone::Neutral, Tone::Accent, Tone::Info, Tone::Good, Tone::Warn, Tone::Bad].into_iter().map(|tone| (tone, cx.tone(tone))).collect(); PageOverlaysStyle { metrics: Metrics::new(), - field_fill: cx.color(colors.status.info.bg), - field_edge: cx.color(colors.status.info.border), + field_fill: cx.color(colors.status.info.solid), + field_edge: cx.color(colors.status.info.solid), required_edge: cx.color(colors.status.bad.solid), flash: cx.color(colors.accent.solid), tab_fill: cx.color(colors.accent.solid), @@ -595,7 +595,7 @@ impl PageOverlays<'_> { } else { (PaintShape::Rect(rect, CornerRadius::ZERO), PaintShape::Rect(rect, CornerRadius::ZERO)) }; - draw.fill(&shape, style.field_fill); + draw.faded(48.0 / 255.0, |draw| draw.fill(&shape, style.field_fill)); draw.stroke(&outline, width, edge); } } diff --git a/crates/ui-egui/src/home.rs b/crates/ui-egui/src/home.rs index 9b7d3f811d..4d4a06bf6f 100644 --- a/crates/ui-egui/src/home.rs +++ b/crates/ui-egui/src/home.rs @@ -7,6 +7,7 @@ use craft::behavior::IconId; use craft::behavior::{DisplayOrder, ItemSource, SizeHint}; use craft::keymap::CommandRef; use craft::theme::variant::Tone; +use craft::theme::TypeRole; use craft::ui::buttons::{Button, IconButton}; use craft::ui::contract::{ActivateOn, CollectionEvent, Pad, Props as _, Show as _, ShowCollection as _, ShowContainer as _, clicked}; use craft::ui::display::{PictureSize, Text}; @@ -118,7 +119,7 @@ pub fn show(app: &mut PdfCraftApp, ui: &mut egui::Ui) { .offers_new(false) .drop_hint(tl!("Files you open in PdfCraft appear here").to_string()) .section(StartPlace::BeforeRecent, |ui, _| { - let _ = Text::new(tl!("Welcome to PdfCraft").to_string()).show(ui); + let _ = Text::new(tl!("Welcome to PdfCraft").to_string()).role(TypeRole::Display).show(ui); let _ = Text::new(tl!("An open-source PDF workbench — local, private, and scriptable.").to_string()).show(ui); if community_card { Stack::new().label(tl!("Join the ArtCraft community")).fill_width().surface(SurfaceKind::Raised).pad(Pad::Regular).show( @@ -126,7 +127,7 @@ pub fn show(app: &mut PdfCraftApp, ui: &mut egui::Ui) { |ui, _| { Row::new().show(ui, |ui, _| { brand::mark(ui, PictureSize::Thumb(ThumbSize::Medium)); - let _ = Text::new(tl!("Join the ArtCraft community").to_string()).show(ui); + let _ = Text::new(tl!("Join the ArtCraft community").to_string()).role(TypeRole::Heading).show(ui); if clicked(&IconButton::new(IconId::new("x")).id_salt("community-close").label(tl!("Close")).show(ui)) { asked.borrow_mut().push(Asked::CloseCommunityCard); } @@ -143,9 +144,9 @@ pub fn show(app: &mut PdfCraftApp, ui: &mut egui::Ui) { }, ); } - let _ = Text::new(tl!("Recommended tools").to_string()).show(ui); + let _ = Text::new(tl!("Recommended tools").to_string()).role(TypeRole::Heading).show(ui); tool_grid(ui, tl!("Recommended tools"), &recommended, false, &asked); - let _ = Text::new(tl!("Pinned Tools").to_string()).show(ui); + let _ = Text::new(tl!("Pinned Tools").to_string()).role(TypeRole::Heading).show(ui); if Button::new(tl!("Pin a tool…").to_string()).id_salt("pin-a-tool").show(ui).clicks > 0 { asked.borrow_mut().push(Asked::PinTools); } @@ -156,7 +157,7 @@ pub fn show(app: &mut PdfCraftApp, ui: &mut egui::Ui) { } }) .section(StartPlace::AfterSections, |ui, _| { - let _ = Text::new(tl!("Privacy").to_string()).show(ui); + let _ = Text::new(tl!("Privacy").to_string()).role(TypeRole::Heading).show(ui); let _ = Text::new(tl!("PdfCraft works offline. No telemetry, no account, and no cloud processing unless you add a provider.").to_string()) .show(ui); diff --git a/crates/ui-egui/src/panels/tools.rs b/crates/ui-egui/src/panels/tools.rs index 3f9bbbc401..0004273250 100644 --- a/crates/ui-egui/src/panels/tools.rs +++ b/crates/ui-egui/src/panels/tools.rs @@ -2,6 +2,8 @@ use craft::behavior::{DisplayOrder, IconId, ItemSource, Selection}; use craft::ui::buttons::Button; use craft::ui::choice::{Checkbox, Segmented}; use craft::ui::contract::{ActivateOn, Bind, CollectionEvent, Entry, Props as _, SelectMode, Show as _, ShowCollection as _, Sizing}; +use craft::ui::display::Badge; +use craft::theme::{Variant, variant::{Emphasis, Tone}}; use craft::ui::list::{HueTarget, List, ListRow, RowEvent, RowInk, TrailingFace, TrailingPart}; use craft::ui::primitives::IconSpec; use craft::ui::style::DataColor; @@ -140,7 +142,8 @@ fn item_row(g: &'static ToolGroup, item: &'static ToolItem) -> ListRow<'static> Availability::Planned(m) => m, Availability::Provider => "AI", }; - let row = ListRow::new(tl!(item.label).to_owned()).icon(IconSpec::svg(IconId::new(item.icon))).trailing(tl!(chip).to_owned()); + let badge = Badge::new(tl!(chip).to_owned()).variant(Variant::look(Emphasis::Soft, if ready { Tone::Good } else { Tone::Neutral })); + let row = ListRow::new(tl!(item.label).to_owned()).icon(IconSpec::svg(IconId::new(item.icon))).trailing_field(badge, |_| {}); if ready { row.hue(data_hue(g), HueTarget::Icon).tooltip(format!("{} — {}", tl!(item.label), item.command)) } else { From 4e50292fda03e2e5a9b591851c827e004a10e68d Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 12:37:31 -0500 Subject: [PATCH 2/3] Show document notices as status bars --- crates/ui-egui/src/canvas/bars.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/canvas/bars.rs b/crates/ui-egui/src/canvas/bars.rs index 377f0e99b2..5acd8e77cb 100644 --- a/crates/ui-egui/src/canvas/bars.rs +++ b/crates/ui-egui/src/canvas/bars.rs @@ -51,7 +51,7 @@ pub(super) enum Notice { /// One inline notice with the icon named `icon`. fn bar(tone: Tone, icon: &'static str, text: String) -> Bar<'static> { - Bar::new(tone, text).layout(NoticeLayout::Inline).icon(NoticeIcon::Custom(IconId::new(icon).into())) + Bar::new(tone, text).layout(NoticeLayout::Bar).icon(NoticeIcon::Custom(IconId::new(icon).into())) } /// The notices above the pages, one after another: a file changed on disk first, then what a historical From febc3b8fc9f383b017e4d1545e4097b25e7a4d77 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sat, 21 Nov 2026 12:57:16 -0500 Subject: [PATCH 3/3] Match the home display type size --- crates/ui-egui/src/app.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/ui-egui/src/app.rs b/crates/ui-egui/src/app.rs index 0ed45b86d7..74669f615b 100644 --- a/crates/ui-egui/src/app.rs +++ b/crates/ui-egui/src/app.rs @@ -507,12 +507,20 @@ impl PdfCraftApp { /// The app's root values for this frame: appearance mode, motion, interface scale and the /// interface language's direction. The one place the app's `RootEnv` is built. pub(crate) fn root_env(&self, ctx: &egui::Context) -> RootEnv { + static SIZES: std::sync::OnceLock> = std::sync::OnceLock::new(); + let sizes = SIZES.get_or_init(|| { + let mut sizes = craft::theme::AppSizes::default(); + sizes.all.insert("typography.display.size".into(), craft::theme::SizeValue::Number(24.0)); + sizes.all.insert("typography.display.line_height".into(), craft::theme::SizeValue::Number(29.0)); + Arc::new(sizes) + }); let lang = i18n::Lang::from_pref(&self.language); let direction = if lang.rtl() { craft_i18n::Direction::Rtl } else { craft_i18n::Direction::Ltr }; let system = craft::ui::runtime::env::system_text_scale(ctx).unwrap_or(1.0); let native = ctx.native_pixels_per_point().unwrap_or(1.0); let mut root = RootEnv::new().mode(self.theme_preference).density(craft::theme::Size::Comfortable).direction(direction).scale(Scale::new(crate::ui_scale::zoom(self.ui_scale, system, native))); + root.sizes = Arc::clone(sizes); root.motion = self.animation_effects; // Today is the session's day, the one its date formats and Fill & Sign's Date tool use: the calendars ring it // and pick it.