diff --git a/crates/ui-egui/src/canvas/bars.rs b/crates/ui-egui/src/canvas/bars.rs index 377f0e99b2..0b6dd15953 100644 --- a/crates/ui-egui/src/canvas/bars.rs +++ b/crates/ui-egui/src/canvas/bars.rs @@ -49,9 +49,9 @@ pub(super) enum Notice { LockSignatures, } -/// One inline notice with the icon named `icon`. +/// One page notice bar 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 diff --git a/crates/ui-egui/src/chrome.rs b/crates/ui-egui/src/chrome.rs index 79a5b5901e..ff01e2afed 100644 --- a/crates/ui-egui/src/chrome.rs +++ b/crates/ui-egui/src/chrome.rs @@ -18,6 +18,8 @@ pub(crate) mod doc_tabs; mod mode_bar; pub(crate) mod view_rail; +pub(crate) const HOME_ICON: &str = "home"; + /// Compose the window: title bar, mode bar, view rail and the dock, whose document panel holds the /// pages. /// @@ -100,7 +102,7 @@ fn title_bar(app: &mut PdfCraftApp, ui: &mut egui::Ui) { title, |ui, _| { let home = app.active.is_none() && !app.combine_showing(); - if IconButton::new(IconId::new("house")).label(tl!("Home")).selected(home).show(ui).clicked() { + if IconButton::new(IconId::new(HOME_ICON)).label(tl!("Home")).selected(home).show(ui).clicked() { app.active = None; app.combine_tab.focused = false; } diff --git a/crates/ui-egui/src/icons.rs b/crates/ui-egui/src/icons.rs index 50f84f992d..9b9e055285 100644 --- a/crates/ui-egui/src/icons.rs +++ b/crates/ui-egui/src/icons.rs @@ -147,6 +147,7 @@ mod tests { let missing: Vec = engine_icons().into_iter().filter(|(_, name)| !has_icon(&IconId::new(name))).map(|(owner, name)| format!("{owner}: {name}")).collect(); assert!(missing.is_empty(), "icons nobody has: {missing:?}"); + assert!(has_icon(&IconId::new(crate::chrome::HOME_ICON)), "the title bar Home icon resolves"); // The eight documents the comment tools name stay served. for name in ["message-square-plus", "type", "highlighter", "move-right", "message-square-quote", "message-square-text", "replace", "paperclip"]