mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-26 04:58:07 +00:00
Restore page notice bars and Home icon
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -147,6 +147,7 @@ mod tests {
|
||||
let missing: Vec<String> =
|
||||
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"]
|
||||
|
||||
Reference in New Issue
Block a user