Restore home typography and status styling

This commit is contained in:
Dylan M. Taylor
2026-11-21 12:32:53 -05:00
parent 01131a176a
commit 95670b10ec
4 changed files with 14 additions and 10 deletions
+1 -1
View File
@@ -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.
+3 -3
View File
@@ -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);
}
}
+6 -5
View File
@@ -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);
+4 -1
View File
@@ -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 {