PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust
M14: View menu, tooltips and Keyboard shortcuts show Ctrl, not ⌘, off macOS (#695)
Todd Pedersonebc5ccd4c005
diff --git a/ATTRIBUTION.toml b/ATTRIBUTION.tomlindex fee50d3ca..4feda972f 100644--- a/ATTRIBUTION.toml+++ b/ATTRIBUTION.toml@@ -19,7 +19,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Simplified Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "b130884fb43c0b69122b649e94726213782beff5a88c7efbc9b83f21d41f6800"+sha256 = "b4f5905c404dbc8841391aa9a35dbdf8ad78606df208f64ede3c336654025397"[[asset]]path = "crates/ui-egui/src/i18n/zh-hant.tsv"@@ -30,7 +30,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Traditional Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "d00c946c83bf590dc23971b77f94f51017223cb7587055f83715490a1d152e66"+sha256 = "d989733686d249c6cb8cddc0a4cafbe2896d0801bf59ad76a684d3b30306154b"[[asset]]path = "crates/ui-egui/src/i18n/cs.tsv"@@ -52,7 +52,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Brazilian Portuguese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "6e59e0df51801b317b1e707cb1eab54287ff3c6afdb660eab31683ddfde86342"+sha256 = "f4f6d80aa0d213446f686bc6f930ba4a9e988441a659e0e0c623a81b1823ec19"[[asset]]path = "crates/ui-egui/src/i18n/es.tsv"@@ -63,7 +63,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Spanish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "cd27ba57af6b8016a30b29ff8c3fdb39805192711162517e6e0d608ac18dcec6"+sha256 = "640881c5e7a15603027b26b7f8a23a735d0e9b6cb3697ed5b7d7f2626d3939bd"[[asset]]path = "crates/ui-egui/src/i18n/fr.tsv"@@ -74,7 +74,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "French UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "f24ffb1d5b239575ba605592da4502f24d755fae26126107d791d1e9e5d6eea7"+sha256 = "29357d34f7646a81c78c4c3d199757e306592caf352ea57581b36de0bdf0288f"[[asset]]path = "crates/ui-egui/src/i18n/de.tsv"@@ -85,7 +85,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "German UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "23b96e2bd6d12f0f338638c8a9ca487f89de796f2c153341d28cb04c5b600262"+sha256 = "7c06be24f43ba554a5f57d9702602869c0c65b6f630fd66b1d0c5b9994530baf"[[asset]]path = "crates/ui-egui/src/i18n/te.tsv"@@ -96,7 +96,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Telugu UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "e0062d55c47461bae2e9ce201ce125080736534592e2028eb71831696237979d"+sha256 = "83588462b7dfd3740e764bc734ddf0d09fd1004c1dca1fd3ca9d191bb3611876"[[asset]]path = "crates/ui-egui/src/i18n/it.tsv"@@ -107,7 +107,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Italian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "8292677569d108bf6c0aec18a2843865980481036de12bda599e4b085ab67b66"+sha256 = "e558d1b1374c5725b68792446b08ae31c35c7b6fd68c4a54d257b6ca439f0250"[[asset]]path = "crates/ui-egui/src/i18n/ru.tsv"@@ -118,7 +118,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Russian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "948acd6dcd5e64686ae3d573656bd689e089085da8d0ee19dcaebb5a0678756f"+sha256 = "f3ee03336b29ec87742aca37930f0ff7182e2e1f7a3672da588eea3334fa4dd7"[[asset]]path = "crates/ui-egui/src/i18n/hu.tsv"@@ -129,7 +129,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Hungarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "4f612f1314c29534e389fd576af1c30f3ef85509598e6545dbd187ec0a4e5efe"+sha256 = "4254b9bb4d050910f26df82d66740b46e3d7a8e33205edad053a4bdf5316f6f6"[[asset]]path = "crates/ui-egui/src/i18n/bg.tsv"@@ -140,7 +140,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Bulgarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "3791ef5ee3070a46474495ce1a6ed773518a1e874263413a6885bb2de13aed15"+sha256 = "0fa3e37945099a50d0bf5ad4c3191ab2eb1bc0d5ebe253cc459917395c0a83fa"[[asset]]path = "crates/ui-egui/src/i18n/ja.tsv"@@ -151,7 +151,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Japanese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "07fc4ec18275cb70fc66052005566b8c180fc07d6f73f61b2dc11d1ceefc95d4"+sha256 = "a3b2a9f3068ab60dab4f1e18fe3d2be36275508772f39122cd26a03bd67527d9"[[asset]]path = "crates/ui-egui/src/i18n/uk.tsv"@@ -162,7 +162,7 @@ licence = "MIT OR Apache-2.0"licence_file = "LICENSE-MIT"kind = "translation"usage = "Ukrainian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"-sha256 = "775a93bd50a66af7a94c8fb35c4592934d278a3d0c24f37d93f38056922f5143"+sha256 = "51c933a8018726368dfaa55a82e8bc99a5684f80825bfdb6b581f03c5015908f"[[asset]]path = "assets/icons/accessibility.svg"diff --git a/ROADMAP.md b/ROADMAP.mdindex 07d65b236..713cec162 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -133,6 +133,7 @@ M0 → M1 → M2 → M3 → M4 must happen in order. After M4, M5–M12 can run- **2026-10-10 (M14, side panel width):** The side panel keeps the width it is dragged to. The Bookmarks search row was 2 px wider than the panel, and a resizable egui panel keeps the width its content used, so every repaint (any pointer move) widened it up to 520 px. The Comments reply row did the same in languages with a longer "Post" (Russian, Spanish, …); Post now sits under a full-width reply field. Tests hold both panels' widths steady across 30 repaints. Overall estimate unchanged (about 30–35%).- **2026-10-10 (M8):** Redaction codes. Redaction properties offers "Custom text" or "Redaction code" under "Use overlay text": pick the U.S. FOIA (5 U.S.C. 552(b)) or U.S. Privacy Act (552a) set and tick codes, and new marks carry them as overlay text in the set's order ("(b)(6), (b)(7)(C)"). `redact_mark` takes `code_set` and `codes`, rejecting unknown sets and codes with the allowed list. Tests cover the code sets, the tool end to end (mark, apply, text) and the dialog; the new label is translated in all 13 UI catalogs. `protect.redaction-codes` is partial: Edit Codes, custom sets and their import/export are still missing. Estimates unchanged.+- **2026-10-10 (M14, platform shortcut labels):** View ▸ Zoom and Page navigation, the rail, find-bar, toolbar and bookmark tooltips, and Help ▸ Keyboard shortcuts write shortcuts for the platform (`Ctrl+1`, `Ctrl+Shift++` off macOS) instead of hard-coded ⌘. Labels follow egui's detected OS, so the web build in a Linux or Windows browser shows Ctrl too. Fit visible is listed once in View. Translated tooltips take a `{key}` placeholder. Overall estimate unchanged (about 30–35%).- **2026-10-10 (M6, #95):** Prepare a form edits shared General, Appearance and applicable Options properties in one atomic undo step. Explicit opt-in controls keep mixed values unchanged; partial appearance patches preserve custom font resources, each widget's style, indirect dictionary contents and unknown keys. Ctrl/Command+A selects the current page; rectangle selection and the Fields panel support multi-selection, with panel double-click opening properties. CLI/MCP `form_set_props` accepts a bounded, unique `fields` list. Regression tests cover save/reopen, undo/redo, locked-field rollback, stale dialogs, invalid arguments and selection. Names, positions, choices/defaults and script tabs remain individual GUI edits. Integrated upstream 0.5.0 and completed Portuguese/Italian catalogs without losing translator credit; shared-property labels now cover all 14 bundled translations. Kept the new Italian interface and Fill & Sign date-language registries aligned, including accented date output; the About-dialog regression waits for the larger contributor list to settle before clicking. Milestone and overall effort estimates unchanged (about 30–35%).- **2026-10-09 (M5, line-ending labels):** Comment properties names each line ending in words ("Reverse open arrow", "Butt", …) and those labels are translated. The PDF `/LE` token is unchanged. Overall estimate unchanged (about 30–35%).diff --git a/crates/engine/src/commands.rs b/crates/engine/src/commands.rsindex 35576137e..26e8a0ebf 100644--- a/crates/engine/src/commands.rs+++ b/crates/engine/src/commands.rs@@ -59,14 +59,21 @@ pub struct Shortcut {}impl Shortcut {- const fn cmd(key: &'static str) -> Self {+ /// ⌘ (Ctrl elsewhere) and `key`.+ pub const fn cmd(key: &'static str) -> Self {Self { command: true, shift: false, mac_ctrl: false, key }}- const fn cmd_shift(key: &'static str) -> Self {+ /// ⇧⌘ (Ctrl+Shift elsewhere) and `key`.+ pub const fn cmd_shift(key: &'static str) -> Self {Self { command: true, shift: true, mac_ctrl: false, key }}+ /// The command modifier on its own, for text such as "⌘-scroll" / "Ctrl-scroll".+ pub fn command_name(mac: bool) -> &'static str {+ if mac { "⌘" } else { "Ctrl" }+ }+/// How the shortcut is written in menus: `⇧⌘S` on macOS, `Ctrl+Shift+S` elsewhere.pub fn label(&self, mac: bool) -> String {if mac {@@ -190,7 +197,9 @@ pub const COMMANDS: &[CommandSpec] = &[// Acrobat's view modes, a page display and a zoom at once (the rail's Page display menu).c("view.fit_width_scrolling", "Fit to width scrolling", None, None, Document, "arrow-left-right"),c("view.fit_one_page", "Fit one full page", None, None, Document, "maximize-2"),- c("view.fit_visible", "Fit visible", VIEW, Some(Shortcut::cmd("3")), Document, "scan"),+ // In View ▸ Zoom with the view-local zoom keys, so `menu = None` keeps it out of the generated+ // View menu (where it would show twice). The palette and ⌘3 still run it.+ c("view.fit_visible", "Fit visible", None, Some(Shortcut::cmd("3")), Document, "scan"),c("view.marquee_zoom", "Marquee zoom", VIEW, None, Document, "zoom-in"),c("edit.snapshot", "Take a snapshot", EDIT, None, Document, "camera"),c("view.full_screen", "Full screen mode", VIEW, Some(Shortcut::cmd("L")), Document, "maximize"),@@ -412,6 +421,11 @@ mod tests {assert_eq!(s.label(true), "⇧⌘S");assert_eq!(s.label(false), "Ctrl+Shift+S");assert_eq!(command("view.read_mode").unwrap().shortcut.unwrap().label(true), "⌃⌘H");+ assert_eq!(Shortcut::cmd("+").label(false), "Ctrl++");+ assert_eq!(Shortcut::cmd_shift("−").label(true), "⇧⌘−");+ assert_eq!(Shortcut::cmd_shift("−").label(false), "Ctrl+Shift+−");+ assert_eq!(Shortcut::command_name(true), "⌘");+ assert_eq!(Shortcut::command_name(false), "Ctrl");}#[test]diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rsindex cb221cfdf..d8411cb40 100644--- a/crates/ui-egui/src/canvas.rs+++ b/crates/ui-egui/src/canvas.rs@@ -2821,10 +2821,12 @@ fn find_bar(view: &mut DocView, pages: usize, area: Rect, ui: &mut egui::Ui, t:)};ui.label(egui::RichText::new(status).font(theme::regular(12.0)).color(t.text_muted));- if icons::button(ui, "chevron-up", 26.0, false, tl!("Previous (⇧⌘G)")).clicked() {+ let tip = crate::commands::key_tip(ui.ctx(), tl!("Previous ({key})"), crate::commands::FIND_PREV);+ if icons::button(ui, "chevron-up", 26.0, false, &tip).clicked() {step = Some(false);}- if icons::button(ui, "chevron-down", 26.0, false, tl!("Next (⌘G)")).clicked() {+ let tip = crate::commands::key_tip(ui.ctx(), tl!("Next ({key})"), crate::commands::FIND_NEXT);+ if icons::button(ui, "chevron-down", 26.0, false, &tip).clicked() {step = Some(true);}let opts = icons::button(ui, "settings-2", 26.0, find.case_sensitive || find.whole_words, tl!("Find options"));diff --git a/crates/ui-egui/src/chrome.rs b/crates/ui-egui/src/chrome.rsindex 314176c9e..d81cf8c96 100644--- a/crates/ui-egui/src/chrome.rs+++ b/crates/ui-egui/src/chrome.rs@@ -117,7 +117,8 @@ pub fn tab_strip(app: &mut PdfCraftApp, ui: &mut egui::Ui) {ui.ctx().request_repaint();}ui.add_space(4.0);- if widgets::ghost_button(ui, "plus", tl!("Open")).on_hover_text(tl!("Open a PDF (⌘O)")).clicked() {+ let tip = crate::commands::command_tip(ui.ctx(), tl!("Open a PDF ({key})"), "file.open");+ if widgets::ghost_button(ui, "plus", tl!("Open")).on_hover_text(tip).clicked() {app.open_dialog();}ui.with_layout(Layout::right_to_left(Align::Center), |ui| {@@ -291,13 +292,15 @@ pub fn mode_bar(app: &mut PdfCraftApp, ui: &mut egui::Ui) {ui.spacing_mut().item_spacing.x = 4.0;let has_doc = app.active.is_some();ui.add_enabled_ui(has_doc, |ui| {- if icons::button(ui, "printer", 32.0, false, tl!("Print (⌘P)")).clicked() {+ let tip = crate::commands::command_tip(ui.ctx(), tl!("Print ({key})"), "print.dialog");+ if icons::button(ui, "printer", 32.0, false, &tip).clicked() {app.run_command("print.dialog");}if icons::button(ui, "save", 32.0, false, tl!("Save (M4)")).clicked() {app.run_command("file.save");}- if icons::button(ui, "info", 32.0, false, tl!("Document properties (⌘D)")).clicked() {+ let tip = crate::commands::command_tip(ui.ctx(), tl!("Document properties ({key})"), "file.properties");+ if icons::button(ui, "info", 32.0, false, &tip).clicked() {app.dialog = Some(Dialog::Properties(PropsTab::Description));}});@@ -321,43 +324,46 @@ fn main_menu(app: &mut PdfCraftApp, ui: &mut egui::Ui) {ui.menu_button(tl!("View"), |ui| {if let Some(i) = app.active {let v = &mut app.views[i];+ let ctx = ui.ctx().clone();+ let key = |s| crate::commands::shortcut_label(&ctx, s);+ use crate::commands::{ACTUAL_SIZE, FIT_WIDTH, NEXT_VIEW, PAGE_LEVEL, PREV_VIEW, ROTATE_CCW, ROTATE_CW, ZOOM_IN, ZOOM_OUT};ui.label(egui::RichText::new(tl!("Zoom")).color(t.text_faint).small());- if widgets::menu_item(ui, tl!("Actual size"), "⌘1").clicked() {+ if widgets::menu_item(ui, tl!("Actual size"), &key(ACTUAL_SIZE)).clicked() {v.set_zoom(1.0);}- if widgets::menu_item(ui, tl!("Zoom to page level"), "⌘0").clicked() {+ if widgets::menu_item(ui, tl!("Zoom to page level"), &key(PAGE_LEVEL)).clicked() {v.fit = Fit::Page;}- if widgets::menu_item(ui, tl!("Fit to width"), "⌘2").clicked() {+ if widgets::menu_item(ui, tl!("Fit to width"), &key(FIT_WIDTH)).clicked() {v.fit = Fit::Width;}if widgets::menu_item(ui, tl!("Fit to height"), "").clicked() {v.fit = Fit::Height;v.goto = Some((v.current, 0.0));}- if widgets::menu_item(ui, tl!("Fit visible"), "⌘3").clicked() {+ if widgets::menu_item(ui, tl!("Fit visible"), &crate::commands::command_shortcut_label(&ctx, "view.fit_visible")).clicked() {ui.close();app.execute("view.fit_visible");return;}- if widgets::menu_item(ui, tl!("Zoom in"), "⌘+").clicked() {+ if widgets::menu_item(ui, tl!("Zoom in"), &key(ZOOM_IN)).clicked() {v.zoom_step(true);}- if widgets::menu_item(ui, tl!("Zoom out"), "⌘−").clicked() {+ if widgets::menu_item(ui, tl!("Zoom out"), &key(ZOOM_OUT)).clicked() {v.zoom_step(false);}- if widgets::menu_item(ui, tl!("Rotate view clockwise"), "⇧⌘+").clicked() {+ if widgets::menu_item(ui, tl!("Rotate view clockwise"), &key(ROTATE_CW)).clicked() {v.rotate_view(true);}- if widgets::menu_item(ui, tl!("Rotate view counterclockwise"), "⇧⌘−").clicked() {+ if widgets::menu_item(ui, tl!("Rotate view counterclockwise"), &key(ROTATE_CCW)).clicked() {v.rotate_view(false);}ui.separator();ui.label(egui::RichText::new(tl!("Page navigation")).color(t.text_faint).small());- if ui.add_enabled(!v.back.is_empty(), egui::Button::new(tl!("Previous view")).shortcut_text("⌘[")).clicked() {+ if ui.add_enabled(!v.back.is_empty(), egui::Button::new(tl!("Previous view")).shortcut_text(key(PREV_VIEW))).clicked() {v.view_history(false);}- if ui.add_enabled(!v.forward.is_empty(), egui::Button::new(tl!("Next view")).shortcut_text("⌘]")).clicked() {+ if ui.add_enabled(!v.forward.is_empty(), egui::Button::new(tl!("Next view")).shortcut_text(key(NEXT_VIEW))).clicked() {v.view_history(true);}ui.separator();@@ -439,10 +445,12 @@ pub fn right_rail(app: &mut PdfCraftApp, ui: &mut egui::Ui) {let mut page_display = None;ui.with_layout(Layout::bottom_up(Align::Center), |ui| {ui.spacing_mut().item_spacing.y = 2.0;- if icons::button(ui, "zoom-out", 32.0, false, tl!("Zoom out (⌘−)")).clicked() {+ let tip = crate::commands::key_tip(ui.ctx(), tl!("Zoom out ({key})"), crate::commands::ZOOM_OUT);+ if icons::button(ui, "zoom-out", 32.0, false, &tip).clicked() {view.zoom_step(false);}- if icons::button(ui, "zoom-in", 32.0, false, tl!("Zoom in (⌘+)")).clicked() {+ let tip = crate::commands::key_tip(ui.ctx(), tl!("Zoom in ({key})"), crate::commands::ZOOM_IN);+ if icons::button(ui, "zoom-in", 32.0, false, &tip).clicked() {view.zoom_step(true);}// Between rotate and zoom, as in Acrobat. Its command runs once `view` is free.@@ -454,7 +462,8 @@ pub fn right_rail(app: &mut PdfCraftApp, ui: &mut egui::Ui) {rail_view_menu(ui, view)}).and_then(|r| r.inner);- if icons::button(ui, "rotate-cw", 32.0, false, tl!("Rotate view clockwise (⇧⌘+)")).clicked() {+ let tip = crate::commands::key_tip(ui.ctx(), tl!("Rotate view clockwise ({key})"), crate::commands::ROTATE_CW);+ if icons::button(ui, "rotate-cw", 32.0, false, &tip).clicked() {view.rotate_view(true);}// Not `columns-2` while fitting the page: that is the two-page view's icon.diff --git a/crates/ui-egui/src/commands.rs b/crates/ui-egui/src/commands.rsindex 1b3637a2a..ad32892ae 100644--- a/crates/ui-egui/src/commands.rs+++ b/crates/ui-egui/src/commands.rs@@ -5,7 +5,7 @@//! the control channel later) all call `PdfCraftApp::execute`.use pdfcraft_engine::Edit;-use pdfcraft_engine::commands::{self, COMMANDS, CommandSpec};+use pdfcraft_engine::commands::{self, COMMANDS, CommandSpec, Shortcut};use crate::{Dialog, Mode, PdfCraftApp, PropsTab, RightPanel, SaveTarget,@@ -13,6 +13,51 @@ use crate::{widgets,};+/// Keys the document view handles itself (`canvas::shortcuts`), for the View menu, tooltips and+/// Help ▸ Keyboard shortcuts. Keep them in step with the bindings there.+pub(crate) const ACTUAL_SIZE: Shortcut = Shortcut::cmd("1");+pub(crate) const PAGE_LEVEL: Shortcut = Shortcut::cmd("0");+pub(crate) const FIT_WIDTH: Shortcut = Shortcut::cmd("2");+pub(crate) const ZOOM_IN: Shortcut = Shortcut::cmd("+");+pub(crate) const ZOOM_OUT: Shortcut = Shortcut::cmd("−");+pub(crate) const ROTATE_CW: Shortcut = Shortcut::cmd_shift("+");+pub(crate) const ROTATE_CCW: Shortcut = Shortcut::cmd_shift("−");+pub(crate) const PREV_VIEW: Shortcut = Shortcut::cmd("[");+pub(crate) const NEXT_VIEW: Shortcut = Shortcut::cmd("]");+pub(crate) const FIND_NEXT: Shortcut = Shortcut::cmd("G");+pub(crate) const FIND_PREV: Shortcut = Shortcut::cmd_shift("G");+pub(crate) const COPY: Shortcut = Shortcut::cmd("C");+pub(crate) const SELECT_ALL: Shortcut = Shortcut::cmd("A");+pub(crate) const PAGE_PREV: Shortcut = Shortcut::cmd("←");+pub(crate) const PAGE_NEXT: Shortcut = Shortcut::cmd("→");++/// Whether shortcuts are written the macOS way (`⇧⌘S`) rather than `Ctrl+Shift+S`. egui knows the+/// platform from the build target, and on the web from the browser's user agent.+pub(crate) fn mac_shortcuts(ctx: &egui::Context) -> bool {+ ctx.os() == egui::os::OperatingSystem::Mac+}++/// How `s` is written on this platform.+pub(crate) fn shortcut_label(ctx: &egui::Context, s: Shortcut) -> String {+ s.label(mac_shortcuts(ctx))+}++/// How a registered command's shortcut is written on this platform ("" without one).+pub(crate) fn command_shortcut_label(ctx: &egui::Context, id: &str) -> String {+ commands::command(id).and_then(|c| c.shortcut).map(|s| shortcut_label(ctx, s)).unwrap_or_default()+}++/// A translated tooltip with a `{key}` placeholder, filled with `s` as written on this platform:+/// "Zoom in ({key})" → "Zoom in (Ctrl++)".+pub(crate) fn key_tip(ctx: &egui::Context, template: &str, s: Shortcut) -> String {+ crate::i18n::fmt(template, &[("key", &shortcut_label(ctx, s))])+}++/// [`key_tip`] with a registered command's shortcut, so the tooltip names the real binding.+pub(crate) fn command_tip(ctx: &egui::Context, template: &str, id: &str) -> String {+ crate::i18n::fmt(template, &[("key", &command_shortcut_label(ctx, id))])+}+impl PdfCraftApp {/// Whether a registered command can run now. The engine judges the document (security,/// contents, undo history); view state it can't see is checked here.@@ -570,7 +615,7 @@ impl PdfCraftApp {/// Render a top-level menu's registered commands (with live labels, shortcuts and enablement).pub(crate) fn registry_menu(app: &mut PdfCraftApp, ui: &mut egui::Ui, menu: &str) {- let mac = cfg!(target_os = "macos") || cfg!(target_arch = "wasm32");+ let mac = mac_shortcuts(ui.ctx());for spec in commands::menu(menu) {let label = commands::current_label(spec, &app.session, app.active_ids().map(|(_, id)| id));let label = crate::i18n::menu_label(spec.id, &label);diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rsindex edec6d02f..d0a389ef8 100644--- a/crates/ui-egui/src/dialogs.rs+++ b/crates/ui-egui/src/dialogs.rs@@ -1024,32 +1024,43 @@ pub fn show(app: &mut PdfCraftApp, ctx: &egui::Context) {Dialog::Shortcuts => {ui.label(egui::RichText::new(tl!("Keyboard shortcuts")).font(theme::semibold(18.0)));ui.add_space(8.0);- let mac = cfg!(target_os = "macos") || cfg!(target_arch = "wasm32");+ use crate::commands::{+ ACTUAL_SIZE, COPY, FIND_NEXT, FIND_PREV, FIT_WIDTH, PAGE_LEVEL, PAGE_NEXT, PAGE_PREV, ROTATE_CCW, ROTATE_CW, SELECT_ALL, ZOOM_IN,+ ZOOM_OUT,+ };+ let mac = crate::commands::mac_shortcuts(ui.ctx());// Registered commands first (always in sync with the real bindings), then the// keys the document view handles itself.let mut rows: Vec<(String, String)> = pdfcraft_engine::commands::COMMANDS.iter().filter_map(|c| c.shortcut.map(|k| (k.label(mac), tl!(c.label).trim_end_matches('…').to_string()))).collect();+ let key = |s: pdfcraft_engine::commands::Shortcut| s.label(mac);+ let pair = |a, b| format!("{} / {}", key(a), key(b));+ // Key names, translated where a catalog has them (not scanned as UI literals).+ let named = |k: &str| tl!(k).to_string();+ let scroll = crate::i18n::fmt(+ tl!("Zoom in / out (also pinch or {key}-scroll)"),+ &[("key", pdfcraft_engine::commands::Shortcut::command_name(mac))],+ );for (k, v) in [- ("⌘G / ⇧⌘G", tl!("Next / previous match")),- ("⌘C", tl!("Copy selected text")),- ("Double-click", tl!("Select a word")),- ("Esc", tl!("Clear selection / close find")),- ("⌘1", tl!("Actual size")),- ("⌘0", tl!("Zoom to page level")),- ("⌘2", tl!("Fit to width")),- ("⌘3", tl!("Fit visible")),- ("⌘+ / ⌘−", tl!("Zoom in / out (also pinch or ⌘-scroll)")),- ("⇧⌘+ / ⇧⌘−", tl!("Rotate view")),- ("Home / End", tl!("First / last page")),- ("← / →, ⌘← / ⌘→", tl!("Previous / next page")),- ("V", tl!("Select (V)")),- ("H / Space (hold)", tl!("Hand (H)")),- ("Delete", tl!("Delete selected pages (Organize)")),- ("⌘A", tl!("Select all pages (Organize)")),+ (pair(FIND_NEXT, FIND_PREV), tl!("Next / previous match").to_string()),+ (key(COPY), tl!("Copy selected text").to_string()),+ (named("Double-click"), tl!("Select a word").to_string()),+ (named("Esc"), tl!("Clear selection / close find").to_string()),+ (key(ACTUAL_SIZE), tl!("Actual size").to_string()),+ (key(PAGE_LEVEL), tl!("Zoom to page level").to_string()),+ (key(FIT_WIDTH), tl!("Fit to width").to_string()),+ (pair(ZOOM_IN, ZOOM_OUT), scroll),+ (pair(ROTATE_CW, ROTATE_CCW), tl!("Rotate view").to_string()),+ (named("Home / End"), tl!("First / last page").to_string()),+ (format!("← / →, {}", pair(PAGE_PREV, PAGE_NEXT)), tl!("Previous / next page").to_string()),+ (named("V"), tl!("Select (V)").to_string()),+ (named("H / Space (hold)"), tl!("Hand (H)").to_string()),+ (named("Delete"), tl!("Delete selected pages (Organize)").to_string()),+ (key(SELECT_ALL), tl!("Select all pages (Organize)").to_string()),] {- rows.push((tl!(k).to_string(), tl!(v).to_string()));+ rows.push((k, v));}egui::ScrollArea::vertical().max_height(460.0).show(ui, |ui| {egui::Grid::new("keys").num_columns(2).spacing([24.0, 6.0]).show(ui, |ui| {diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsvindex 2b0d52fa6..3fe20c056 100644--- a/crates/ui-egui/src/i18n/bg.tsv+++ b/crates/ui-egui/src/i18n/bg.tsv@@ -1069,19 +1069,19 @@Attachments Прикачени файловеSignatures ПодписиAccessibility Checker Проверка на достъпността- Zoom out (⌘−) Намали мащаба (⌘−)- Zoom in (⌘+) Увеличи мащаба (⌘+)- Rotate view clockwise (⇧⌘+) Завърти изгледа по часовниковата стрелка (⇧⌘+)+ Zoom out ({key}) Намали мащаба ({key})+ Zoom in ({key}) Увеличи мащаба ({key})+ Rotate view clockwise ({key}) Завърти изгледа по часовниковата стрелка ({key})Toggle fit page / fit width Превключи между „побери страницата“ и „побери по ширина“Next page Следваща страницаPrevious page Предишна страницаCurrent page — type a page number or label (such as iv) and press Enter Текуща страница — въведете номер или етикет на страница (например iv) и натиснете Enter- Open a PDF (⌘O) Отвори PDF файл (⌘O)+ Open a PDF ({key}) Отвори PDF файл ({key})Dark gray theme Тъмносива темаLight theme Светла тема- Print (⌘P) Печат (⌘P)+ Print ({key}) Печат ({key})Save (M4) Запиши (M4)- Document properties (⌘D) Свойства на документа (⌘D)+ Document properties ({key}) Свойства на документа ({key})Action Wizard… Съветник за действия…Add Bates numbering… Добави номериране на Бейтс…Add a button Добави бутон@@ -1211,7 +1211,7 @@Expand all bookmarks Разгъни всички отметкиExpand top-level bookmarks Разгъни отметките от първо нивоCollapse all bookmarks Свий всички отметки- New bookmark (⌘B) Нова отметка (⌘B)+ New bookmark ({key}) Нова отметка ({key})This document has no bookmarks. Този документ няма отметки.This document has no layers. Този документ няма слоеве.This document has no attachments. Този документ няма прикачени файлове.@@ -1226,8 +1226,8 @@No matches Няма съвпаденияSearching… {s}/{p} Търсене… {s}/{p}{c} of {n}{more} {c} от {n}{more}- Previous (⇧⌘G) Предишно (⇧⌘G)- Next (⌘G) Следващо (⌘G)+ Previous ({key}) Предишно ({key})+ Next ({key}) Следващо ({key})Find options Опции за търсенеWhole words only Само цели думиCase-sensitive Чувствително към регистъра@@ -1298,7 +1298,7 @@Copy selected text Копирай избрания текстSelect a word Избери думаClear selection / close find Изчисти избора / затвори търсенето- Zoom in / out (also pinch or ⌘-scroll) Увеличи / намали (също с щипване или ⌘ + превъртане)+ Zoom in / out (also pinch or {key}-scroll) Увеличи / намали (също с щипване или {key} + превъртане)Rotate view Завърти изгледаFirst / last page Първа / последна страницаPrevious / next page Предишна / следваща страницаdiff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsvindex 63c13eecb..722aa6cc3 100644--- a/crates/ui-egui/src/i18n/de.tsv+++ b/crates/ui-egui/src/i18n/de.tsv@@ -68,7 +68,7 @@Double-click DoppelklickSelect a word Wort auswählenClear selection / close find Auswahl aufheben / Suche schließen- Zoom in / out (also pinch or ⌘-scroll) Vergrößern / Verkleinern (auch per Pinch-Geste oder ⌘ + Scrollen)+ Zoom in / out (also pinch or {key}-scroll) Vergrößern / Verkleinern (auch per Pinch-Geste oder {key} + Scrollen)Rotate view Ansicht drehenFirst / last page Erste / letzte SeitePrevious / next page Vorherige / nächste Seite@@ -76,16 +76,16 @@Select all pages (Organize) Alle Seiten auswählen (Organisieren)Home StartOpen Öffnen- Open a PDF (⌘O) PDF öffnen (⌘O)+ Open a PDF ({key}) PDF öffnen ({key})Dark gray theme Dunkelgraues DesignLight theme Helles DesignAll tools Alle WerkzeugeRead LesenConvert KonvertierenE-Sign E-Signatur- Print (⌘P) Drucken (⌘P)+ Print ({key}) Drucken ({key})Save (M4) Speichern (M4)- Document properties (⌘D) Dokumenteigenschaften (⌘D)+ Document properties ({key}) Dokumenteigenschaften ({key})Find tools and commands Tools und Befehle suchenFit to height SeitenhöheZoom in Vergrößern@@ -114,9 +114,9 @@Compare VergleichenPage thumbnails SeitenminiaturenForm fields Formularfelder- Zoom out (⌘−) Verkleinern (⌘−)- Zoom in (⌘+) Vergrößern (⌘+)- Rotate view clockwise (⇧⌘+) Ansicht im Uhrzeigersinn drehen (⇧⌘+)+ Zoom out ({key}) Verkleinern ({key})+ Zoom in ({key}) Vergrößern ({key})+ Rotate view clockwise ({key}) Ansicht im Uhrzeigersinn drehen ({key})Toggle fit page / fit width Ganze Seite / Seitenbreite umschaltenNext page Nächste SeitePrevious page Vorherige Seite@@ -1249,7 +1249,7 @@Expand all bookmarks Alle Lesezeichen erweiternExpand top-level bookmarks Lesezeichen der obersten Ebene erweiternCollapse all bookmarks Alle Lesezeichen reduzieren- New bookmark (⌘B) Neues Lesezeichen (⌘B)+ New bookmark ({key}) Neues Lesezeichen ({key})This document has no bookmarks. Dieses Dokument hat keine Lesezeichen.This document has no layers. Dieses Dokument hat keine Ebenen.This document has no attachments. Dieses Dokument hat keine Anhänge.@@ -1263,8 +1263,8 @@No matches Keine TrefferSearching… {s}/{p} Suche läuft… {s}/{p}{c} of {n}{more} {c} von {n}{more}- Previous (⇧⌘G) Vorheriger (⇧⌘G)- Next (⌘G) Nächster (⌘G)+ Previous ({key}) Vorheriger ({key})+ Next ({key}) Nächster ({key})Find options SuchoptionenWhole words only Nur ganze WörterCase-sensitive Groß-/Kleinschreibung beachtendiff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsvindex c180d3723..aa70d45da 100644--- a/crates/ui-egui/src/i18n/es.tsv+++ b/crates/ui-egui/src/i18n/es.tsv@@ -89,7 +89,7 @@Double-click Doble clicSelect a word Seleccionar una palabraClear selection / close find Borrar la selección / cerrar la búsqueda- Zoom in / out (also pinch or ⌘-scroll) Acercar / alejar (también con pellizco o ⌘ + desplazamiento)+ Zoom in / out (also pinch or {key}-scroll) Acercar / alejar (también con pellizco o {key} + desplazamiento)Rotate view Girar la vistaFirst / last page Primera / última páginaPrevious / next page Página anterior / siguiente@@ -97,16 +97,16 @@Select all pages (Organize) Seleccionar todas las páginas (Organizar)Home InicioOpen Abrir- Open a PDF (⌘O) Abrir un PDF (⌘O)+ Open a PDF ({key}) Abrir un PDF ({key})Dark gray theme Tema gris oscuroLight theme Tema claroAll tools Todas las herramientasRead LeerConvert ConvertirE-Sign Firma electrónica- Print (⌘P) Imprimir (⌘P)+ Print ({key}) Imprimir ({key})Save (M4) Guardar (M4)- Document properties (⌘D) Propiedades del documento (⌘D)+ Document properties ({key}) Propiedades del documento ({key})Find tools and commands Buscar herramientas y comandosFit to height Ajustar al altoZoom in Acercar@@ -135,9 +135,9 @@Compare CompararPage thumbnails Miniaturas de páginaForm fields Campos de formulario- Zoom out (⌘−) Alejar (⌘−)- Zoom in (⌘+) Acercar (⌘+)- Rotate view clockwise (⇧⌘+) Girar la vista a la derecha (⇧⌘+)+ Zoom out ({key}) Alejar ({key})+ Zoom in ({key}) Acercar ({key})+ Rotate view clockwise ({key}) Girar la vista a la derecha ({key})Toggle fit page / fit width Alternar entre ajustar a la página y al anchoNext page Página siguientePrevious page Página anterior@@ -1262,7 +1262,7 @@Expand all bookmarks Expandir todos los marcadoresExpand top-level bookmarks Expandir los marcadores de primer nivelCollapse all bookmarks Contraer todos los marcadores- New bookmark (⌘B) Nuevo marcador (⌘B)+ New bookmark ({key}) Nuevo marcador ({key})This document has no bookmarks. Este documento no tiene marcadores.This document has no layers. Este documento no tiene capas.This document has no attachments. Este documento no tiene archivos adjuntos.@@ -1277,8 +1277,8 @@No matches Sin coincidenciasSearching… {s}/{p} Buscando… {s}/{p}{c} of {n}{more} {c} de {n}{more}- Previous (⇧⌘G) Anterior (⇧⌘G)- Next (⌘G) Siguiente (⌘G)+ Previous ({key}) Anterior ({key})+ Next ({key}) Siguiente ({key})Find options Opciones de búsquedaWhole words only Solo palabras completasCase-sensitive Distinguir mayúsculas y minúsculasdiff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsvindex e5fd3114b..5a7e0be78 100644--- a/crates/ui-egui/src/i18n/fr.tsv+++ b/crates/ui-egui/src/i18n/fr.tsv@@ -68,7 +68,7 @@Double-click Double-clicSelect a word Sélectionner un motClear selection / close find Effacer la sélection / fermer la recherche- Zoom in / out (also pinch or ⌘-scroll) Zoom avant / arrière (aussi pincer ou ⌘-défilement)+ Zoom in / out (also pinch or {key}-scroll) Zoom avant / arrière (aussi pincer ou {key}-défilement)Rotate view Pivoter l'affichageFirst / last page Première / dernière pagePrevious / next page Page précédente / suivante@@ -76,16 +76,16 @@Select all pages (Organize) Sélectionner toutes les pages (Organiser)Home AccueilOpen Ouvrir- Open a PDF (⌘O) Ouvrir un PDF (⌘O)+ Open a PDF ({key}) Ouvrir un PDF ({key})Dark gray theme Thème gris foncéLight theme Thème clairAll tools Tous les outilsRead LireConvert ConvertirE-Sign Signature électronique- Print (⌘P) Imprimer (⌘P)+ Print ({key}) Imprimer ({key})Save (M4) Enregistrer (M4)- Document properties (⌘D) Propriétés du document (⌘D)+ Document properties ({key}) Propriétés du document ({key})Find tools and commands Rechercher des outils et des commandesFit to height Ajuster à la hauteurZoom in Zoom avant@@ -114,9 +114,9 @@Compare ComparerPage thumbnails Vignettes de pageForm fields Champs de formulaire- Zoom out (⌘−) Zoom arrière (⌘−)- Zoom in (⌘+) Zoom avant (⌘+)- Rotate view clockwise (⇧⌘+) Pivoter l'affichage vers la droite (⇧⌘+)+ Zoom out ({key}) Zoom arrière ({key})+ Zoom in ({key}) Zoom avant ({key})+ Rotate view clockwise ({key}) Pivoter l'affichage vers la droite ({key})Toggle fit page / fit width Basculer entre ajuster à la page et à la largeurNext page Page suivantePrevious page Page précédente@@ -1248,7 +1248,7 @@Expand all bookmarks Développer tous les signetsExpand top-level bookmarks Développer les signets de premier niveauCollapse all bookmarks Réduire tous les signets- New bookmark (⌘B) Nouveau signet (⌘B)+ New bookmark ({key}) Nouveau signet ({key})This document has no bookmarks. Ce document ne contient aucun signet.This document has no layers. Ce document ne contient aucun calque.This document has no attachments. Ce document ne contient aucune pièce jointe.@@ -1262,8 +1262,8 @@No matches Aucune correspondanceSearching… {s}/{p} Recherche… {s}/{p}{c} of {n}{more} {c} sur {n}{more}- Previous (⇧⌘G) Précédent (⇧⌘G)- Next (⌘G) Suivant (⌘G)+ Previous ({key}) Précédent ({key})+ Next ({key}) Suivant ({key})Find options Options de rechercheWhole words only Mots entiers seulementCase-sensitive Respecter la cassediff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsvindex 9bd0f8e1f..afe070c7b 100644--- a/crates/ui-egui/src/i18n/hu.tsv+++ b/crates/ui-egui/src/i18n/hu.tsv@@ -66,7 +66,7 @@Double-click Dupla kattintásSelect a word Szó kijelöléseClear selection / close find Kijelölés törlése / keresés bezárása- Zoom in / out (also pinch or ⌘-scroll) Nagyítás / kicsinyítés (csípéssel vagy ⌘-görgetéssel is)+ Zoom in / out (also pinch or {key}-scroll) Nagyítás / kicsinyítés (csípéssel vagy {key}-görgetéssel is)Rotate view Nézet forgatásaFirst / last page Első / utolsó oldalPrevious / next page Előző / következő oldal@@ -74,16 +74,16 @@Select all pages (Organize) Összes oldal kijelölése (Rendezés)Home KezdőlapOpen Megnyitás- Open a PDF (⌘O) PDF megnyitása (⌘O)+ Open a PDF ({key}) PDF megnyitása ({key})Dark gray theme Sötétszürke témaLight theme Világos témaAll tools Minden eszközRead OlvasásConvert KonvertálásE-Sign E-aláírás- Print (⌘P) Nyomtatás (⌘P)+ Print ({key}) Nyomtatás ({key})Save (M4) Mentés (M4)- Document properties (⌘D) Dokumentum tulajdonságai (⌘D)+ Document properties ({key}) Dokumentum tulajdonságai ({key})Find tools and commands Eszközök és parancsok kereséseFit to height Magassághoz igazításZoom in Nagyítás@@ -112,9 +112,9 @@Compare ÖsszehasonlításPage thumbnails OldalbélyegképekForm fields Űrlapmezők- Zoom out (⌘−) Kicsinyítés (⌘−)- Zoom in (⌘+) Nagyítás (⌘+)- Rotate view clockwise (⇧⌘+) Nézet forgatása az óramutató járásával megegyezően (⇧⌘+)+ Zoom out ({key}) Kicsinyítés ({key})+ Zoom in ({key}) Nagyítás ({key})+ Rotate view clockwise ({key}) Nézet forgatása az óramutató járásával megegyezően ({key})Toggle fit page / fit width Teljes oldal / szélesség váltásaNext page Következő oldalPrevious page Előző oldal@@ -1238,7 +1238,7 @@Expand all bookmarks Összes könyvjelző kibontásaExpand top-level bookmarks A legfelső szintű könyvjelzők kibontásaCollapse all bookmarks Összes könyvjelző összecsukása- New bookmark (⌘B) Új könyvjelző (⌘B)+ New bookmark ({key}) Új könyvjelző ({key})This document has no bookmarks. Ebben a dokumentumban nincs könyvjelző.This document has no layers. Ebben a dokumentumban nincs réteg.This document has no attachments. Ebben a dokumentumban nincs melléklet.@@ -1252,8 +1252,8 @@No matches Nincs találatSearching… {s}/{p} Keresés… {s}/{p}{c} of {n}{more} {c} / {n}{more}- Previous (⇧⌘G) Előző (⇧⌘G)- Next (⌘G) Következő (⌘G)+ Previous ({key}) Előző ({key})+ Next ({key}) Következő ({key})Find options Keresés beállításaiWhole words only Csak egész szavakCase-sensitive Kis- és nagybetűdiff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsvindex c774fdb00..93c3a5712 100644--- a/crates/ui-egui/src/i18n/it.tsv+++ b/crates/ui-egui/src/i18n/it.tsv@@ -92,7 +92,7 @@Double-click Doppio clicSelect a word Seleziona una parolaClear selection / close find Deseleziona / chiudi ricerca- Zoom in / out (also pinch or ⌘-scroll) Aumenta/riduci ingrandimento (anche con pizzico o ⌘ + rotellina)+ Zoom in / out (also pinch or {key}-scroll) Aumenta/riduci ingrandimento (anche con pizzico o {key} + rotellina)Rotate view Ruota vistaFirst / last page Prima/ultima paginaPrevious / next page Pagina precedente/successiva@@ -100,16 +100,16 @@Select all pages (Organize) Seleziona tutte le pagine (Organizza)Home HomeOpen Apri- Open a PDF (⌘O) Apri un PDF (⌘O)+ Open a PDF ({key}) Apri un PDF ({key})Dark gray theme Tema grigio scuroLight theme Tema chiaroAll tools Tutti gli strumentiRead LetturaConvert ConvertiE-Sign Firma elettronica- Print (⌘P) Stampa (⌘P)+ Print ({key}) Stampa ({key})Save (M4) Salva (M4)- Document properties (⌘D) Proprietà documento (⌘D)+ Document properties ({key}) Proprietà documento ({key})Find tools and commands Trova strumenti e comandiFit to height Adatta all'altezzaZoom in Aumenta ingrandimento@@ -138,9 +138,9 @@Compare ConfrontaPage thumbnails Miniature pagineForm fields Campi modulo- Zoom out (⌘−) Riduci ingrandimento (⌘−)- Zoom in (⌘+) Aumenta ingrandimento (⌘+)- Rotate view clockwise (⇧⌘+) Ruota vista in senso orario (⇧⌘+)+ Zoom out ({key}) Riduci ingrandimento ({key})+ Zoom in ({key}) Aumenta ingrandimento ({key})+ Rotate view clockwise ({key}) Ruota vista in senso orario ({key})Toggle fit page / fit width Alterna adatta alla pagina / adatta alla larghezzaNext page Pagina successivaPrevious page Pagina precedente@@ -1263,7 +1263,7 @@Expand all bookmarks Espandi tutti i segnalibriExpand top-level bookmarks Espandi segnalibri di primo livelloCollapse all bookmarks Comprimi tutti i segnalibri- New bookmark (⌘B) Nuovo segnalibro (⌘B)+ New bookmark ({key}) Nuovo segnalibro ({key})This document has no bookmarks. Questo documento non ha segnalibri.This document has no layers. Questo documento non ha livelli.This document has no attachments. Questo documento non ha allegati.@@ -1278,8 +1278,8 @@No matches Nessuna corrispondenzaSearching… {s}/{p} Ricerca in corso… {s}/{p}{c} of {n}{more} {c} di {n}{more}- Previous (⇧⌘G) Precedente (⇧⌘G)- Next (⌘G) Successivo (⌘G)+ Previous ({key}) Precedente ({key})+ Next ({key}) Successivo ({key})Find options Opzioni di ricercaWhole words only Solo parole intereCase-sensitive Maiuscole/minuscolediff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsvindex 7418f318c..2bc609e16 100644--- a/crates/ui-egui/src/i18n/ja.tsv+++ b/crates/ui-egui/src/i18n/ja.tsv@@ -95,7 +95,7 @@Double-click ダブルクリックSelect a word 単語を選択Clear selection / close find 選択を解除/検索を閉じる- Zoom in / out (also pinch or ⌘-scroll) 拡大/縮小(ピンチ操作や ⌘+スクロールも使用可能)+ Zoom in / out (also pinch or {key}-scroll) 拡大/縮小(ピンチ操作や {key}+スクロールも使用可能)Rotate view 表示を回転First / last page 最初/最後のページPrevious / next page 前/次のページ@@ -103,16 +103,16 @@Select all pages (Organize) すべてのページを選択(ページ整理)Home ホームOpen 開く- Open a PDF (⌘O) PDF を開く(⌘O)+ Open a PDF ({key}) PDF を開く({key})Dark gray theme ダークグレーのテーマLight theme ライトテーマAll tools すべてのツールRead 閲覧Convert 変換E-Sign 電子署名- Print (⌘P) 印刷(⌘P)+ Print ({key}) 印刷({key})Save (M4) 保存(M4)- Document properties (⌘D) 文書のプロパティ(⌘D)+ Document properties ({key}) 文書のプロパティ({key})Find tools and commands ツールとコマンドを検索Fit to height 高さに合わせるZoom in 拡大@@ -141,9 +141,9 @@Compare 比較Page thumbnails ページサムネールForm fields フォームフィールド- Zoom out (⌘−) 縮小(⌘−)- Zoom in (⌘+) 拡大(⌘+)- Rotate view clockwise (⇧⌘+) 表示を時計回りに回転(⇧⌘+)+ Zoom out ({key}) 縮小({key})+ Zoom in ({key}) 拡大({key})+ Rotate view clockwise ({key}) 表示を時計回りに回転({key})Toggle fit page / fit width ページ全体/幅に合わせるを切り替えNext page 次のページPrevious page 前のページ@@ -1268,7 +1268,7 @@Expand all bookmarks すべてのしおりを展開Expand top-level bookmarks 最上位のしおりを展開Collapse all bookmarks すべてのしおりを折りたたむ- New bookmark (⌘B) 新しいしおり(⌘B)+ New bookmark ({key}) 新しいしおり({key})This document has no bookmarks. この文書にしおりはありません。This document has no layers. この文書にレイヤーはありません。This document has no attachments. この文書に添付ファイルはありません。@@ -1283,8 +1283,8 @@No matches 一致なしSearching… {s}/{p} 検索中… {s}/{p}{c} of {n}{more} {c} / {n}{more}- Previous (⇧⌘G) 前へ(⇧⌘G)- Next (⌘G) 次へ(⌘G)+ Previous ({key}) 前へ({key})+ Next ({key}) 次へ({key})Find options 検索オプションWhole words only 単語単位で検索Case-sensitive 大文字と小文字を区別diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsvindex 8e0416075..1264fc02d 100644--- a/crates/ui-egui/src/i18n/pt-br.tsv+++ b/crates/ui-egui/src/i18n/pt-br.tsv@@ -1011,19 +1011,19 @@Attachments AnexosSignatures AssinaturasAccessibility Checker Verificador de acessibilidade- Zoom out (⌘−) Diminuir zoom (⌘−)- Zoom in (⌘+) Aumentar zoom (⌘+)- Rotate view clockwise (⇧⌘+) Girar visualização em sentido horário (⇧⌘+)+ Zoom out ({key}) Diminuir zoom ({key})+ Zoom in ({key}) Aumentar zoom ({key})+ Rotate view clockwise ({key}) Girar visualização em sentido horário ({key})Toggle fit page / fit width Alternar ajustar à página / ajustar à larguraNext page Próxima páginaPrevious page Página anteriorCurrent page — type a page number or label (such as iv) and press Enter Página atual — digite o número da página ou rótulo (como iv) e pressione Enter- Open a PDF (⌘O) Abrir um PDF (⌘O)+ Open a PDF ({key}) Abrir um PDF ({key})Dark gray theme Tema cinza escuroLight theme Tema claro- Print (⌘P) Imprimir (⌘P)+ Print ({key}) Imprimir ({key})Save (M4) Salvar (M4)- Document properties (⌘D) Propriedades do documento (⌘D)+ Document properties ({key}) Propriedades do documento ({key})Action Wizard… Assistente de ações…Add Bates numbering… Adicionar numeração Bates…Add a button Adicionar um botão@@ -1153,7 +1153,7 @@Expand all bookmarks Expandir todos os marcadoresExpand top-level bookmarks Expandir marcadores de nível superiorCollapse all bookmarks Recolher todos os marcadores- New bookmark (⌘B) Novo marcador (⌘B)+ New bookmark ({key}) Novo marcador ({key})This document has no bookmarks. Este documento não tem marcadores.This document has no layers. Este documento não tem camadas.This document has no attachments. Este documento não tem anexos.@@ -1167,8 +1167,8 @@No matches Nenhuma correspondênciaSearching… {s}/{p} Pesquisando… {s}/{p}{c} of {n}{more} {c} de {n}{more}- Previous (⇧⌘G) Anterior (⇧⌘G)- Next (⌘G) Próximo (⌘G)+ Previous ({key}) Anterior ({key})+ Next ({key}) Próximo ({key})Find options Opções de localizaçãoWhole words only Apenas palavras inteirasCase-sensitive Diferenciar maiúsculas de minúsculas@@ -1239,7 +1239,7 @@Copy selected text Copiar texto selecionadoSelect a word Selecionar uma palavraClear selection / close find Limpar seleção / fechar localização- Zoom in / out (also pinch or ⌘-scroll) Aumentar / diminuir zoom (ou pinçar / ⌘-rolagem)+ Zoom in / out (also pinch or {key}-scroll) Aumentar / diminuir zoom (ou pinçar / {key}-rolagem)Rotate view Girar visualizaçãoFirst / last page Primeira / última páginaPrevious / next page Página anterior / seguintediff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsvindex 3959899e5..bc0c898e2 100644--- a/crates/ui-egui/src/i18n/ru.tsv+++ b/crates/ui-egui/src/i18n/ru.tsv@@ -89,7 +89,7 @@Double-click Двойной щелчокSelect a word Выделить словоClear selection / close find Снять выделение / закрыть поиск- Zoom in / out (also pinch or ⌘-scroll) Масштаб (также щипок или ⌘-прокрутка)+ Zoom in / out (also pinch or {key}-scroll) Масштаб (также щипок или {key}-прокрутка)Rotate view Повернуть видFirst / last page Первая / последняя страницаPrevious / next page Предыдущая / следующая страница@@ -97,16 +97,16 @@Select all pages (Organize) Выделить все страницы (Организация)Home ГлавнаяOpen Открыть- Open a PDF (⌘O) Открыть PDF (⌘O)+ Open a PDF ({key}) Открыть PDF ({key})Dark gray theme Тёмно-серая темаLight theme Светлая темаAll tools Все инструментыRead ЧтениеConvert КонвертацияE-Sign Электронная подпись- Print (⌘P) Печать (⌘P)+ Print ({key}) Печать ({key})Save (M4) Сохранить (M4)- Document properties (⌘D) Свойства документа (⌘D)+ Document properties ({key}) Свойства документа ({key})Find tools and commands Найти инструменты и командыFit to height По высотеZoom in Увеличить@@ -135,9 +135,9 @@Compare СравнитьPage thumbnails Миниатюры страницForm fields Поля формы- Zoom out (⌘−) Уменьшить (⌘−)- Zoom in (⌘+) Увеличить (⌘+)- Rotate view clockwise (⇧⌘+) Повернуть вид по часовой стрелке (⇧⌘+)+ Zoom out ({key}) Уменьшить ({key})+ Zoom in ({key}) Увеличить ({key})+ Rotate view clockwise ({key}) Повернуть вид по часовой стрелке ({key})Toggle fit page / fit width Переключить по странице / по ширинеNext page Следующая страницаPrevious page Предыдущая страница@@ -1269,7 +1269,7 @@Expand all bookmarks Развернуть все закладкиExpand top-level bookmarks Развернуть закладки верхнего уровняCollapse all bookmarks Свернуть все закладки- New bookmark (⌘B) Новая закладка (⌘B)+ New bookmark ({key}) Новая закладка ({key})This document has no bookmarks. В этом документе нет закладки.This document has no layers. В этом документе нет слоёв.This document has no attachments. В этом документе нет вложений.@@ -1284,8 +1284,8 @@No matches Совпадений нетSearching… {s}/{p} Поиск… {s}/{p}{c} of {n}{more} {c} из {n}{more}- Previous (⇧⌘G) Предыдущее (⇧⌘G)- Next (⌘G) Следующее (⌘G)+ Previous ({key}) Предыдущее ({key})+ Next ({key}) Следующее ({key})Find options Параметры поискаWhole words only Только целые словаCase-sensitive С учётом регистраdiff --git a/crates/ui-egui/src/i18n/te.tsv b/crates/ui-egui/src/i18n/te.tsvindex 60063b862..ad6d379ed 100644--- a/crates/ui-egui/src/i18n/te.tsv+++ b/crates/ui-egui/src/i18n/te.tsv@@ -72,7 +72,7 @@ comment menu Edit సవరించుDouble-click డబుల్-క్లిక్Select a word ఒక పదాన్ని ఎంచుకోClear selection / close find ఎంపికను క్లియర్ చేయి / శోధనను మూసివేయి- Zoom in / out (also pinch or ⌘-scroll) జూమ్ పెంచు / తగ్గించు (పించ్ లేదా ⌘-స్క్రోల్తో కూడా)+ Zoom in / out (also pinch or {key}-scroll) జూమ్ పెంచు / తగ్గించు (పించ్ లేదా {key}-స్క్రోల్తో కూడా)Rotate view వీక్షణను తిప్పుFirst / last page మొదటి / చివరి పేజీPrevious / next page మునుపటి / తదుపరి పేజీ@@ -80,16 +80,16 @@ comment menu Edit సవరించుSelect all pages (Organize) అన్ని పేజీలను ఎంచుకో (పేజీల నిర్వహణలో)Home హోమ్Open తెరువు- Open a PDF (⌘O) PDFను తెరువు (⌘O)+ Open a PDF ({key}) PDFను తెరువు ({key})Dark gray theme ముదురు బూడిద రంగు థీమ్Light theme లేత థీమ్All tools అన్ని సాధనాలుRead చదవడంConvert మార్పిడిE-Sign ఇ-సంతకం- Print (⌘P) ముద్రించు (⌘P)+ Print ({key}) ముద్రించు ({key})Save (M4) సేవ్ చేయి (M4)- Document properties (⌘D) పత్ర లక్షణాలు (⌘D)+ Document properties ({key}) పత్ర లక్షణాలు ({key})Find tools and commands సాధనాలను, కమాండ్లను కనుగొనుFit to height ఎత్తుకు సరిపోయేలాZoom in జూమ్ పెంచు@@ -118,9 +118,9 @@ comment menu Edit సవరించుCompare పోల్చుPage thumbnails పేజీ థంబ్నెయిల్లుForm fields ఫారం ఫీల్డ్లు- Zoom out (⌘−) జూమ్ తగ్గించు (⌘−)- Zoom in (⌘+) జూమ్ పెంచు (⌘+)- Rotate view clockwise (⇧⌘+) వీక్షణను సవ్యదిశలో తిప్పు (⇧⌘+)+ Zoom out ({key}) జూమ్ తగ్గించు ({key})+ Zoom in ({key}) జూమ్ పెంచు ({key})+ Rotate view clockwise ({key}) వీక్షణను సవ్యదిశలో తిప్పు ({key})Toggle fit page / fit width పేజీకి సరిపోయేలా / వెడల్పుకు సరిపోయేలా మధ్య మారుNext page తదుపరి పేజీPrevious page మునుపటి పేజీ@@ -1243,7 +1243,7 @@ signature pad Type టైప్ చేయిExpand all bookmarks అన్ని బుక్మార్క్లను విస్తరించుExpand top-level bookmarks పై స్థాయి బుక్మార్క్లను విస్తరించుCollapse all bookmarks అన్ని బుక్మార్క్లను ముడుచు- New bookmark (⌘B) కొత్త బుక్మార్క్ (⌘B)+ New bookmark ({key}) కొత్త బుక్మార్క్ ({key})This document has no bookmarks. ఈ పత్రంలో బుక్మార్క్లు లేవు.This document has no layers. ఈ పత్రంలో లేయర్లు లేవు.This document has no attachments. ఈ పత్రంలో జోడింపులు లేవు.@@ -1257,8 +1257,8 @@ signature pad Type టైప్ చేయిNo matches సరిపోలికలు లేవుSearching… {s}/{p} వెతుకుతోంది… {s}/{p}{c} of {n}{more} {n}{more}లో {c}- Previous (⇧⌘G) మునుపటి (⇧⌘G)- Next (⌘G) తదుపరి (⌘G)+ Previous ({key}) మునుపటి ({key})+ Next ({key}) తదుపరి ({key})Find options కనుగొనే ఎంపికలుWhole words only పూర్తి పదాలు మాత్రమేCase-sensitive పెద్ద/చిన్న అక్షరాల తేడాతోdiff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsvindex e2a32d152..845bf7358 100644--- a/crates/ui-egui/src/i18n/uk.tsv+++ b/crates/ui-egui/src/i18n/uk.tsv@@ -94,7 +94,7 @@Double-click Подвійне клацанняSelect a word Виділити словоClear selection / close find Зняти виділення / закрити пошук- Zoom in / out (also pinch or ⌘-scroll) Збільшити / зменшити (також жестом зведення або ⌘-прокручуванням)+ Zoom in / out (also pinch or {key}-scroll) Збільшити / зменшити (також жестом зведення або {key}-прокручуванням)Rotate view Повернути виглядFirst / last page Перша / остання сторінкаPrevious / next page Попередня / наступна сторінка@@ -102,16 +102,16 @@Select all pages (Organize) Вибрати всі сторінки (Упорядкування)Home ГоловнаOpen Відкрити- Open a PDF (⌘O) Відкрити PDF (⌘O)+ Open a PDF ({key}) Відкрити PDF ({key})Dark gray theme Темно-сіра темаLight theme Світла темаAll tools Усі інструментиRead ЧитанняConvert ПеретворенняE-Sign Електронний підпис- Print (⌘P) Друк (⌘P)+ Print ({key}) Друк ({key})Save (M4) Зберегти (M4)- Document properties (⌘D) Властивості документа (⌘D)+ Document properties ({key}) Властивості документа ({key})Find tools and commands Знайти інструменти й командиFit to height За висотоюZoom in Збільшити@@ -140,9 +140,9 @@Compare ПорівнянняPage thumbnails Мініатюри сторінокForm fields Поля форми- Zoom out (⌘−) Зменшити (⌘−)- Zoom in (⌘+) Збільшити (⌘+)- Rotate view clockwise (⇧⌘+) Повернути вигляд за годинниковою стрілкою (⇧⌘+)+ Zoom out ({key}) Зменшити ({key})+ Zoom in ({key}) Збільшити ({key})+ Rotate view clockwise ({key}) Повернути вигляд за годинниковою стрілкою ({key})Toggle fit page / fit width Перемкнути масштаб за сторінкою / за шириноюNext page Наступна сторінкаPrevious page Попередня сторінка@@ -1266,7 +1266,7 @@Expand all bookmarks Розгорнути всі закладкиExpand top-level bookmarks Розгорнути закладки верхнього рівняCollapse all bookmarks Згорнути всі закладки- New bookmark (⌘B) Нова закладка (⌘B)+ New bookmark ({key}) Нова закладка ({key})This document has no bookmarks. Цей документ не має закладок.This document has no layers. Цей документ не має шарів.This document has no attachments. Цей документ не має вкладень.@@ -1281,8 +1281,8 @@No matches Збігів немаєSearching… {s}/{p} Пошук… {s}/{p}{c} of {n}{more} {c} із {n}{more}- Previous (⇧⌘G) Попередній (⇧⌘G)- Next (⌘G) Наступний (⌘G)+ Previous ({key}) Попередній ({key})+ Next ({key}) Наступний ({key})Find options Параметри пошукуWhole words only Лише цілі словаCase-sensitive З урахуванням регіструdiff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsvindex a110a403e..20f8a6f38 100644--- a/crates/ui-egui/src/i18n/zh-hans.tsv+++ b/crates/ui-egui/src/i18n/zh-hans.tsv@@ -1076,19 +1076,19 @@Attachments 附件Signatures 签名Accessibility Checker 无障碍检查器- Zoom out (⌘−) 缩小 (⌘−)- Zoom in (⌘+) 放大 (⌘+)- Rotate view clockwise (⇧⌘+) 顺时针旋转视图 (⇧⌘+)+ Zoom out ({key}) 缩小 ({key})+ Zoom in ({key}) 放大 ({key})+ Rotate view clockwise ({key}) 顺时针旋转视图 ({key})Toggle fit page / fit width 切换适合页面/适合宽度Next page 下一页Previous page 上一页Current page — type a page number or label (such as iv) and press Enter 当前页 — 输入页码或标签(如 iv)后按 Enter- Open a PDF (⌘O) 打开 PDF (⌘O)+ Open a PDF ({key}) 打开 PDF ({key})Dark gray theme 深灰色主题Light theme 浅色主题- Print (⌘P) 打印 (⌘P)+ Print ({key}) 打印 ({key})Save (M4) 保存 (M4)- Document properties (⌘D) 文档属性 (⌘D)+ Document properties ({key}) 文档属性 ({key})Action Wizard… 操作向导…Add Bates numbering… 添加贝茨编号…Add a button 添加按钮@@ -1218,7 +1218,7 @@Expand all bookmarks 展开所有书签Expand top-level bookmarks 展开顶层书签Collapse all bookmarks 折叠所有书签- New bookmark (⌘B) 新建书签 (⌘B)+ New bookmark ({key}) 新建书签 ({key})This document has no bookmarks. 本文档没有书签。This document has no layers. 本文档没有图层。This document has no attachments. 本文档没有附件。@@ -1233,8 +1233,8 @@No matches 无匹配Searching… {s}/{p} 正在搜索… {s}/{p}{c} of {n}{more} {c} / {n}{more}- Previous (⇧⌘G) 上一个 (⇧⌘G)- Next (⌘G) 下一个 (⌘G)+ Previous ({key}) 上一个 ({key})+ Next ({key}) 下一个 ({key})Find options 查找选项Whole words only 仅全字匹配Case-sensitive 区分大小写@@ -1305,7 +1305,7 @@Copy selected text 复制所选文本Select a word 选择一个词Clear selection / close find 清除选择/关闭查找- Zoom in / out (also pinch or ⌘-scroll) 放大/缩小(也可用捏合或 ⌘+滚轮)+ Zoom in / out (also pinch or {key}-scroll) 放大/缩小(也可用捏合或 {key}+滚轮)Rotate view 旋转视图First / last page 首页/末页Previous / next page 上一页/下一页diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsvindex 39351a6c9..8dda15ef0 100644--- a/crates/ui-egui/src/i18n/zh-hant.tsv+++ b/crates/ui-egui/src/i18n/zh-hant.tsv@@ -1025,19 +1025,19 @@Attachments 附件Signatures 簽章Accessibility Checker 無障礙偵測工具- Zoom out (⌘−) 縮小(⌘−)- Zoom in (⌘+) 放大(⌘+)- Rotate view clockwise (⇧⌘+) 順時針旋轉檢視(⇧⌘+)+ Zoom out ({key}) 縮小({key})+ Zoom in ({key}) 放大({key})+ Rotate view clockwise ({key}) 順時針旋轉檢視({key})Toggle fit page / fit width 切換符合頁面/符合寬度Next page 下一頁Previous page 上一頁Current page — type a page number or label (such as iv) and press Enter 目前頁面:輸入頁碼或頁面標籤(例如 iv),再按 Enter- Open a PDF (⌘O) 開啟 PDF(⌘O)+ Open a PDF ({key}) 開啟 PDF({key})Dark gray theme 深灰色主題Light theme 淺色主題- Print (⌘P) 列印(⌘P)+ Print ({key}) 列印({key})Save (M4) 儲存(M4)- Document properties (⌘D) 文件內容(⌘D)+ Document properties ({key}) 文件內容({key})Action Wizard… 動作精靈…Add Bates numbering… 新增 Bates 編號…Add a button 新增按鈕@@ -1167,7 +1167,7 @@Expand all bookmarks 展開所有書籤Expand top-level bookmarks 展開頂層書籤Collapse all bookmarks 摺疊所有書籤- New bookmark (⌘B) 新建書籤 (⌘B)+ New bookmark ({key}) 新建書籤 ({key})This document has no bookmarks. 本文件沒有書籤。This document has no layers. 本文件沒有圖層。This document has no attachments. 本文件沒有附件。@@ -1182,8 +1182,8 @@No matches 無匹配Searching… {s}/{p} 正在搜尋… {s}/{p}{c} of {n}{more} {c} / {n}{more}- Previous (⇧⌘G) 上一個 (⇧⌘G)- Next (⌘G) 下一個 (⌘G)+ Previous ({key}) 上一個 ({key})+ Next ({key}) 下一個 ({key})Find options 尋找選項Whole words only 僅全字匹配Case-sensitive 區分大小寫@@ -1254,7 +1254,7 @@Copy selected text 複製所選文字Select a word 選取一個詞Clear selection / close find 清除選取/關閉尋找- Zoom in / out (also pinch or ⌘-scroll) 放大/縮小(也可用雙指縮放或 ⌘ 加捲動)+ Zoom in / out (also pinch or {key}-scroll) 放大/縮小(也可用雙指縮放或 {key} 加捲動)Rotate view 旋轉檢視First / last page 第一頁/最後一頁Previous / next page 上一頁/下一頁diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rsindex fff91f211..547be4661 100644--- a/crates/ui-egui/src/panels.rs+++ b/crates/ui-egui/src/panels.rs@@ -480,10 +480,8 @@ pub fn right_panel(app: &mut PdfCraftApp, ui: &mut egui::Ui) {}});}- if panel == RightPanel::Bookmarks- && bm_editable- && icons::button(ui, "bookmark-plus", 26.0, false, tl!("New bookmark (⌘B)")).clicked()- {+ let new_tip = crate::commands::command_tip(ui.ctx(), tl!("New bookmark ({key})"), "bookmark.add");+ if panel == RightPanel::Bookmarks && bm_editable && icons::button(ui, "bookmark-plus", 26.0, false, &new_tip).clicked() {bm_action = Some(BmAction::New);}});diff --git a/crates/ui-egui/tests/commands.rs b/crates/ui-egui/tests/commands.rsindex 310602d85..d7677e315 100644--- a/crates/ui-egui/tests/commands.rs+++ b/crates/ui-egui/tests/commands.rs@@ -1,6 +1,7 @@//! The command registry drives menus, shortcuts and the palette: every registered command must//! be implemented, disabled commands must say why, and every surface must reach the same action.+use egui::os::OperatingSystem;use egui::{Key, Modifiers};use egui_kittest::Harness;use egui_kittest::kittest::Queryable;@@ -290,11 +291,58 @@ fn clear_recent_files_runs_from_the_palette_and_is_saved() {#[test]fn the_shortcuts_dialog_lists_the_real_bindings() {let mut h = harness();+ h.ctx.set_os(OperatingSystem::Nix);h.state_mut().execute("help.shortcuts");h.run_steps(3);- let mac = cfg!(target_os = "macos");- h.get_by_label(if mac { "⇧⌘S" } else { "Ctrl+Shift+S" });+ h.get_by_label("Ctrl+Shift+S");h.get_by_label("Save as");+ // The keys the document view handles itself are written for the platform too, and Fit+ // visible (a registered command) is listed once.+ h.get_by_label("Ctrl+1");+ h.get_by_label("Ctrl+3");+ h.get_by_label("Ctrl+G / Ctrl+Shift+G");+ h.get_by_label("← / →, Ctrl+← / Ctrl+→");+ h.get_by_label("Zoom in / out (also pinch or Ctrl-scroll)");+ assert_eq!(h.query_all_by_label_contains("⌘").count(), 0, "no ⌘ outside macOS");+ h.ctx.set_os(OperatingSystem::Mac);+ h.run_steps(2);+ h.get_by_label("⇧⌘S");+ h.get_by_label("⌘1");+ h.get_by_label("Zoom in / out (also pinch or ⌘-scroll)");+}++/// Menu ▸ View open, with egui told the app runs on `os`.+fn view_menu(os: OperatingSystem) -> Harness<'static, PdfCraftApp> {+ let mut h = harness();+ h.ctx.set_os(os);+ h.get_by_label("Menu").click();+ h.run_steps(2);+ h.get_by_label("View ⏵").hover();+ h.run_steps(3);+ h+}++#[test]+fn view_menu_and_tooltips_write_shortcuts_for_the_platform() {+ // On Linux, View ▸ Zoom and Page navigation showed ⌘1, ⌘[ … (hard-coded) while the+ // registered items under them showed Ctrl+K; tooltips showed ⌘ too.+ let h = view_menu(OperatingSystem::Nix);+ h.get_by_label("Actual size Ctrl+1");+ h.get_by_label("Zoom to page level Ctrl+0");+ h.get_by_label("Rotate view counterclockwise Ctrl+Shift+−");+ h.get_by_label("Previous view Ctrl+[");+ h.get_by_label("Find tools and commands… Ctrl+K");+ h.get_by_label("Zoom in (Ctrl++)");+ h.get_by_label("Print (Ctrl+P)");+ assert_eq!(h.query_all_by_label_contains("⌘").count(), 0, "no ⌘ outside macOS");+ assert_eq!(h.query_all_by_label_contains("Fit visible").count(), 1, "View lists Fit visible once");+ h.get_by_label("Fit visible Ctrl+3");++ let h = view_menu(OperatingSystem::Mac);+ h.get_by_label("Actual size ⌘1");+ h.get_by_label("Fit visible ⌘3");+ h.get_by_label("Rotate view clockwise (⇧⌘+)");+ assert_eq!(h.query_all_by_label_contains("Ctrl+").count(), 0, "no Ctrl+ on macOS");}#[test]