PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust
Merge current main into PR2088 and port shadow preference to split UI modules
FredAppsbad4c8180049
diff --cc ROADMAP.mdindex 0c2b8b596,56f6237e8..27cf30ccc--- a/ROADMAP.md+++ b/ROADMAP.md@@@ -581,3 -779,29 +779,31 @@@ Newest first: the date, what moved, an- **2026-10-13 (M7):** Edit a PDF ▸ Add content: Header and footer, Watermark and Background open an Add / Update / Remove menu (Update and Remove enabled only when the document has that mark), as Acrobat's Watermark control does. The catalogue gains `ToolItem::actions`, so any tool can list more commands (#1192).- **2026-10-18 (M8, #1350):** Published the history-preserving integration; simplified the inherited-form resource guard for Rust 1.96 Clippy. Formatting, 64 redaction tests, scoped Clippy, layering, assets and the scoped wasm check pass locally. CI remains pending; estimates unchanged.++ - 2026-10-18: M11 / #3227: mark target-version compatibility partial; document the unchecked newer-content limitation.++ - **2026-10-18 (PR #3227 integration):** M11: integrate upstream b0e5c6eb; retain partial target-version compatibility claims and effective-version reporting, correcting the borrowed version parser lifetime. Scope and estimates unchanged.++ - **2026-10-12 (i18n):** Albanian (`sq`, Shqip) added: 2,343-entry catalog, month and weekday names, Preferences entry; not yet reviewed by a native speaker.++ - **2026-10-21 (M4, #3865):** A new bookmark records where the reader is: the top-left of the selected text, or the top of the window, as `/XYZ left top null` (zoom kept), instead of the page top (`Edit::AddBookmark` takes `left` and `top`; `bookmark_add` takes `top` and `left`; `PageInfo::xyz_for_view`).++ - **2026-10-18 (renderer, hayro patches 19/35):** A mesh shading (types 4–7) is sampled over its own triangles instead of the whole path: a BricsCAD plan with 310 one-triangle `sh` fills took 2 s per 1024 px tile at every zoom (and hit the 20 s watchdog on a busy machine); now about 70 ms, so zooming into dense topology drawings stays fluid. Estimates unchanged.++ - **2026-10-22 (PR #3227 integration):** M11: integrate upstream `80b7d215`; retain partial target-version compatibility and upstream content-boundary and image-size regression coverage. Scope and estimates unchanged.++ - **2026-10-23 (M2, PR #4172):** Combine thumbnails and accessibility figure previews use the viewer's display-only CJK fallback. Windows family matching includes FangSong and subset-prefixed Founder names. Export, print, OCR and automation remain off by default; estimates unchanged.++ - **2026-10-26 (M2, PR #4172 print-preview review):** Print-preview requests disable installed CJK fallback and use an isolated cache so preview font availability matches output. Viewer fallback survives switching in either direction. Synthetic GBK regressions cover inline and single-worker rendering, full pages and tiles; estimates unchanged.++ - **2026-10-26 (M2, PR #4172 documentation review):** Added function documentation for installed-font script selection, bounded candidate reads, platform paths, resolver precedence and regression contracts. No runtime behavior or estimate change.++ - **2026-10-27 (M2, PR #4172 conflict resolution):** Integrated main `9a9813bf` and its engine module split. Opening, layer changes and session renderer rebuilds retain display-only CJK fallback; output configuration and print-preview cache isolation are preserved. Validation passed: 16 scoped engine regressions, 412 renderer unit tests, 43 renderer integration tests (one existing corpus case ignored), 15 Combine tests, scoped Clippy, formatting, layers/assets/parity and renderer/engine WASM checks. Estimates unchanged.+ ## Pages sidebar keyboard refresh (2026-10-30)++ PR #2133 retains document-local Pages sidebar focus for Ctrl/Cmd+A and Escape after the UI module split. The selection does not navigate. The focused regression is in `crates/ui-egui/tests/it/view.rs`; current-head hosted validation is pending. Feature counts and estimates are unchanged.+ ## Button export-value refresh (2026-10-30)++ PR #1952 retains per-widget checkbox/radio export-value editing in the split form-authoring and Prepare modules. Caption editing remains supported. Tests cover preserved appearances and selection, invalid/locked refusals, data-format round trips, and Apply/Cancel/Undo. Current-head hosted validation is pending; feature estimates are unchanged.++++- **2026-10-31 (#1577):** Reconciled the page-shadow preference with split viewer, organizer, settings and control modules, preserving upstream page-gap shadow suppression. CI validation pending.diff --cc crates/ui-egui/src/app.rsindex 000000000,425c2e26c..b4bfe9d29mode 000000,100644..100644--- a/crates/ui-egui/src/app.rs+++ b/crates/ui-egui/src/app.rs@@@ -1,0 -1,647 +1,648 @@@+ use super::hooks::OsEvent;+ use super::state::{+ Dialog, DocumentCopyJob, GridFile, LeftPanel, LinkOrigin, Mode, NumberDraft, PasswordPrompt, PendingLink, PropsTab, QuickTool, RecentFile,+ RightPanel, UnlockPrompt,+ };+ #[cfg(not(target_arch = "wasm32"))]+ use super::state::{OpenOutcome, OpenRequest, PendingRemoteLink};+ use super::*;++ mod clipboard;+ mod commands;+ mod control;+ mod files;+ mod frame;+ mod input;+ mod keys;+ mod links;+ mod prefs;+ mod window;++ pub(crate) use clipboard::{copy_refused, print_refused};+ #[cfg(not(target_arch = "wasm32"))]+ pub(crate) use files::same_file;+ use frame::migrate_panel_state;+ pub(crate) use prefs::{MAX_AUTHOR_CHARS, date_text_for_pdf};++ impl Default for PdfCraftApp {+ fn default() -> Self {+ Self::new()+ }+ }++ impl PdfCraftApp {+ /// The window's title and, on the web, the page's, from the active document (#3640). Done in+ /// `logic` too, which also runs while the window or browser tab is hidden: a document opened+ /// then (a `?file=` download finishing) still names the page an embedding host reads.+ fn sync_titles(&mut self, ctx: &egui::Context) {+ // The window shows the active document's name (or title, if it asks for that), with •+ // while it has unsaved changes, as the other Craft apps write it (#3640). Unsaved means+ // what closing would ask about, so a draft not yet applied counts too.+ let dirty = self.active.is_some_and(|i| self.has_unsaved_work(i));+ let mark = if dirty { " •" } else { "" };+ let titled = |name: Option<String>| {+ name.or_else(|| self.combine_showing().then(|| tl!("Combine files").to_owned()))+ .map_or_else(|| "PdfCraft".to_owned(), |name| format!("{name}{mark} — PdfCraft"))+ };+ let title = titled(self.active.and_then(|i| crate::canvas::tab_label(self, i)));+ // The web page's title is what an embedding host reads to tell which file opened, so it+ // names the file even when the document asks to show its own title.+ let page_title = titled(self.active.and_then(|i| self.views.get(i)).and_then(|v| self.session.get(v.id)).map(|d| d.name.clone()));+ if title != self.window_title {+ ctx.send_viewport_cmd(egui::ViewportCommand::Title(title.clone()));+ self.window_title = title;+ }+ if page_title != self.page_title {+ // eframe's web runner ignores Title: set the page's own.+ #[cfg(target_arch = "wasm32")]+ if let Some(document) = web_sys::window().and_then(|w| w.document()) {+ document.set_title(&page_title);+ }+ self.page_title = page_title;+ }+ }++ /// Construct an application with the default session, panels, theme and control state.+ pub fn new() -> Self {+ Self {+ session: Session::new(),+ views: Vec::new(),+ closed_tabs: Vec::new(),+ active: None,+ mode: Mode::AllTools,+ default_mode: Mode::AllTools,+ view_defaults: Default::default(),+ units: Default::default(),+ date_format_draft: None,+ mode_override: None,+ left: LeftPanel::AllTools,+ side_panels: Default::default(),+ left_open: true,+ right: None,+ last_right: RightPanel::Comments,+ right_before_read: None,+ comments_panel_closed: false,+ right_panel_closed: false,+ quick_tool: QuickTool::Select,+ space_hand: None,+ full_screen_tool: None,+ comment_prefs: Default::default(),+ theme: ThemeKind::Light,+ // A fresh install follows the desktop's appearance (#1248); saved settings override.+ theme_preference: ThemePreference::System,+ reading_colors: Default::default(),++ show_page_edge_shadows: true,+ #[cfg(target_os = "linux")]+ desktop_theme: None,+ #[cfg(target_os = "linux")]+ desktop_theme_enabled: false,+ scroll_speed: scroll_speed::ScrollSpeed::default(),+ animation_effects: motion::AnimationEffects::default(),+ motion: motion::Motion::default(),+ language: i18n::AUTO.to_string(),+ ui_scale: None,+ system_text_scale: 1.0,+ ui_scale_applied: None,+ flatten_fill_sign_on_save: false,+ fill_text_size: fill_sign::TEXT_SIZE,+ fill_text_color: [0.0; 3],+ dialog: None,+ updates: updates::Updates::default(),+ printer_source: None,+ options_source: None,+ print_tasks: print_ui::PrintTasks::default(),+ palette_open: false,+ palette_query: String::new(),+ all_tools_expanded: false,+ all_tools_full: false,+ all_tools_query: String::new(),+ all_tools_tab: (None, false),+ recent: Vec::new(),+ reopen_last_session: false,+ restore_last_view: true,+ last_views: Vec::new(),+ last_session: Default::default(),+ quit_session: None,+ reload_changed_files: true,+ show_secured_notice: true,+ always_default_view: false,+ #[cfg(not(target_arch = "wasm32"))]+ watch: Default::default(),+ #[cfg(not(target_arch = "wasm32"))]+ open_worker: None,+ #[cfg(not(target_arch = "wasm32"))]+ pending_opens: Vec::new(),+ #[cfg(not(target_arch = "wasm32"))]+ next_open_token: 0,+ #[cfg(all(test, not(target_arch = "wasm32")))]+ open_prepare_gate: None,+ pinned: Default::default(),+ toast: None,+ toast_script: None,+ script_messages: std::collections::VecDeque::new(),+ script_messages_dropped: 0,+ toast_dropped: 0,+ integrated_titlebar: false,+ window_controls: None,+ system_title_bar: false,+ app_frame_shown: None,+ password_prompt: None,+ document_copy: None,+ unlock_prompt: None,+ full_screen: false,+ inbox: Default::default(),+ startup_inbox: Default::default(),+ startup_superseded: false,+ failed_inbox: Default::default(),+ unsaved_flag: Default::default(),+ os_events: None,+ host_save: None,+ host_dirty: None,+ close_request: None,+ save_prompt_button: Default::default(),+ save_prompt_seen: false,+ save_prompt_attention: false,+ #[cfg(not(target_arch = "wasm32"))]+ pending_overwrite: None,+ save_override: None,+ props_draft: None,+ view_draft: None,+ custom_draft: None,+ requests: Default::default(),+ #[cfg(not(target_arch = "wasm32"))]+ pickers: Default::default(),+ #[cfg(not(target_arch = "wasm32"))]+ pick_override: None,+ export_dir_override: None,+ split_draft: SplitDraft::default(),+ extract_draft: ExtractDraft::default(),+ rotate_draft: RotateDraft::default(),+ summary_sort: Default::default(),+ sign_draft: None,+ digital_ids: Vec::new(),+ sig_expanded: Vec::new(),+ a11y_options: a11y_ui::A11yOptions::default(),+ ocr_draft: ocr_ui::OcrDraft::default(),+ ocr_run: None,+ ocr_batch: None,+ run_inline: false,+ custom_actions: Vec::new(),+ wizard: Default::default(),+ action_run: None,+ action_files_override: None,+ pdfa: Default::default(),+ compare_old: None,+ compare: None,+ js_console: Default::default(),+ doc_js: Default::default(),+ a11y: a11y_ui::A11yState::default(),+ tags_state: Default::default(),+ a11y_skipped: Default::default(),+ alt_draft: Default::default(),+ os_key_store_ids: false,+ cert_viewer: None,+ space_audit: Vec::new(),+ space_audit_of: None,+ combine_draft: Vec::new(),+ combine_conflicts: Default::default(),+ combine_tab: Default::default(),+ combine_columns: Default::default(),+ combine_view: Default::default(),+ combine_zoom: 1.0,+ organize_zoom: 1.0,+ combine_thumbs: Default::default(),+ image_import: None,+ custom_stamps: Vec::new(),+ stamp_draft: Default::default(),+ optimize_draft: OptimizeDraft::default(),+ optimize_run: None,+ progress_notice: None,+ page_clipboard: None,+ grid_drop: None,+ last_snapshot: None,+ last_copied_image: None,+ last_copied_file: None,+ system_clipboard: true,+ clipboard_override: None,+ v_pressed: false,+ attach_override: None,+ duplicate_draft: None,+ page_props_draft: None,+ field_table_draft: None,+ form_preview: false,+ window_title: String::new(),+ page_title: String::new(),+ recovery: None,+ recoverable: Vec::new(),+ recovery_keys: Default::default(),+ last_autosave: None,+ allow_quit: false,+ deferred_commands: Vec::new(),+ native_menu: None,+ menu_input: Vec::new(),+ dialog_seen: None,+ dialog_epoch: 0,+ ctx: None,+ #[cfg(not(target_arch = "wasm32"))]+ window_state: Default::default(),+ styled: false,+ fonts_ready: false,+ fonts_cjk: theme::CjkPreference::Default,+ control: None,+ bookmark_rename: None,+ last_opened_url: None,+ community_card_closed: false,+ pending_link: None,+ pending_full_screen: None,+ pending_remote_link: None,+ protect_draft: Default::default(),+ text_style_draft: Default::default(),+ boxes_draft: Default::default(),+ marks_draft: Default::default(),+ unmarked_page: Default::default(),+ export_draft: Default::default(),+ export_status: None,+ signature: None,+ initials: None,+ signature_draft: Default::default(),+ signature_preview: None,+ signature_photo: None,+ saved_signature_previews: [None, None],+ sign_graphic: sign_ui::SignGraphic::Name,+ sign_graphic_preview: None,+ #[cfg(target_arch = "wasm32")]+ signature_images: Default::default(),+ comment_props: None,+ field_props: None,+ bulk_field_props: None,+ redact_prefs: RedactPrefs::default(),+ redact_defaults: RedactPrefs::default(),+ redact_before: None,+ redact_pages_draft: RedactPagesDraft::default(),+ redact_search: RedactSearchDraft::default(),+ hidden_draft: HiddenDraft::default(),+ print_draft: PrintDraft::default(),+ link_draft: None,+ text_style: content_ui::default_style(),+ replace_draft: None,+ number_draft: NumberDraft { from: 1, to: 1, style: pdfcraft_engine::LabelStyle::Decimal, prefix: String::new(), start: 1 },+ word_count_draft: word_count_ui::Draft::default(),+ }+ }++ /// Fields are being edited (Prepare a form or its Calculation order is open, or a field tool+ /// is picked), unless the form is being previewed.+ pub fn is_preparing(&self) -> bool {+ ((self.left_open && matches!(self.left, LeftPanel::Tool("form") | LeftPanel::CalculationOrder))+ || matches!(self.quick_tool, QuickTool::Field(_)))+ && !self.form_preview+ }++ /// A number that changes whenever the open dialog changes (opened, closed or replaced by+ /// another), checked every frame. A picker started from a dialog's Browse… button answers+ /// only into the same showing of that dialog.+ pub(crate) fn dialog_epoch(&mut self) -> u64 {+ if self.dialog != self.dialog_seen {+ self.dialog_seen = self.dialog;+ self.dialog_epoch = self.dialog_epoch.wrapping_add(1);+ }+ self.dialog_epoch+ }++ pub fn active_ids(&self) -> Option<(usize, DocId)> {+ self.active.and_then(|i| self.views.get(i).map(|v| (i, v.id)))+ }++ /// A dialog or prompt is open over the window: the keyboard is its own, and nothing may act+ /// on the document underneath it.+ pub(crate) fn modal_open(&self) -> bool {+ self.dialog.is_some()+ || self.close_request.is_some()+ || self.password_prompt.is_some()+ || self.unlock_prompt.is_some()+ || self.pending_link.is_some()+ || self.pending_remote_link.is_some()+ || self.updates.open+ }++ /// Show `msg` in the toast now, in place of whatever it showed. Script messages still waiting+ /// show after it.+ pub fn notify(&mut self, msg: impl Into<String>) {+ // A left-out count it replaces is said again once the toast is free.+ self.script_messages_dropped = self.script_messages_dropped.saturating_add(std::mem::take(&mut self.toast_dropped));+ self.toast = Some((msg.into(), 0.0));+ self.toast_script = None;+ }++ /// Notify with a static message in the UI language.+ pub fn notify_tr(&mut self, text: &str) {+ self.notify(tl!(text).to_string());+ }++ /// Notify with an error's own text. Engine and OS messages are not translated: matching their+ /// English wording would break silently whenever it changes.+ pub fn notify_error(&mut self, error: impl std::fmt::Display) {+ self.notify(error.to_string());+ }++ /// Notify with a `{name}`-style template in the UI language (placeholders filled once).+ pub fn notify_fmt(&mut self, template: &str, args: &[(&str, &str)]) {+ self.notify(i18n::fmt(tl!(template), args));+ }++ /// `true` while any open document still waits for page renders (used by headless capture).+ pub fn render_pending(&self) -> bool {+ self.views.iter().any(|v| v.render_pending())+ }+ }++ impl eframe::App for PdfCraftApp {+ /// While files are dragged over the window the system sends no pointer moves, so egui+ /// would keep the place the pointer entered at: tell it where the pointer really is, so the+ /// page grid can show (and use) the gap under it.+ fn raw_input_hook(&mut self, ctx: &egui::Context, raw: &mut egui::RawInput) {+ // The button's release a window move or resize kept from egui.+ window_controls::release_after_desktop_grab(ctx, raw);+ self.prepare_raw_input(ctx, raw);+ if raw.hovered_files.is_empty() && raw.dropped_files.is_empty() {+ return;+ }+ if let Some(pos) = drag_pointer::in_window(ctx) {+ raw.events.push(egui::Event::PointerMoved(pos));+ }+ ctx.request_repaint();+ }++ fn save(&mut self, storage: &mut dyn eframe::Storage) {+ // eframe has just stored the window as it is now: not while it is minimized.+ #[cfg(not(target_arch = "wasm32"))]+ {+ let minimized = self.ctx.as_ref().is_some_and(|c| c.input(|i| i.viewport().minimized == Some(true)));+ self.window_state.keep(storage, minimized);+ }+ storage.set_string("pdfcraft", self.persist());+ }++ /// Each frame's work before drawing: opens, operating-system and control-channel requests,+ /// the quit guard, shortcuts, and the background jobs' results.+ fn logic(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {+ self.ctx = Some(ctx.clone());+ #[cfg(not(target_arch = "wasm32"))]+ self.window_state.repair(ctx);+ self.dialog_epoch();+ // Notices raised outside `ui` (opened files, OS events, the control channel) translate too.+ let lang = i18n::Lang::from_pref(&self.language);+ i18n::set_current(lang);+ #[cfg(not(target_arch = "wasm32"))]+ {+ if let Some(worker) = &self.open_worker {+ worker.set_context(ctx);+ }+ self.poll_pending_opens();+ }+ // Chinese wants its own faces before the Japanese ones (one baseline per line).+ let cjk = theme::CjkPreference::for_language(lang.code());+ if !self.styled {+ egui_extras::install_image_loaders(ctx);+ theme::install_fonts_for(ctx, cjk);+ self.fonts_cjk = cjk;+ theme::apply(ctx, self.theme);+ self.styled = true;+ } else {+ self.fonts_ready = true;+ if cjk != self.fonts_cjk {+ // Same family names as before, so named fonts stay valid while the new set loads.+ theme::install_fonts_for(ctx, cjk);+ self.fonts_cjk = cjk;+ }+ }+ self.sync_theme(ctx);+ let native = ctx.native_pixels_per_point().unwrap_or(1.0);+ ui_scale::sync(ctx, ui_scale::zoom(self.ui_scale, self.system_text_scale, native), &mut self.ui_scale_applied);+ // Remember user work even if its tab is subsequently closed or Home is selected.+ self.startup_superseded |= !self.views.is_empty() || self.combine_showing() || self.dialog.is_some() || self.password_prompt.is_some();+ // Also done in `raw_input_hook`, before input; here for hosts that don't call the hook.+ self.scroll_speed.set_line_speed(ctx);+ // Motion reads this frame's wheel input, so it begins in `ui`, in a known UI phase:+ // `logic` also runs alone while hidden, where the input events and time are stale.+ // Before taking this frame's drop: the grid must be drawn once with the pointer where+ // the files were let go before the gap is read.+ self.finish_grid_drop(ctx);+ // Showing a document hides the Combine files tab.+ if self.active.is_some() {+ self.combine_tab.focused = false;+ }+ #[cfg(target_arch = "wasm32")]+ self.process_signature_images();+ let dropped = ctx.input(|i| i.raw.dropped_files.clone());+ #[cfg(not(target_arch = "wasm32"))]+ let dropped = self.drop_on_signature_pad(dropped);+ #[cfg(not(target_arch = "wasm32"))]+ let dropped = self.drop_on_grid(dropped, ctx);+ for f in dropped {+ // Files dropped on the Combine files tab join its list instead of opening.+ if self.combine_showing() {+ self.drop_into_combine(f, ctx);+ } else {+ self.open_dropped(f, ctx);+ }+ }+ let arrived: Vec<(String, Vec<u8>)> = self.inbox.lock().map(|mut q| std::mem::take(&mut *q)).unwrap_or_default();+ for (name, bytes) in arrived {+ if let Err(e) = self.open_bytes(&name, None, bytes) {+ self.notify_fmt("Couldn't open {name}: {e}", &[("name", &name), ("e", &e.to_string())]);+ }+ }+ // Don't replace a pending prompt or import. A startup file may need its own password+ // prompt, so its bytes stay queued until the current interaction finishes.+ #[cfg(not(target_arch = "wasm32"))]+ let opening = !self.pending_opens.is_empty();+ #[cfg(target_arch = "wasm32")]+ let opening = false;+ if !opening+ && self.password_prompt.is_none()+ && self.image_import.is_none()+ && self.dialog.is_none()+ && self.close_request.is_none()+ && self.pending_link.is_none()+ && self.pending_remote_link.is_none()+ {+ let startup = self.startup_inbox.lock().map(|mut q| std::mem::take(&mut *q)).unwrap_or_default();+ for (name, bytes) in startup {+ let activate = !self.startup_superseded;+ if let Err(e) = self.open_bytes_with_focus(&name, None, bytes, activate) {+ self.notify_fmt("Couldn't open {name}: {e}", &[("name", &name), ("e", &e)]);+ }+ }+ }+ let failed: Vec<(String, String)> = self.failed_inbox.lock().map(|mut q| std::mem::take(&mut *q)).unwrap_or_default();+ for (name, e) in failed {+ self.notify_fmt("Couldn't open {name}: {e}", &[("name", &name), ("e", &e)]);+ }+ let os_events = self.os_events.as_mut().map(|poll| poll()).unwrap_or_default();+ for e in os_events {+ match e {+ #[cfg(not(target_arch = "wasm32"))]+ OsEvent::Open(paths) => {+ paths.iter().for_each(|p| {+ self.open_path(p);+ });+ // Files handed to the running app (Finder, or another launch): bring its+ // window to the front, also when minimized or full screen on another Space.+ ctx.send_viewport_cmd(egui::ViewportCommand::Minimized(false));+ ctx.send_viewport_cmd(egui::ViewportCommand::Focus);+ }+ #[cfg(target_arch = "wasm32")]+ OsEvent::Open(_) => {}+ // Like closing the window: `guard_quit` asks about unsaved changes.+ OsEvent::Quit => ctx.send_viewport_cmd(egui::ViewportCommand::Close),+ }+ }+ if let Some((_, id)) = self.active_ids() {+ let out = self.session.take_js_output(id);+ self.handle_js(id, out);+ }+ if let Some(mut control) = self.control.take() {+ control.tick(ctx, self);+ self.control = Some(control);+ }+ self.guard_quit(ctx);+ // macOS: quit through `terminate:` instead of dropping the window (Touch Bar crash, #1136).+ #[cfg(target_os = "macos")]+ craft_quit::on_close_request(ctx);+ self.autosave_tick(ctx, web_time::Instant::now());+ // Reload documents whose files a build rewrote (#431).+ #[cfg(not(target_arch = "wasm32"))]+ self.watch_files();+ if self.host_dirty.is_some() {+ let dirty = self.first_dirty().is_some();+ if let Some(report) = self.host_dirty.as_mut() {+ report(dirty);+ }+ }+ self.poll_updates();+ self.poll_print();+ // Shortcuts deferred last frame: the text field has taken that frame's typing since.+ let deferred = std::mem::take(&mut self.deferred_commands);+ self.native_menu_clicks(ctx);+ // The keys a menu click stands for (⌘C, Delete…), before anything reads this frame's keys.+ if !self.menu_input.is_empty() {+ let events = std::mem::take(&mut self.menu_input);+ ctx.input_mut(|i| i.events.extend(events));+ }+ self.shortcuts(ctx);+ // Scrolling and group-drag previews are transient: never resume after changing tabs,+ // opening a modal/palette, or returning to a window that lost focus.+ let blocked = self.modal_open() || self.palette_open || !ctx.input(|i| i.focused);+ for (index, view) in self.views.iter_mut().enumerate() {+ view.objects.set_input_blocked(blocked || self.active != Some(index));+ if blocked || self.active != Some(index) {+ view.auto_scroll.cancel();+ }+ }+ // A field that refused its value this frame keeps the shortcut from saving or printing+ // behind the user's back; so does a save prompt opened since.+ if self.process_pending_edits() && self.close_request.is_none() {+ for (id, doc) in deferred {+ // Only in the document the shortcut was pressed in.+ if self.active_ids().map(|(_, active)| active) == doc {+ self.execute(id);+ }+ }+ }+ self.poll_export();+ self.auto_ocr_scanned_page();+ self.poll_ocr();+ self.poll_optimize();+ self.poll_action();+ self.process_file_requests();+ #[cfg(not(target_arch = "wasm32"))]+ self.process_picked();+ // Last, after everything that can open or answer the "save changes?" question.+ self.attend_save_prompt(ctx);+ self.sync_native_menu(ctx);+ self.sync_titles(ctx);+ }++ fn ui(&mut self, ui: &mut egui::Ui, _frame: &mut eframe::Frame) {+ let ctx = ui.ctx().clone();+ i18n::set_current(i18n::Lang::from_pref(&self.language));+ // A language change switches stock chrome between LTR and RTL before anything is drawn.+ theme::sync_direction(&ctx);+ // Fonts registered via set_fonts only take effect next frame; named families would panic now.+ if !self.fonts_ready {+ ctx.request_repaint();+ return;+ }+ // Before any widget reads this frame's wheel input or draws.+ self.motion.begin_pass(&ctx, self.animation_effects);+ // One-time 0.36 -> 0.37 panel persistence migration, before any panel stores or reads state.+ migrate_panel_state(ui);+ for view in &mut self.views {+ view.begin_render_frame();+ }+ self.sync_titles(&ctx);+ // The accessible window takes the same name, so a screen reader (AT-SPI on Linux, UIA on+ // Windows) can tell it apart (#4614). egui builds the root node afresh every pass.+ ctx.accesskit_node_builder(egui::accesskit_root_id(), |root| root.set_label(self.window_title.as_str()));+ if self.full_screen && self.active.is_some() {+ // Full screen: the page on black, nothing else, as Acrobat's Full Screen Mode (Esc+ // or ⌘L to leave).+ egui::CentralPanel::default().frame(egui::Frame::NONE.fill(egui::Color32::BLACK)).show(ui, |ui| {+ if let Some(i) = self.active {+ match compare_ui::side_by_side(self, i) {+ Some((old, new)) => compare_ui::compare_area(self, old, new, ui),+ None => canvas::document_area(self, i, ui),+ }+ }+ });+ dialogs::show(self, &ctx);+ // Notices too: a refused field value or a failed save must be seen in full screen.+ self.show_progress(&ctx);+ widgets::toast(self, &ctx);+ self.finish_render_frame(&ctx);+ if let Some(mut control) = self.control.take() {+ control.finish_frame(&ctx, self);+ self.control = Some(control);+ }+ return;+ }+ self.sync_window_frame(&ctx);+ if self.draws_window_frame() {+ window_controls::resize_edges(&ctx);+ }+ chrome::tab_strip(self, ui);+ chrome::mode_bar(self, ui);+ // Whichever way another tab came to the front, it shows instead of the expanded view.+ if self.all_tools_full && self.all_tools_tab != self.shown_tab() {+ self.all_tools_full = false;+ }+ side_panels::show(self, ui);+ let t = theme::Tokens::get(&ctx);+ egui::CentralPanel::default().frame(egui::Frame::NONE.fill(t.pasteboard)).show(ui, |ui| {+ if self.mode == Mode::AllTools && self.all_tools_full {+ all_tools_ui::show(self, ui);+ } else {+ match self.active {+ None if self.combine_showing() => combine_ui::page(self, ui),+ None => home::show(self, ui),+ Some(index) => match compare_ui::side_by_side(self, index) {+ Some((old, new)) => compare_ui::compare_area(self, old, new, ui),+ None => canvas::document_area(self, index, ui),+ },+ }+ }+ });+ self.process_pending_edits();+ palette::show(self, &ctx);+ dialogs::show(self, &ctx);+ self.show_progress(&ctx);+ widgets::toast(self, &ctx);+ self.finish_render_frame(&ctx);+ // Screenshots are issued only after a settled pass that really drew the window.+ if let Some(mut control) = self.control.take() {+ control.finish_frame(&ctx, self);+ self.control = Some(control);+ }+ }+ }diff --cc crates/ui-egui/src/app/control.rsindex 000000000,79bd2fa25..85fdae38amode 000000,100644..100644--- a/crates/ui-egui/src/app/control.rs+++ b/crates/ui-egui/src/app/control.rs@@@ -1,0 -1,400 +1,403 @@@+ use super::*;+ use crate::control;++ impl PdfCraftApp {+ /// Enable the UI control channel on `ctx` (opt-in; see [`control`]). Returns a client that+ /// sends requests to this app; [`control::serve`] exposes it on loopback.+ pub fn attach_control(&mut self, ctx: &egui::Context) -> control::ControlClient {+ let (control, client) = control::attach(ctx);+ self.control = Some(control);+ client+ }++ /// Apply a named view option (`--page 3`, `--panel bookmarks`, `--theme dark`, …).+ ///+ /// This is the seed of the UI control channel (M3.9): the same verbs become `ui.set` calls.+ pub fn set_option(&mut self, key: &str, value: &str) -> Result<(), String> {+ let view = self.active.and_then(|i| self.views.get_mut(i));+ match (key, view) {+ ("language", _) => {+ let language = i18n::normalize_pref(value).ok_or_else(|| {+ let codes: Vec<&str> = std::iter::once(i18n::AUTO).chain(i18n::Lang::all().map(i18n::Lang::code)).collect();+ format!("language must be one of {}", codes.join(", "))+ })?;+ self.language = language.to_string();+ }+ ("theme", _) => {+ let preference = match value {+ "system" => ThemePreference::System,+ "light" => ThemePreference::Light,+ "dark" => ThemePreference::Dark,+ _ => return Err("theme must be light, dark, or system".into()),+ };+ self.set_theme_preference(preference);+ }++ ("show_page_edge_shadows", _) => {++ self.show_page_edge_shadows = value.parse::<bool>().map_err(|_| "show_page_edge_shadows must be true or false")?;++ }+ ("scroll_speed", _) => {+ self.scroll_speed = scroll_speed::ScrollSpeed::parse(value).ok_or("scroll_speed must be slow, normal, or fast")?;+ }+ ("animation_effects", _) => {+ self.animation_effects = motion::AnimationEffects::parse(value).ok_or("animation_effects must be system, on, or off")?;+ }+ ("panel", _) => {+ self.right = match value {+ "comments" => Some(RightPanel::Comments),+ "bookmarks" => Some(RightPanel::Bookmarks),+ "pages" => Some(RightPanel::Pages),+ "fields" => Some(RightPanel::Fields),+ "layers" => Some(RightPanel::Layers),+ "attachments" => Some(RightPanel::Attachments),+ "signatures" => Some(RightPanel::Signatures),+ "accessibility" => Some(RightPanel::Accessibility),+ "tags" => Some(RightPanel::Tags),+ "search" => Some(RightPanel::Search),+ "compare" => Some(RightPanel::Compare),+ "none" => None,+ other => return Err(format!("unknown panel {other}")),+ }+ }+ ("mode", _) => {+ let mode = Mode::parse(value).unwrap_or(Mode::AllTools);+ self.mode_override = Some(mode);+ self.mode = mode;+ // As switch_mode: another workspace puts the expanded All tools view away.+ if mode != Mode::AllTools {+ self.all_tools_full = false;+ }+ }+ ("default-mode", _) => {+ self.default_mode = Mode::parse(value).ok_or("default-mode must be all, read, edit, convert or sign")?;+ }+ ("date-format", _) => self.session.set_date_format(value)?,+ ("date-language", _) => self.session.set_date_language(Some(value).filter(|v| *v != "auto"))?,+ ("tool", _) => {+ let g = pdfcraft_engine::catalog::group(value).ok_or_else(|| format!("unknown tool {value}"))?;+ self.select_tool(g.id);+ }+ ("left", _) => self.left_open = value != "closed",+ ("home", _) => {+ self.active = None;+ // With no document open the expanded All tools view covers Home itself, so no+ // other tab comes forward to put it away.+ self.all_tools_full = false;+ }+ ("dialog", _) => {+ self.dialog = match value {+ "properties" => Some(Dialog::Properties(PropsTab::Description)),+ "security" => Some(Dialog::Properties(PropsTab::Security)),+ "fonts" => Some(Dialog::Properties(PropsTab::Fonts)),+ "custom" => Some(Dialog::Properties(PropsTab::Custom)),+ "advanced" => Some(Dialog::Properties(PropsTab::Advanced)),+ "space-audit" => Some(Dialog::Properties(PropsTab::SpaceAudit)),+ "shortcuts" => Some(Dialog::Shortcuts),+ "split" => Some(Dialog::Split),+ "protect" => Some(Dialog::Protect),+ "page-boxes" => Some(Dialog::PageBoxes),+ "header-footer" => Some(Dialog::Marks(pdfcraft_engine::MarkKind::HeaderFooter)),+ "watermark" => Some(Dialog::Marks(pdfcraft_engine::MarkKind::Watermark)),+ "background" => Some(Dialog::Marks(pdfcraft_engine::MarkKind::Background)),+ "export-image" => Some(Dialog::Export(export_ui::ExportKind::Image)),+ "word-count" => Some(Dialog::WordCount),+ "export-text" => Some(Dialog::Export(export_ui::ExportKind::Text)),+ "export-all-images" => Some(Dialog::Export(export_ui::ExportKind::AllImages)),+ "accessibility-options" => Some(Dialog::AccessibilityOptions),+ "recognize-text" => Some(Dialog::RecognizeText),+ "js-console" => Some(Dialog::JsConsole),+ "document-js" => Some(Dialog::DocumentJs),+ "preferences" => Some(Dialog::Preferences),+ "compare-files" => Some(Dialog::CompareFiles),+ "action-wizard" => Some(Dialog::ActionWizard),+ "pdfa" => Some(Dialog::PdfA),+ "signature" => Some(Dialog::Signature),+ "optimize" => Some(Dialog::Optimize),+ "sign" | "certify" => {+ // Sign with a Digital ID for an invisible signature on the current page.+ let page = self.active.map_or(0, |i| self.views[i].current);+ self.start_signing(page, None, None, (value == "certify").then_some(2));+ Some(Dialog::Sign)+ }+ "number-pages" => {+ // Same path as the menu, so the page range is seeded.+ self.execute("page.number");+ Some(Dialog::NumberPages)+ }+ "page-properties" => {+ // Same path as the panel, so the selected pages and their order are seeded.+ self.execute("page.properties");+ self.dialog+ }+ "none" => None,+ _ => Some(Dialog::About),+ };+ if let Some(Dialog::Marks(kind)) = self.dialog {+ self.marks_draft.opened(kind);+ }+ }+ ("tools", _) if value == "full" => self.expand_all_tools(),+ ("tools", _) => {+ self.all_tools_full = false;+ self.all_tools_expanded = value != "collapsed";+ }+ ("palette", _) => {+ self.palette_open = true;+ self.palette_query = value.to_string();+ }+ ("page", Some(v)) => v.go_to_page(value.parse::<usize>().map_err(|e| e.to_string())?.saturating_sub(1)),+ ("zoom", Some(v)) => v.set_zoom(DocView::parse_zoom_percent(value).ok_or("zoom must be a percentage above 0")?),+ ("layout", Some(v)) => {+ let (layout, continuous) = canvas::parse_display_token(value).ok_or("layout must be single, continuous, two-up or two-page")?;+ v.set_display(layout, continuous);+ }+ ("continuous", Some(v)) => match value {+ "on" => v.set_continuous(true),+ "off" => v.set_continuous(false),+ _ => return Err("continuous must be on or off".into()),+ },+ ("page-gaps", Some(_)) => {+ let show = match value {+ "on" => true,+ "off" => false,+ _ => return Err("page-gaps must be on or off".into()),+ };+ self.set_active_page_gaps(show);+ }+ ("default-page-gaps", _) => {+ self.view_defaults.show_page_gaps = match value {+ "on" => true,+ "off" => false,+ _ => return Err("default-page-gaps must be on or off".into()),+ };+ }+ ("cover", Some(v)) => {+ let on = match value {+ "on" => true,+ "off" => false,+ _ => return Err("cover must be on or off".into()),+ };+ if on && !v.cover_applies() {+ return Err("switch to two-page view first to show the cover page".into());+ }+ v.set_cover(on);+ }+ ("default-layout", _) => {+ let (layout, continuous) =+ canvas::parse_display_token(value).ok_or("default-layout must be single, continuous, two-up or two-page")?;+ (self.view_defaults.layout, self.view_defaults.continuous) = (layout, continuous);+ }+ ("default-continuous", _) => {+ self.view_defaults.continuous = match value {+ "on" => true,+ "off" => false,+ _ => return Err("default-continuous must be on or off".into()),+ };+ }+ ("default-zoom", _) => {+ self.view_defaults =+ self.view_defaults.with_zoom(value).ok_or("default-zoom must be fit-width, fit-page or a percentage from 8 to 6400")?;+ }+ ("always-default-view", _) => {+ self.always_default_view = match value {+ "on" => true,+ "off" => false,+ _ => return Err("always-default-view must be on or off".into()),+ };+ }+ ("tools-side", _) => {+ self.side_panels.tools_side = match value {+ "left" => side_panels::ToolsSide::Left,+ "right" => side_panels::ToolsSide::Right,+ _ => return Err("tools-side must be left or right".into()),+ }+ }+ ("organize", Some(v)) => {+ if value == "off" {+ v.organize = false;+ } else {+ v.open_organize();+ }+ }+ // Inspector thumbnail size, in percent, independent of document and grid zoom.+ ("thumbnail-zoom", Some(v)) => {+ let percent = value.trim_end_matches('%').parse::<f32>().map_err(|e| e.to_string())?;+ if !percent.is_finite() || !canvas::THUMBNAIL_ZOOM_RANGE.contains(&(percent / 100.0)) {+ return Err("thumbnail-zoom must be between 50 and 150".into());+ }+ v.set_thumbnail_zoom(percent / 100.0);+ }+ // `--grid-zoom 150`: the size of the pages in the organize grid, in percent.+ ("grid-zoom", Some(v)) => {+ let percent = value.trim_end_matches('%').parse::<f32>().map_err(|e| e.to_string())?;+ if !percent.is_finite() || !canvas::GRID_ZOOM_RANGE.contains(&(percent / 100.0)) {+ return Err("grid-zoom must be between 50 and 300".into());+ }+ v.set_grid_zoom(percent / 100.0);+ // The grid's size is one for every document, as it is remembered.+ self.organize_zoom = v.grid_zoom();+ }+ ("rotate", Some(v)) => {+ let deg: u16 = value.parse().map_err(|_| "rotate: 0, 90, 180 or 270")?;+ if !deg.is_multiple_of(90) {+ return Err("rotate: 0, 90, 180 or 270".into());+ }+ v.rotation = deg % 360;+ }+ ("layer", _) => {+ // `--layer "Name=off"` / `"Name=on"`+ let (name, state) = value.rsplit_once('=').ok_or("expected NAME=on|off")?;+ let (i, id) = self.active_ids().ok_or("`layer` needs an open document")?;+ let idx = self+ .session+ .get(id)+ .and_then(|d| d.info.layers.iter().position(|l| l.name == name))+ .ok_or_else(|| format!("no layer named {name}"))?;+ if self.session.set_layer_visible(id, idx, state != "off") {+ self.views[i].invalidate_content();+ }+ }+ ("find", Some(v)) => {+ v.open_find();+ if let Some(f) = v.find.as_mut() {+ f.query = value.to_string();+ }+ v.rerun_find();+ }+ ("fields", Some(v)) => v.highlight_fields = value != "off",+ ("select", Some(v)) => {+ // The same physical page ranges as the Organize Pages selection field.+ let pages = crate::page_selection_ui::parse(value, v.page_count()).map_err(|e| e.to_string())?;+ v.select_pages(&pages);+ }+ ("notice", Some(v)) => v.notice_dismissed = value == "off",+ ("quick", _) => {+ // `--quick select|hand|note|freetext|highlight|underline|strikeout|ink|line|arrow|square|circle`+ self.quick_tool = match value {+ "select" => QuickTool::Select,+ measure if measure.starts_with("measure-") => QuickTool::Measure(+ measure_ui::Tool::from_name(measure.trim_start_matches("measure-")).ok_or_else(|| format!("unknown tool {measure}"))?,+ ),+ "hand" => QuickTool::Hand,+ "crop" => QuickTool::Crop,+ "enhance-camera" => QuickTool::EnhanceCamera,+ "redact" => QuickTool::Redact,+ "add-text" => QuickTool::AddText,+ "edit-text" => QuickTool::EditText,+ "link" => QuickTool::Link,+ "sign" => QuickTool::SignArea { certify: false },+ "marquee-zoom" => QuickTool::MarqueeZoom,+ "snapshot" => QuickTool::Snapshot,+ "column-select" => QuickTool::ColumnSelect,+ "certify" => QuickTool::SignArea { certify: true },+ custom if custom.starts_with("custom-stamp-") => {+ let i: usize = custom[13..].parse().map_err(|_| format!("bad stamp {custom}"))?;+ if i >= self.custom_stamps.len() {+ return Err(format!("there are {} custom stamps", self.custom_stamps.len()));+ }+ QuickTool::CustomStamp(i)+ }+ stamp if stamp.starts_with("stamp-") => QuickTool::Stamp(+ pdfcraft_engine::StampKind::ALL+ .into_iter()+ .find(|k| k.name().trim_start_matches("PC").eq_ignore_ascii_case(&stamp[6..]))+ .ok_or_else(|| format!("unknown stamp {stamp}"))?,+ ),+ field if field.starts_with("field-") => QuickTool::Field(+ prepare::FieldTool::from_command(&format!("form.add.{}", &field[6..])).ok_or_else(|| format!("unknown tool {field}"))?,+ ),+ fill if fill.starts_with("fill-") => QuickTool::Fill(+ fill_sign::FillTool::from_command(&format!("sign.fill.{}", &fill[5..])).ok_or_else(|| format!("unknown tool {fill}"))?,+ ),+ other => {+ let t = comments::CommentTool::from_command(&format!("comment.{other}")).ok_or_else(|| format!("unknown tool {other}"))?;+ self.comment_prefs.group_tool[t.group()] = t;+ QuickTool::Comment(t)+ }+ };+ }+ ("author", _) => self.comment_prefs.author = value.to_string(),+ ("comment-tool-pinned", _) => {+ self.comment_prefs.pinned = match value {+ "true" => true,+ "false" => false,+ _ => return Err("comment-tool-pinned must be true or false".into()),+ };+ }+ ("hide-empty-highlight-hover", _) => {+ self.comment_prefs.hide_empty_highlight_hover = match value {+ "true" => true,+ "false" => false,+ _ => return Err("hide-empty-highlight-hover must be true or false".into()),+ };+ }+ ("ui-scale", _) => self.ui_scale = ui_scale::parse(value)?,+ // `--secured-notice false`: no notice above the pages that a document is secured.+ ("secured-notice", _) => {+ self.show_secured_notice = match value {+ "true" => true,+ "false" => false,+ _ => return Err("secured-notice must be true or false".into()),+ };+ }+ ("system-title-bar", _) => {+ self.system_title_bar = match value {+ "true" => true,+ "false" => false,+ _ => return Err("system-title-bar must be true or false".into()),+ };+ }+ ("flatten-fill-sign", _) => {+ self.flatten_fill_sign_on_save = match value {+ "true" => true,+ "false" => false,+ _ => return Err("flatten-fill-sign must be true or false".into()),+ };+ }+ ("comment", Some(v)) => {+ // `--comment 2:4` selects the 4th annotation of page 2 (1-based, as comment_list reports).+ let (p, i) = value.split_once(':').ok_or("comment: PAGE:INDEX")?;+ let (p, i): (usize, usize) =+ (p.trim().parse().map_err(|_| "comment: PAGE:INDEX")?, i.trim().parse().map_err(|_| "comment: PAGE:INDEX")?);+ v.comments.selected = Some((p.saturating_sub(1), i.saturating_sub(1)));+ v.comments.reveal = true;+ }+ // `--combine-view list`: Combine files as thumbnails (grid) or as the table (list).+ ("combine-view", _) => {+ self.combine_view = combine_ui::CombineView::parse(value).ok_or("combine-view must be grid or list")?;+ }+ // `--combine-zoom 150`: the size of the cards in the Combine grid, in percent.+ ("combine-zoom", _) => {+ let percent = value.trim_end_matches('%').parse::<f32>().map_err(|e| e.to_string())?;+ if !percent.is_finite() || !combine_grid::ZOOM_RANGE.contains(&(percent / 100.0)) {+ let (lo, hi) = (combine_grid::ZOOM_RANGE.start(), combine_grid::ZOOM_RANGE.end());+ return Err(format!("combine-zoom must be between {} and {}", lo * 100.0, hi * 100.0));+ }+ self.set_combine_zoom(percent / 100.0);+ }+ (k, None)+ if [+ "page",+ "zoom",+ "layout",+ "continuous",+ "page-gaps",+ "cover",+ "organize",+ "grid-zoom",+ "thumbnail-zoom",+ "fields",+ "find",+ "rotate",+ "select",+ "notice",+ "comment",+ ]+ .contains(&k) =>+ {+ return Err(format!("`{k}` needs an open document"));+ }+ (other, _) => return Err(format!("unknown option {other}")),+ }+ Ok(())+ }+ }diff --cc crates/ui-egui/src/app/prefs.rsindex 000000000,e5eaae586..7dd9846a7mode 000000,100644..100644--- a/crates/ui-egui/src/app/prefs.rs+++ b/crates/ui-egui/src/app/prefs.rs@@@ -1,0 -1,368 +1,372 @@@+ use super::*;++ /// [`PdfCraftApp::date_text`] for callers that already borrow other parts of the app.+ pub(crate) fn date_text(session: &Session, fmt: Option<&str>) -> Result<String, String> {+ let lang = session.date_language().unwrap_or(i18n::current().code());+ session.today_text(fmt, Some(lang))+ }++ /// Today in Preferences ▸ Date format for stamping into a PDF; refused when it has characters+ /// Fill & Sign can't write yet (see [`pdfcraft_engine::dates::unwritable`]).+ pub(crate) fn date_text_for_pdf(session: &Session) -> Result<String, String> {+ let lang = session.date_language().unwrap_or(i18n::current().code());+ session.today_text_for_pdf(None, Some(lang))+ }++ /// The longest author name kept (Preferences ▸ Identity, restored settings).+ pub(crate) const MAX_AUTHOR_CHARS: usize = 200;++ /// A restored colour: an `[r, g, b]` array of finite numbers, each clamped to 0–1 (restored+ /// settings are untrusted). Anything else (a string, a wrong length, a null or a non-finite+ /// number) is refused whole, so the caller keeps its default.+ fn rgb_triple(v: &serde_json::Value) -> Option<[f64; 3]> {+ let a = v.as_array()?;+ if a.len() != 3 {+ return None;+ }+ let mut out = [0.0f64; 3];+ for (slot, x) in out.iter_mut().zip(a.iter()) {+ let n = x.as_f64()?;+ if !n.is_finite() {+ return None;+ }+ *slot = n.clamp(0.0, 1.0);+ }+ Some(out)+ }++ impl PdfCraftApp {+ pub fn set_theme_preference(&mut self, preference: ThemePreference) {+ self.theme_preference = preference;+ if let Some(ctx) = self.ctx.clone() {+ self.sync_theme(&ctx);+ theme::apply(&ctx, self.theme);+ } else {+ self.theme = preference.resolve(None, ThemeKind::Light);+ }+ }++ /// The app-wide reading-colours preference: sets it and applies it to every open document,+ /// not just the active one (Preferences ▸ Reading colours, Acrobat's Replace Document+ /// Colors). A document the change actually touches re-renders.+ pub fn set_reading_colors(&mut self, colors: pdfcraft_render::ReadingColors) {+ self.reading_colors = colors;+ for i in 0..self.views.len() {+ // Idempotent per document: the engine says whether anything changed.+ if self.session.set_reading_colors(self.views[i].id, colors) {+ self.views[i].invalidate_content();+ }+ }+ }++ /// Enable the Linux desktop portal in a native window. Headless contexts keep+ /// their supplied input and never connect to the user's session bus.+ #[cfg(target_os = "linux")]+ pub fn enable_desktop_theme(&mut self) {+ self.desktop_theme_enabled = true;+ }++ /// Today in `fmt` (or Preferences ▸ Date format), with month and weekday names in the date+ /// language, or the interface language when it follows that.+ pub fn date_text(&self, fmt: Option<&str>) -> Result<String, String> {+ date_text(&self.session, fmt)+ }++ /// Serialize the user's persistent state (recent files, theme). Local only.+ pub fn persist(&self) -> String {+ let trusted: Vec<String> = self.session.trusted_certificates().iter().map(pdfcraft_engine::sign::x509::to_pem).collect();+ let mut v = serde_json::json!({+ "side_panels": self.side_panels.to_json(self.left_open),+ "docking_right": self.right,+ "recent": self.recent,+ "reopen_last_session": self.reopen_last_session,+ "restore_last_view": self.restore_last_view,+ "last_views": self.last_views_to_save(),+ // Kept only while the preference is on.+ "last_session": self.reopen_last_session.then(|| self.session_to_save()),+ "reload_changed_files": self.reload_changed_files,+ "system_title_bar": self.system_title_bar,+ "pinned_folders": self.pinned.folders,+ "theme": self.theme_preference,+ "scroll_speed": self.scroll_speed,+ "animation_effects": self.animation_effects,+ "default_mode": self.default_mode,+ "default_layout": canvas::display_token(self.view_defaults.layout, self.view_defaults.continuous),+ "default_zoom": self.view_defaults.zoom_name(),+ "always_default_view": self.always_default_view,+ "highlight_fields": self.view_defaults.highlight_fields,+ "units": self.units,+ "language": self.language,+ "reading_colors": self.reading_colors,+ // Null follows the system's text scaling.+ "ui_scale": self.ui_scale,+ "flatten_fill_sign": self.flatten_fill_sign_on_save,+ "fill_text_size": self.fill_text_size,+ "date_format": self.session.date_format(),+ // Null follows the interface language.+ "date_language": self.session.date_language(),+ "author": self.comment_prefs.author,+ // Per-tool comment defaults (colours, opacity, widths), so Make Current+ // Properties Default survives a restart (#340).+ "comment_styles": self+ .comment_prefs+ .styles()+ .map(|(t, s)| serde_json::json!({+ "tool": t.command(),+ "color": s.color,+ "opacity": s.opacity,+ "width": s.width,+ "fill": s.fill,+ }))+ .collect::<Vec<_>>(),+ // Drawn signatures keep their original form (older settings read the same).+ "signature": match &self.signature { Some(fill_sign::SavedSig::Drawn(s)) => Some(s), _ => None },+ "signature_text": match &self.signature { Some(fill_sign::SavedSig::Typed(t)) => Some(t), _ => None },+ "signature_image": match &self.signature { Some(s @ fill_sign::SavedSig::Image(_)) => Some(s), _ => None },+ "initials": self.initials,+ "sign_graphic": self.sign_graphic,+ // macOS Keychain and Windows store identities are read from their OS key stores each time.+ "digital_ids": self.digital_ids.iter().filter(|e| !e.path.starts_with("keychain:") && !e.path.starts_with("windows:")).collect::<Vec<_>>(),+ "trusted": trusted,+ "custom_stamps": stamps_ui::encode(&self.custom_stamps),+ "javascript": self.session.javascript(),+ "actions": actions_ui::encode(&self.custom_actions),+ "combine_columns": self.combine_columns.to_json(),+ "combine_view": self.combine_view.as_str(),+ "combine_zoom": self.combine_zoom,+ "comments_panel_closed": self.comments_panel_closed,+ "right_panel_closed": self.right_panel_closed,+ });+ // Set apart: one more key inside the macro above passes serde_json's recursion limit.+ v["default_page_gaps"] = serde_json::Value::Bool(self.view_defaults.show_page_gaps);+ v["fill_text_color"] = serde_json::json!(self.fill_text_color);+ v["redact_prefs"] = self.redact_defaults.to_json();+ // Set outside json! above, which is at serde_json's macro recursion limit.+ v["hide_empty_highlight_hover"] = serde_json::Value::Bool(self.comment_prefs.hide_empty_highlight_hover);++ v["show_page_edge_shadows"] = self.show_page_edge_shadows.into();+ v["comment_tool_pinned"] = serde_json::Value::Bool(self.comment_prefs.pinned);+ v["show_secured_notice"] = serde_json::Value::Bool(self.show_secured_notice);+ v["organize_zoom"] = serde_json::json!(self.organize_zoom);+ // Canonical names survive changes to the order of PAPERS and do not depend on UI language.+ v["print_paper"] = serde_json::json!(pdfcraft_engine::print::PAPERS.get(self.print_draft.paper).map(|(name, _)| *name));+ v.to_string()+ }++ /// Restore state written by `persist`. Unknown or malformed data is ignored.+ pub fn restore(&mut self, json: &str) {+ let Ok(v) = serde_json::from_str::<serde_json::Value>(json) else { return };+ let panels = side_panels::restore(&v);+ self.side_panels = panels.panels;+ if let Some(open) = panels.tools_open {+ self.left_open = open;+ }+ if let Some(right) = v.get("docking_right") {+ self.right = serde_json::from_value(right.clone()).ok().flatten().filter(|_| !panels.side_closed);+ }+ self.combine_columns = combine_ui::Columns::from_json(&v["combine_columns"]);+ if let Some(view) = v["combine_view"].as_str().and_then(combine_ui::CombineView::parse) {+ self.combine_view = view;+ }+ if let Some(zoom) = v["combine_zoom"].as_f64() {+ self.set_combine_zoom(zoom as f32);+ }+ // Clamped like any grid zoom when the grid next shows; nonsense keeps the usual size.+ if let Some(zoom) = v["organize_zoom"].as_f64().map(|z| z as f32).filter(|z| z.is_finite()) {+ self.organize_zoom = zoom.clamp(*canvas::GRID_ZOOM_RANGE.start(), *canvas::GRID_ZOOM_RANGE.end());+ }+ if let Ok(r) = serde_json::from_value::<Vec<RecentFile>>(v["recent"].clone()) {+ // Only keep entries whose files still exist.+ #[cfg(not(target_arch = "wasm32"))]+ let r: Vec<RecentFile> = r.into_iter().filter(|f| std::path::Path::new(&f.path).exists()).collect();+ self.recent = r;+ }+ self.restore_layout_prefs(&v);+ self.restore_behavior_prefs(&v);+ self.restore_view_prefs(&v);+ self.restore_comment_prefs(&v);+ self.restore_signature_prefs(&v);+ }++ /// The panels, combine view, zoom and recent files.+ fn restore_layout_prefs(&mut self, v: &serde_json::Value) {+ if let Some(on) = v["reopen_last_session"].as_bool() {+ self.reopen_last_session = on;+ }+ if let Some(on) = v["restore_last_view"].as_bool() {+ self.restore_last_view = on;+ }+ self.restore_last_views(&v["last_views"]);+ self.last_session = last_session::LastSession::from_json(&v["last_session"]);+ if let Some(on) = v["system_title_bar"].as_bool() {+ self.system_title_bar = on;+ }+ if let Some(on) = v["reload_changed_files"].as_bool() {+ self.reload_changed_files = on;+ }+ if let Some(on) = v["show_secured_notice"].as_bool() {+ self.show_secured_notice = on;+ }+ self.pinned.restore(&v["pinned_folders"]);+ if let Ok(preference) = serde_json::from_value::<ThemePreference>(v["theme"].clone()) {+ self.set_theme_preference(preference);+ }+ if let Ok(speed) = serde_json::from_value::<scroll_speed::ScrollSpeed>(v["scroll_speed"].clone()) {+ self.scroll_speed = speed;+ }+ if let Ok(effects) = serde_json::from_value::<motion::AnimationEffects>(v["animation_effects"].clone()) {+ self.animation_effects = effects;+ }+ if let Ok(mode) = serde_json::from_value::<Mode>(v["default_mode"].clone()) {+ self.default_mode = mode;+ }+ if let Some((layout, continuous)) = v["default_layout"].as_str().and_then(canvas::parse_display_token) {+ (self.view_defaults.layout, self.view_defaults.continuous) = (layout, continuous);+ }+ }++ /// Switches for reopening, window chrome and file watching.+ fn restore_behavior_prefs(&mut self, v: &serde_json::Value) {+ if let Some(show) = v["default_page_gaps"].as_bool() {+ self.view_defaults.show_page_gaps = show;+ }+ if let Ok(units) = serde_json::from_value::<units::Unit>(v["units"].clone()) {+ self.units = units;+ }+ if let Some(on) = v["always_default_view"].as_bool() {+ self.always_default_view = on;+ }+ if let Some(paper) = v+ .get("print_paper")+ .and_then(serde_json::Value::as_str)+ .and_then(|name| pdfcraft_engine::print::PAPERS.iter().position(|(canonical, _)| *canonical == name))+ {+ self.print_draft.paper = paper;+ }+ if let Some(on) = v["highlight_fields"].as_bool() {+ self.view_defaults.highlight_fields = on;+ }+ if let Some(closed) = v["comments_panel_closed"].as_bool() {+ self.comments_panel_closed = closed;+ }+ if let Some(closed) = v["right_panel_closed"].as_bool() {+ self.right_panel_closed = closed;+ }+ if let Some(defaults) = v["default_zoom"].as_str().and_then(|zoom| self.view_defaults.with_zoom(zoom)) {+ self.view_defaults = defaults;+ }+ if let Some(language) = v["language"].as_str().and_then(i18n::normalize_pref) {+ self.language = language.to_string();+ }+ if let Some(on) = v["flatten_fill_sign"].as_bool() {+ self.flatten_fill_sign_on_save = on;+ }+ if let Some(size) = v["fill_text_size"].as_f64().and_then(fill_sign::valid_text_size) {+ self.fill_text_size = size;+ }+ if let Ok(color) = serde_json::from_value::<[f64; 3]>(v["fill_text_color"].clone())+ && let Some(color) = fill_sign::valid_text_color(color)+ {+ self.fill_text_color = color;+ }++ if let Some(show) = v["show_page_edge_shadows"].as_bool() {++ self.show_page_edge_shadows = show;++ }+ if let Some(prefs) = RedactPrefs::from_json(&v["redact_prefs"]) {+ self.redact_prefs = prefs.clone();+ self.redact_defaults = prefs;+ }+ }++ /// Display defaults, units, language and sign-in details.+ fn restore_view_prefs(&mut self, v: &serde_json::Value) {+ // Settings are untrusted: an unreadable value (a colour that isn't three bytes, say)+ // fails to deserialize and keeps Off.+ if let Ok(colors) = serde_json::from_value::<pdfcraft_render::ReadingColors>(v["reading_colors"].clone()) {+ self.reading_colors = colors;+ }+ // Settings are untrusted: a size out of range follows the system instead.+ self.ui_scale = v["ui_scale"].as_f64().and_then(ui_scale::valid);+ // Settings are untrusted: an unusable pattern keeps the default.+ if let Some(f) = v["date_format"].as_str() {+ let _ = self.session.set_date_format(f);+ }+ if let Some(l) = v["date_language"].as_str() {+ let _ = self.session.set_date_language(Some(l));+ }+ // An empty or missing name keeps the login-name default; settings are untrusted, so the+ // name is cut to a sane length.+ if let Some(author) = v["author"].as_str().map(str::trim).filter(|a| !a.is_empty()) {+ self.comment_prefs.author = author.chars().take(MAX_AUTHOR_CHARS).collect();+ }+ if let Some(hide) = v["hide_empty_highlight_hover"].as_bool() {+ self.comment_prefs.hide_empty_highlight_hover = hide;+ }+ if let Some(pinned) = v["comment_tool_pinned"].as_bool() {+ self.comment_prefs.pinned = pinned;+ }+ }++ /// The author and per-tool comment styles.+ fn restore_comment_prefs(&mut self, v: &serde_json::Value) {+ // Per-tool comment styles (#340): each field goes through its clamping setter, so a+ // malformed or hostile entry is clamped or ignored rather than trusted.+ if let Some(styles) = v["comment_styles"].as_array() {+ for e in styles {+ let Some(tool) = e["tool"].as_str().and_then(crate::comments::CommentTool::from_command) else { continue };+ if let Some(c) = rgb_triple(&e["color"]) {+ self.comment_prefs.set_color(tool, c);+ }+ if let Some(o) = e["opacity"].as_f64() {+ self.comment_prefs.set_opacity(tool, o);+ }+ if let Some(w) = e["width"].as_f64() {+ self.comment_prefs.set_width(tool, w);+ }+ // `"fill": null` is a saved "no fill", which clears a tool's default fill; a+ // missing or malformed fill keeps it.+ let fill = match e.get("fill") {+ Some(serde_json::Value::Null) => Some(None),+ Some(v) => rgb_triple(v).map(Some),+ None => None,+ };+ if let Some(fill) = fill {+ let mut s = self.comment_prefs.style(tool);+ s.fill = fill;+ self.comment_prefs.set_style(tool, s);+ }+ }+ }+ }++ /// Saved signatures, stamps, actions and trusted certificates.+ fn restore_signature_prefs(&mut self, v: &serde_json::Value) {+ if let Ok(s) = serde_json::from_value::<Vec<Vec<[f32; 2]>>>(v["signature"].clone())+ && s.iter().all(|st| st.iter().all(|p| p.iter().all(|x| x.is_finite())))+ {+ self.signature = Some(fill_sign::SavedSig::Drawn(s));+ }+ if let Some(t) = v["signature_text"].as_str().filter(|t| !t.trim().is_empty()) {+ self.signature = Some(fill_sign::SavedSig::Typed(t.to_string()));+ }+ if let Ok(s @ fill_sign::SavedSig::Image(_)) = serde_json::from_value::<fill_sign::SavedSig>(v["signature_image"].clone()) {+ self.signature = Some(s);+ }+ if let Ok(i) = serde_json::from_value::<fill_sign::SavedSig>(v["initials"].clone()) {+ self.initials = Some(i);+ }+ // An unreadable choice (a damaged image) falls back to the name.+ self.sign_graphic = serde_json::from_value(v["sign_graphic"].clone()).unwrap_or_default();+ if let Ok(ids) = serde_json::from_value::<Vec<DigitalIdEntry>>(v["digital_ids"].clone()) {+ self.digital_ids = ids;+ }+ self.custom_stamps = stamps_ui::decode(&v["custom_stamps"]);+ self.custom_actions = actions_ui::decode(&v["actions"]);+ if let Some(on) = v["javascript"].as_bool() {+ self.session.set_javascript(on);+ }+ if let Ok(pems) = serde_json::from_value::<Vec<String>>(v["trusted"].clone()) {+ let certs = pems.iter().filter_map(|p| pdfcraft_engine::sign::x509::load_certificates(p.as_bytes()).ok()).flatten().collect();+ self.apply_trusted_certificates(certs);+ }+ }+ }diff --cc crates/ui-egui/src/canvas.rsindex 710e9b053,8b280ba75..5625587a6--- a/crates/ui-egui/src/canvas.rs+++ b/crates/ui-egui/src/canvas.rs@@@ -903,1641 -815,1529 +815,1530 @@@ impl DocViewself.page_count}- pub fn select_pages(&mut self, pages: &[usize]) {- self.selected = pages.iter().copied().filter(|p| *p < self.page_count).collect();- if let Some(first) = self.selected.first() {- self.current = *first;- }+ /// Drops wheel state after a discontinuous jump so the destination cannot+ /// inherit momentum from the previous viewport.+ fn reset_coarse_state(&mut self) {+ self.wheel.clear_motion();+ self.wheel_boost_x.reset();+ self.wheel_boost_y.reset();}+ }- /// A click on page `i`'s thumbnail, in the organize grid or the Pages panel. ⇧ selects the- /// range from the anchor (or the current page); ⌘/Ctrl toggles the page; a plain click- /// selects only it. `seed_current` is for the Pages panel, where an empty selection means- /// the current page: the first ⌘-click on another page keeps the current one selected too.- pub fn click_page(&mut self, i: usize, modifiers: egui::Modifiers, seed_current: bool) {- if i >= self.page_count {- return;- }- if modifiers.shift {- let a = self.select_anchor.unwrap_or(self.current);- self.selected = (a.min(i)..=a.max(i)).collect();- } else if modifiers.command {- if seed_current && self.selected.is_empty() && i != self.current {- self.selected.insert(self.current);+ /// The renders a frame wants (page, scale, tag, tile), and the pages visible.+ type PageRenders = (Vec<(usize, f32, u64, Option<Tile>)>, Vec<usize>);++ /// What the page-scroll closure reads: this frame's zoom, scrolling, tool and document state.+ #[derive(Clone, Copy)]+ struct PageEnv<'a> {+ added: &'a Vec<pdfcraft_engine::Added>,+ allowed: bool,+ author: &'a String,+ auto_delta: Vec2,+ avail: Rect,+ boost_extra: Vec2,+ by_line: &'a String,+ calc_order: bool,+ can_copy: bool,+ can_crop: bool,+ can_fill: bool,+ can_modify: bool,+ comments_hidden: bool,+ content_h: f32,+ content_w: f32,+ custom_stamp: &'a Option<crate::stamps_ui::CustomStamp>,+ date_text: &'a Result<String, String>,+ doc: &'a pdfcraft_engine::Document,+ doc_links: &'a Vec<pdfcraft_engine::LinkItem>,+ edge_delta: Vec2,+ editing_content: bool,+ form: &'a Arc<Vec<pdfcraft_engine::FormField>>,+ generation: u64,+ glide: Vec2,+ hand: bool,+ info: &'a DocInfo,+ initials: &'a Option<crate::fill_sign::SavedSig>,+ key_scroll: f32,+ middle_gesture: bool,+ modal: bool,+ navigation_enabled: bool,+ paper: Color32,++ show_page_edge_shadows: bool,+ ppp: f32,+ precise_scroll: Vec2,+ prefs: &'a comments::CommentPrefs,+ preparing: bool,+ rects: &'a Vec<Rect>,+ redact_mark: ([f64; 3], f64),+ scale: f32,+ selection_wheel: bool,+ selects_text: bool,+ signature: &'a Option<crate::fill_sign::SavedSig>,+ single_paging: bool,+ t: &'a Tokens,+ table_preview: &'a Option<crate::field_table_ui::Preview>,+ tag: u64,+ text_style: &'a pdfcraft_engine::AddedText,+ tool: QuickTool,+ units: crate::units::Unit,+ unobstructed: bool,+ visible_pages: &'a Vec<usize>,+ y_shift: f32,+ fill_text_size: f64,+ fill_text_color: [f64; 3],+ today: (i64, u32, u32),+ }++ /// What the page-scroll closure produces for the rest of the frame.+ #[derive(Default)]+ struct PageOut {+ canvas_action: Option<comments::CanvasAction>,+ clicked_link: Option<LinkTarget>,+ copy_selected: bool,+ field_menu: Option<FieldMenu>,+ field_placed: bool,+ field_props: bool,+ hover_text: Option<(Pos2, String)>,+ image_action: Option<crate::edit_text_ui::ImageAction>,+ open_boxes: bool,+ open_initials: bool,+ open_signature: bool,+ open_table: Option<(usize, [f64; 4])>,+ primary_down: bool,+ refused: Option<String>,+ stamp_placed: bool,+ }++ /// The page-scroll closure's body: lays out and draws the visible pages, their tools and overlays, and+ /// returns the renders wanted and the pages visible.+ /// The state of one pass over the visible pages: what is read, and what the pages add up to.+ struct PageFrame<'a> {+ env: PageEnv<'a>,+ resp: &'a egui::Response,+ ptr: &'a PagePointer,+ origin: Pos2,+ visible: Rect,+ pressed: bool,+ pointer: Option<Pos2>,+ signature_preview: &'a mut Option<(crate::fill_sign::SavedSig, egui::TextureHandle)>,+ out: PageOut,+ wanted: Vec<(usize, f32, u64, Option<Tile>)>,+ visible_now: Vec<usize>,+ current: usize,+ best_overlap: f32,+ current_overlap: f32,+ current_height: f32,+ pressed_page: Option<usize>,+ calc_hover: Option<crate::calc_order_ui::Focus>,+ }++ /// Visible heights (points) closer than this are equal: one page size can meet the viewport a+ /// fraction of a point differently once the scroll offset is applied.+ const PAGE_TIE: f32 = 0.5;++ /// Draws page `i` of the visible pages: its raster, the tools' input and overlays.+ /// One visible page: its index, its rectangle on screen and the transform to and from the page.+ #[derive(Clone, Copy)]+ struct PageSlot {+ i: usize,+ r: Rect,+ xf: PageXform,+ }++ /// Paints the page's paper, shadow and raster (or why it can't be shown), and asks for the renders+ /// it wants.+ fn paint_page_surface(ui: &mut egui::Ui, view: &mut DocView, frame: &mut PageFrame<'_>, slot: &PageSlot) {+ let PageEnv { paper, ppp, scale, t, tag, .. } = frame.env;+ let PageSlot { i, r, xf } = *slot;+ let visible = frame.visible;+ let info = frame.env.info;+ let painter = ui.painter();+ // Shadows would darken the preceding page when pages touch.- if view.show_page_gaps {++ if view.show_page_gaps && frame.env.show_page_edge_shadows {+ painter.add(egui::epaint::Shadow { offset: [0, 3], blur: 14, spread: 0, color: t.page_shadow }.as_shape(r, CornerRadius::ZERO));+ }+ painter.rect_filled(r, CornerRadius::ZERO, paper);+ if let Some(err) = view.errors.get(&i) {+ painter.rect_filled(r, CornerRadius::ZERO, Color32::from_rgb(0xFB, 0xF4, 0xF4));+ icons::paint(+ ui,+ Rect::from_center_size(r.center() - vec2(0.0, 26.0), vec2(28.0, 28.0)),+ "triangle-alert",+ 26.0,+ Color32::from_rgb(0xC8, 0x3A, 0x3A),+ );+ let message = crate::i18n::fmt(tl!("This page couldn't be displayed.\n{e}"), &[("e", err)]);+ let msg = ui.fonts_mut(|f| f.layout(message, theme::regular(12.5), Color32::from_rgb(0x6A, 0x2A, 0x2A), (r.width() - 40.0).max(80.0)));+ painter.galley(pos2(r.center().x - msg.size().x / 2.0, r.center().y), msg, Color32::BLACK);+ } else {+ let (pw_pt, ph_pt) = (info.pages[i].width.max(1.0), info.pages[i].height.max(1.0));+ // A GPU may take smaller textures than these (OpenGL drivers report as little as+ // 2048 pixels, and uploading a bigger one aborts), so both stay within its limit.+ let max_side = ui.ctx().input(|inp| inp.max_texture_side) as f32;+ let tiled = pw_pt.max(ph_pt) * scale > TILE_THRESHOLD.min(max_side);+ // Whole-page raster: sharp when small, a low-res backdrop when tiled.+ let (want_scale, want_tag) = if tiled {+ let bs = BASE_SIDE.min(max_side) / pw_pt.max(ph_pt);+ (bs, scale_tag(bs))+ } else {+ (scale, tag)+ };+ // Under tiles, a whole-page raster sharper than the backdrop (from before the page+ // grew past the tiling size) is a better backdrop: keep demanding it as it is.+ match view.pages.get(&i).filter(|p| tiled && p.tag != STALE_TAG && tag_scale(p.tag) >= want_scale) {+ Some(p) => frame.wanted.push((i, tag_scale(p.tag), p.tag, None)),+ None => frame.wanted.push((i, want_scale, want_tag, None)),+ }+ match view.pages.get(&i) {+ Some(p) => {+ if !tiled && p.tag == want_tag {+ xf.texel_aligned(p.tex.size(), ppp).paint_image(painter, p.tex.id(), 0.0, 0.0, 1.0, 1.0);+ } else {+ // A backdrop, or a raster at an older scale until the new one arrives.+ xf.paint_image(painter, p.tex.id(), 0.0, 0.0, 1.0, 1.0);+ }}- if !self.selected.remove(&i) {- self.selected.insert(i);+ None => {+ let now = ui.input(|inp| inp.time);+ let since = *view.waiting_since.entry(i).or_insert(now);+ let msg = if now - since > 6.0 { "Still rendering — this page is unusually complex…" } else { "Rendering…" };+ painter.text(r.center(), Align2::CENTER_CENTER, tl!(msg), theme::regular(12.0), t.text_faint);}- self.select_anchor = Some(i);- } else {- self.selected = [i].into();- self.select_anchor = Some(i);+ }+ if tiled && r.intersects(visible) {+ paint_page_tiles(ui, view, frame, slot, (pw_pt, ph_pt, max_side));}}+ }- /// Drop the page selection; a later ⇧-click ranges from `anchor`.- pub fn clear_page_selection(&mut self, anchor: Option<usize>) {- self.selected.clear();- self.select_anchor = anchor.filter(|a| *a < self.page_count);+ /// Paints the tiles of a page too big to draw whole: the tiles of earlier zooms first, stretched,+ /// then the visible tiles of this one, nearest the viewport centre first, asking for those missing.+ fn paint_page_tiles(ui: &egui::Ui, view: &mut DocView, frame: &mut PageFrame<'_>, slot: &PageSlot, (pw_pt, ph_pt, max_side): (f32, f32, f32)) {+ let PageEnv { ppp, scale, tag, .. } = frame.env;+ let PageSlot { i, r, xf } = *slot;+ let visible = frame.visible;+ let painter = ui.painter();+ // Device-pixel geometry of the scaled page, and the visible part of it+ // (found by mapping the visible screen corners back into the page). Sides round+ // up as whole-page rasters do, so the last partial row and column get tiles.+ let (dw, dh) = (device_pixels(pw_pt, scale), device_pixels(ph_pt, scale));+ // Adaptive tile side for this zoom and page, within the GPU texture limit:+ // a zoomed viewport or a giant sheet is covered by a few large tiles+ // instead of many small ones, and each tile costs one full page interpret.+ // Never zero (u32 division below).+ let ts = tile_side(scale, dw.max(dh)).min(max_side as u32).max(64);+ let vis = r.intersect(visible);+ let corners = [vis.left_top(), vis.right_top(), vis.right_bottom(), vis.left_bottom()].map(|c| xf.screen_to_norm(c));+ let (u0, u1) = corners.iter().fold((1.0f32, 0.0f32), |(a, b), c| (a.min(c.0), b.max(c.0)));+ let (v0, v1) = corners.iter().fold((1.0f32, 0.0f32), |(a, b), c| (a.min(c.1), b.max(c.1)));+ let (vx0, vy0) = ((u0.max(0.0) * dw as f32) as u32, (v0.max(0.0) * dh as f32) as u32);+ let (vx1, vy1) = (((u1.min(1.0) * dw as f32).ceil() as u32).min(dw), ((v1.min(1.0) * dh as f32).ceil() as u32).min(dh));+ // Tiles of earlier zooms first, stretched, the nearest scale last (on top):+ // until the current tiles arrive, a zoom shows them rather than the backdrop.+ let mut older: Vec<(f32, u32, u32, &TextureHandle)> =+ view.tiles.iter().filter(|((p, t, _, _), _)| *p == i && *t != tag).map(|((_, t, ox, oy), tex)| (tag_scale(*t), *ox, *oy, tex)).collect();+ older.sort_by(|a, b| (b.0 / scale).ln().abs().total_cmp(&(a.0 / scale).ln().abs()));+ for (s, ox, oy, tex) in older {+ let (ow, oh) = (device_pixels(pw_pt, s) as f32, device_pixels(ph_pt, s) as f32);+ let [w, h] = tex.size();+ let (x, y) = (ox as f32, oy as f32);+ xf.paint_image(painter, tex.id(), x / ow, y / oh, (x + w as f32) / ow, (y + h as f32) / oh);+ }+ // Visible tiles, nearest the viewport centre first: each tile costs a full+ // page interpret, so the workers sharpen what is looked at before the edges.+ let (vcx, vcy) = ((vx0 + vx1) as f32 / 2.0, (vy0 + vy1) as f32 / 2.0);+ let mut coords: Vec<(u32, u32)> = Vec::new();+ for ty in vy0 / ts..=(vy1.saturating_sub(1)) / ts {+ for tx in vx0 / ts..=(vx1.saturating_sub(1)) / ts {+ coords.push((tx, ty));+ }+ }+ coords.sort_by(|a, b| {+ let da = ((a.0 * ts + ts / 2) as f32 - vcx).abs() + ((a.1 * ts + ts / 2) as f32 - vcy).abs();+ let db = ((b.0 * ts + ts / 2) as f32 - vcx).abs() + ((b.1 * ts + ts / 2) as f32 - vcy).abs();+ da.total_cmp(&db)+ });+ for (tx, ty) in coords {+ let (x, y) = (tx * ts, ty * ts);+ let (w, h) = (ts.min(dw.saturating_sub(x)), ts.min(dh.saturating_sub(y)));+ if w == 0 || h == 0 {+ continue;+ }+ frame.wanted.push((i, scale, tag, Some(Tile { x, y, w, h })));+ if let Some(tex) = view.tiles.get(&(i, tag, x, y)) {+ let (fw, fh) = (dw as f32, dh as f32);+ xf.texel_aligned([dw as usize, dh as usize], ppp).paint_image(+ painter,+ tex.id(),+ x as f32 / fw,+ y as f32 / fh,+ (x + w) as f32 / fw,+ (y + h) as f32 / fh,+ );+ }}+ }- pub fn render_pending(&self) -> bool {- !self.last_queue.is_empty() || self.text_background.pending() || self.move_background.pending()- }+ /// What the page's tools did with the pointer this frame.+ struct PageInput {+ /// A tool, a field or a comment took the pointer: text selection must leave it alone.+ consumed: bool,+ /// Redact or Highlight draws boxes off text.+ area_tool: bool,+ }- /// The cached tile keys of a page, as (scale tag, tile x, tile y) (diagnostics and tests).- pub fn tiles_debug(&self, page: usize) -> Vec<(u64, u32, u32)> {- let mut k: Vec<(u64, u32, u32)> = self.tiles.keys().filter(|key| key.0 == page).map(|key| (key.1, key.2, key.3)).collect();- k.sort_unstable();- k- }+ /// Common geometry and pointer state for a tool acting on one page.+ #[derive(Clone, Copy)]+ pub(crate) struct PageToolContext<'a> {+ pub ui: &'a egui::Ui,+ pub resp: &'a egui::Response,+ pub xf: &'a PageXform,+ pub ptr: &'a PagePointer,+ pub page: usize,+ pub doc: &'a pdfcraft_engine::Document,+ pub info: &'a DocInfo,+ }- /// Re-render every page and text layer (the document's appearance changed, e.g. a layer- /// was toggled). Out-of-date rasters stay on screen until their replacements arrive, so the- /// view never flashes blank.- pub fn invalidate_content(&mut self) {- // Undo, redo and other document-wide changes: a released drawing's preview would be a ghost.- self.comments.settling.clear();- for p in self.pages.values_mut() {- p.tag = STALE_TAG;- }- self.stale_thumbs.extend(self.thumbs.keys().copied());- for slot in self.print_pages.values_mut() {- slot.0 = STALE_TAG;- }- // Pages may have moved: a sharp render of another page would be worse than a soft one.- self.grid_pages.clear();- self.tiles.clear();- self.stale_tiles.clear();- self.forms.unbaked.clear();- self.texts.clear();- self.text_failed.clear();- self.errors.clear();- self.slow_pages.clear();- self.waiting_since.clear();- self.last_queue.clear();- self.selection = None;- if let Some(f) = self.find.as_mut() {- f.matches.clear();- f.current = None;- }+ /// Comments: tools, selection, moving and resizing come before text selection. Form fields take+ /// clicks first with the Select tool (as Acrobat fills fields in every viewing mode); then+ /// comments; then text selection.+ fn page_tool_input(ui: &mut egui::Ui, view: &mut DocView, frame: &mut PageFrame<'_>, slot: &PageSlot) -> PageInput {+ let PageEnv {+ added,+ allowed,+ author,+ by_line,+ can_crop,+ can_fill,+ can_modify,+ comments_hidden,+ custom_stamp,+ date_text,+ doc,+ doc_links,+ editing_content,+ form,+ info,+ initials,+ prefs,+ preparing,+ redact_mark,+ signature,+ table_preview,+ text_style,+ tool,+ units,+ fill_text_size,+ fill_text_color,+ ..+ } = frame.env;+ let PageSlot { i, xf, .. } = *slot;+ let PageFrame { resp, ptr, pointer, .. } = *frame;+ let cx = PageToolContext { ui, resp, xf: &xf, ptr, page: i, doc, info };+ let pcx = comments::PageCx { page: i, xf: &xf, ptr, info, tool, prefs, allowed, hidden: comments_hidden, redact_mark };+ let (lines, images) =+ if matches!(tool, QuickTool::AddText | QuickTool::EditText) && can_modify { edit_inventory(view, doc, i) } else { Default::default() };+ let field_tool = match tool {+ QuickTool::Field(f) => Some(f),+ _ => None,+ };+ // While a table is being set up, nothing else is drawn or moved.+ let prepare_allowed = can_modify && table_preview.is_none() && frame.out.open_table.is_none();+ let hits = PageHits {+ page: i,+ xf: &xf,+ info,+ tool,+ pcx: &pcx,+ form,+ can_fill,+ can_modify,+ editing_content,+ preparing,+ field_tool,+ prepare_allowed,+ added,+ lines: &lines,+ images: &images,+ clip: ui.clip_rect(),+ };+ if let Some(o) = ptr.pressed().filter(|o| xf.rect.contains(*o)) {+ let at = hits.at(view, o);+ view.router.press(i, at, tool);+ }+ if let QuickTool::Measure(measure_tool) = tool {+ crate::measure_ui::page_input(ui, resp, doc, view, &pcx, measure_tool, units);}- /// Only `page` changed (a comment was added, edited or removed): re-render that page and- /// re-read its text, keep everything else. Out-of-date tiles stay on screen until replacements arrive.- pub fn page_changed(&mut self, page: usize) {- if let Some(p) = self.pages.get_mut(&page) {- p.tag = STALE_TAG;- }- if self.thumbs.contains_key(&page) {- self.stale_thumbs.insert(page);+ // Form fields take clicks first with the Select tool (as Acrobat fills fields in+ // every viewing mode); then comments; then text selection.+ if let QuickTool::Stamp(kind) = tool+ && allowed+ && let Some(p) = ptr.within(xf.rect)+ {+ view.cursor.claim(Layer::ToolArea, egui::CursorIcon::Crosshair);+ // The tool's own click: nothing drawn over the page here holds the press.+ if resp.clicked() && view.router.owner(i).is_none() {+ // Centred on the click, upright as the page is shown.+ let (vx, vy) = xf.screen_to_view(p);+ let (w, h) = kind.size();+ let corners = [(vx as f64 - w / 2.0, vy as f64 - h / 2.0), (vx as f64 + w / 2.0, vy as f64 + h / 2.0)];+ let u: Vec<[f32; 2]> = corners.iter().map(|(x, y)| info.pages[i].view_to_user(*x as f32, *y as f32)).collect();+ let rect = [u[0][0].min(u[1][0]) as f64, u[0][1].min(u[1][1]) as f64, u[0][0].max(u[1][0]) as f64, u[0][1].max(u[1][1]) as f64];+ let by = (kind.group() == pdfcraft_engine::StampGroup::Dynamic).then(|| by_line.clone());+ let shape = pdfcraft_engine::Shape::Stamp { rect, stamp: kind, by };+ view.pending_edit = Some(pdfcraft_engine::Edit::AddAnnotation(pdfcraft_engine::NewAnnotation {+ page: i,+ style: pdfcraft_engine::Style::default_for(&shape),+ shape,+ contents: String::new(),+ author: author.clone(),+ }));+ frame.out.stamp_placed = true;}- if let Some(slot) = self.print_pages.get_mut(&page) {- slot.0 = STALE_TAG;+ }+ if let Some(cs) = custom_stamp.as_ref()+ && allowed+ && let Some(p) = ptr.within(xf.rect)+ {+ view.cursor.claim(Layer::ToolArea, egui::CursorIcon::Crosshair);+ // The tool's own click: nothing drawn over the page here holds the press.+ if resp.clicked() && view.router.owner(i).is_none() {+ // Centred on the click at its natural size (the engine sizes it).+ let (vx, vy) = xf.screen_to_view(p);+ let u = info.pages[i].view_to_user(vx, vy);+ let (x, y) = (u[0] as f64, u[1] as f64);+ view.pending_edit = Some(pdfcraft_engine::Edit::AddCustomStamp {+ page: i,+ rect: [x, y, x, y],+ name: cs.name.clone(),+ file: pdfcraft_engine::MarkFile { name: cs.file.clone(), bytes: cs.data.clone(), page: cs.page },+ author: author.clone(),+ });+ frame.out.stamp_placed = true;}- let current_tag = if self.current_scale_tag != 0 {- self.current_scale_tag- } else {- self.tiles.keys().filter(|k| k.0 == page).map(|k| k.1).max().unwrap_or(0)- };- self.tiles.retain(|key, _| key.0 != page || key.1 == current_tag);- self.stale_tiles.retain(|key| key.0 != page || key.1 == current_tag);- for &key in self.tiles.keys() {- if key.0 == page && key.1 == current_tag {- self.stale_tiles.insert(key);+ }+ // Over a mark already placed, the Fill & Sign tool picks it up (comments, below).+ if let QuickTool::Fill(ft) = tool+ && allowed+ && !comments::fill_grabs(&pcx, view)+ {+ match crate::fill_sign::page_input(+ cx,+ crate::fill_sign::PageInput {+ tool: ft,+ text_size: fill_text_size,+ text_color: fill_text_color,+ signature: signature.as_ref(),+ initials: initials.as_ref(),+ preview: frame.signature_preview,+ author,+ date_text,+ },+ view,+ ) {+ Some(crate::fill_sign::FillAction::Edit(e)) => view.pending_edit = Some(*e),+ Some(crate::fill_sign::FillAction::Signature(e)) => {+ view.pending_edit = Some(*e);+ view.fill_signature_page = Some(i);}- }- self.slow_pages.remove(&page);- self.texts.remove(&page);- self.text_failed.remove(&page);- self.errors.remove(&page);- self.last_queue.clear();- if self.selection.is_some_and(|s| s.page == page) {- self.selection = None;+ Some(crate::fill_sign::FillAction::CreateSignature) => frame.out.open_signature = true,+ Some(crate::fill_sign::FillAction::CreateInitials) => frame.out.open_initials = true,+ Some(crate::fill_sign::FillAction::Refused(why)) => frame.out.refused = Some(why),+ None => {}}}-- /// Pages drawn last frame and their screen rectangles.- pub fn visible_page_rects(&self) -> Vec<(usize, Rect)> {- self.screen_xforms.iter().map(|(p, xf)| (*p, xf.rect)).collect()+ if matches!(tool, QuickTool::SignArea { .. }) {+ crate::sign_ui::page_input(ui, resp, &xf, ptr, i, info, view);}-- /// Where `page` is drawn this frame, with its coordinate mapping.- pub(crate) fn page_xform(&self, page: usize) -> Option<PageXform> {- self.screen_xforms.iter().find(|(p, _)| *p == page).map(|(_, xf)| *xf)+ if matches!(tool, QuickTool::MarqueeZoom | QuickTool::Snapshot) {+ crate::zoom_snap::page_input(ui, resp, &xf, ptr, i, view);}-- /// The text selection as markup quadrilaterals in user space: (page, quads).- pub(crate) fn selection_quads(&self, info: &DocInfo) -> Option<(usize, Vec<[f64; 8]>)> {- let s = self.selection?;- let text = self.texts.get(&s.page)?;- let page = info.pages.get(s.page)?;- let quads: Vec<[f64; 8]> = s.rects(text).into_iter().map(|r| page.view_rect_to_quad(r)).collect();- (!quads.is_empty()).then_some((s.page, quads))+ if tool == QuickTool::EnhanceCamera {+ crate::camera_ui::page_input(resp, &xf, ptr, i, view, can_modify);}-- /// A page's thumbnail texture, when rendered.- pub(crate) fn thumb_id(&self, page: usize) -> Option<egui::TextureId> {- self.thumbs.get(&page).map(|t| t.tex.id())+ if tool == QuickTool::Crop+ && crate::crop::page_input(ui, crate::crop::CropPageInput { resp, xf: &xf, ptr, page: i, info, view, allowed: can_crop })+ {+ view.current = i;+ frame.out.open_boxes = true;+ }+ let on_field = if preparing {+ let o = crate::prepare::page_input(cx, form, field_tool, prepare_allowed, view);+ frame.out.field_props |= o.properties;+ frame.out.field_placed |= o.placed;+ frame.out.open_table = frame.out.open_table.or(o.table);+ o.consumed || field_tool.is_some()+ } else {+ tool == QuickTool::Select && crate::forms_ui::page_input(cx, form, can_fill, view)+ };+ // Redact draws boxes off text; so does Highlight (an area highlight, as in Acrobat).+ let area_tool = tool == QuickTool::Redact && can_modify || tool == QuickTool::Comment(comments::CommentTool::Highlight) && allowed;+ let boxing = area_tool && {+ let text = view.page_text(i);+ let over_text = |p: Pos2| {+ let (vx, vy) = xf.screen_to_view(p);+ text.as_ref().is_some_and(|t| t.glyphs.iter().any(|g| vx >= g.rect[0] && vx <= g.rect[2] && vy >= g.rect[1] && vy <= g.rect[3]))+ };+ crate::redact_ui::page_input(cx, over_text, view)+ };+ let on_objects = tool == QuickTool::EditText && can_modify && crate::object_ui::page_input(cx, view);+ // Add text acts on the page's own paragraphs over them, and on the one its press was on until+ // the button is up: a drag that leaves the box still ends, and no new box takes it over.+ let over_source = tool == QuickTool::AddText+ && (matches!(view.router.owner(i), Some(crate::page_router::Owner::Paragraph { .. }))+ || pointer.is_some_and(|p| {+ !crate::content_ui::hits_added(&xf, info, i, added, p) && crate::edit_text_ui::over_paragraph(&xf, info, i, &lines, p)+ }));+ let source_blocked = over_source && view.content.hold_blocked();+ if over_source && resp.clicked() && !source_blocked {+ if let Some(edit) = view.content.finish_draft(added) {+ view.pending_edit = Some(edit);+ }+ view.content.selected = None;}-- /// The whole-page raster on screen for `page` (the low-res backdrop of a tiled page), if any.- pub(crate) fn page_raster(&self, page: usize) -> Option<egui::TextureId> {- self.pages.get(&page).map(|p| p.tex.id())+ let on_content = !on_objects && editing_content && can_modify && {+ source_blocked+ || crate::content_ui::page_input(+ cx,+ added,+ tool == QuickTool::AddText && !over_source,+ matches!(tool, QuickTool::AddText | QuickTool::EditText),+ text_style,+ view,+ )+ || tool == QuickTool::AddText && !over_source+ };+ // Added content owns its gesture; its source text must not queue a second edit.+ // Edit text & images boxes every paragraph and image whenever the tool is on. Only the+ // input waits while selected objects or added content own the pointer, or while page+ // input is blocked (another tab, a dialog, the window unfocused): the boxes stay drawn+ // instead of vanishing until the pointer comes back.+ let others_own_pointer = on_objects || on_content;+ let on_edit_text = (tool == QuickTool::EditText || over_source) && can_modify && {+ // Editable text takes precedence over background/overlapping artwork. Both+ // inventories are painted every frame, even when text owns the pointer.+ let text_used = crate::edit_text_ui::page_input(cx, &lines, view, !others_own_pointer);+ let image_cx = crate::edit_text_ui::ImageCx {+ ui,+ resp,+ xf: &xf,+ ptr,+ page: i,+ info,+ allow_interaction: !others_own_pointer && (matches!(view.router.owner(i), Some(crate::page_router::Owner::Picture { .. })) || !text_used),+ };+ let image_used = crate::edit_text_ui::image_input(&image_cx, &images, view, &mut frame.out.image_action);+ !others_own_pointer && (text_used || image_used)+ };+ let on_link = tool == QuickTool::Link && can_modify && crate::link_ui::page_input(cx, doc_links, view);+ if tool == QuickTool::Select+ && resp.secondary_clicked()+ && can_modify+ && let Some(p) = pointer.filter(|p| xf.rect.contains(*p))+ && let Some(l) = doc.links().iter().find(|l| l.page == i && crate::link_ui::screen_rect(&xf, info, i, l.rect).expand(2.0).contains(p))+ {+ view.links.context = Some((i, l.index));}-- /// The print preview's picture of `page`: the sheet raster when it has arrived, otherwise the- /// thumbnail.- pub(crate) fn page_preview(&self, page: usize) -> Option<egui::TextureId> {- self.print_pages.get(&page).map(|(_, tex)| tex.id()).or_else(|| self.thumb_id(page))+ let consumed = on_objects || on_edit_text || on_link || on_content || boxing || on_field || comments::page_input(ui, resp, &pcx, view);+ // The cursor and the tip from what lies under the pointer, after the tools claimed theirs (the+ // last claim on a layer stands).+ if frame.env.unobstructed+ && let Some(p) = pointer+ {+ for h in hits.at(view, p) {+ view.cursor.claim_with_tip(h.layer, h.icon, h.tip);+ }}+ PageInput { consumed, area_tool }+ }- pub(crate) fn page_text(&self, page: usize) -> Option<Arc<PageText>> {- self.texts.get(&page).cloned()- }+ /// Edit text's paragraphs and pictures on page `i`, kept while the document is unchanged.+ fn edit_inventory(+ view: &mut DocView,+ doc: &pdfcraft_engine::Document,+ i: usize,+ ) -> (Vec<pdfcraft_engine::TextBlock>, Vec<pdfcraft_engine::PageImage>) {+ let generation = doc.edit_generation();+ let lines = match view.edit_lines.get(&i) {+ Some((g, l)) if *g == generation => l.clone(),+ _ => {+ let l = doc.text_blocks(i);+ view.edit_lines.insert(i, (generation, l.clone()));+ l+ }+ };+ let images = match view.edit_images.get(&i) {+ Some((g, l)) if *g == generation => l.clone(),+ _ => {+ let l = doc.page_images(i);+ view.edit_images.insert(i, (generation, l.clone()));+ l+ }+ };+ (lines, images)+ }- pub(crate) fn clear_selection(&mut self) {- self.selection = None;- self.actions_dismissed = None;- }+ /// What the page modules have under a point on one page, for the page router.+ struct PageHits<'a> {+ page: usize,+ xf: &'a PageXform,+ info: &'a DocInfo,+ tool: QuickTool,+ pcx: &'a comments::PageCx<'a>,+ form: &'a [pdfcraft_engine::FormField],+ can_fill: bool,+ can_modify: bool,+ /// Edit a PDF is open: added text and pictures can be picked up.+ editing_content: bool,+ preparing: bool,+ field_tool: Option<crate::prepare::FieldTool>,+ /// Prepare may draw and move fields (not while a table is being set up).+ prepare_allowed: bool,+ added: &'a [pdfcraft_engine::Added],+ lines: &'a [pdfcraft_engine::TextBlock],+ images: &'a [pdfcraft_engine::PageImage],+ /// The pages' visible area (the picture's rotate knob stays inside it).+ clip: Rect,+ }- /// Select text on `page` from glyph `from` to glyph `to` (tests and automation).- pub fn select_text(&mut self, page: usize, from: usize, to: usize) {- self.selection = Some(Selection::run(page, from, to));+ impl PageHits<'_> {+ /// The hits at `p`, bottom up: links, comments; Edit text's pictures under its paragraphs (text+ /// on top of artwork takes the press), added content, the objects selected together and the+ /// open paragraph's frame, the selected picture's grips over them all; then form fields+ /// (Prepare's, being moved, over the comments; filled ones under added content and the+ /// comments that move).+ fn at(&self, view: &DocView, p: Pos2) -> Vec<crate::page_router::Hit> {+ let PageHits {+ page,+ xf,+ info,+ tool,+ pcx,+ form,+ can_fill,+ can_modify,+ editing_content,+ preparing,+ field_tool,+ prepare_allowed,+ added,+ lines,+ images,+ clip,+ } = *self;+ let fields = if preparing {+ crate::prepare::hit(xf, info, page, form, field_tool, prepare_allowed, &view.prepare, p)+ } else if tool == QuickTool::Select {+ crate::forms_ui::hit(xf, info, page, form, can_fill, p)+ } else {+ None+ };+ // With Add text, only the paragraphs and pictures not under added content.+ let editing =+ can_modify && (tool == QuickTool::EditText || tool == QuickTool::AddText && !crate::content_ui::hits_added(xf, info, page, added, p));+ let (pictures, paragraphs, objects, grips) = if editing {+ let open = view.line_editor.as_ref().filter(|e| e.page == page);+ let frame = open+ .filter(|e| !e.has_changes())+ .and_then(|e| lines.get(e.block))+ .map(|l| xf.user_rect(info, page, l.rect.map(|v| v as f32)).expand(2.0));+ // Add text acts on the page's paragraphs only in their boxes, edges included (it+ // finishes the box being typed there, `over_source`): not on pictures, nor beside a+ // paragraph, where a click starts a new box.+ let edit_text = tool == QuickTool::EditText;+ let on_paragraphs = edit_text || crate::edit_text_ui::over_paragraph(xf, info, page, lines, p);+ (+ edit_text.then(|| crate::edit_text_ui::picture_hit(xf, page, info, images, view, p)).flatten(),+ on_paragraphs.then(|| crate::edit_text_ui::hit(xf, info, page, lines, open.map(|e| e.block), p)).flatten(),+ edit_text.then(|| crate::object_ui::hit(view, xf, info, page, frame, p)).flatten(),+ edit_text.then(|| crate::edit_text_ui::picture_handle_hit(clip, xf, page, info, images, view, p)).flatten(),+ )+ } else {+ (None, None, None, None)+ };+ // Added text and pictures, over the page's own paragraphs and under the objects selected+ // together.+ let picks_up = matches!(tool, QuickTool::Select | QuickTool::AddText | QuickTool::EditText);+ let added = (editing_content && can_modify && picks_up).then(|| crate::content_ui::hit(xf, info, page, added, view, p)).flatten();+ [link_hit(info, xf, page, p), comments::hit(pcx, view, p), pictures, paragraphs, added, objects, grips, fields]+ .into_iter()+ .flatten()+ .collect()}+ }- /// Open the find bar (or focus it if already open).- pub fn open_find(&mut self) {- let f = self.find.get_or_insert_with(Find::default);- f.focus = true;+ /// Text layer: find matches, selection, I-beam and drag-to-select.+ fn text_layer(ui: &mut egui::Ui, view: &mut DocView, frame: &mut PageFrame<'_>, slot: &PageSlot, input: &PageInput) {+ let PageEnv { info, selects_text, tool, .. } = frame.env;+ let PageSlot { i, r, xf } = *slot;+ let PageFrame { resp, ptr, pointer, .. } = *frame;+ if let Some(text) = view.texts.get(&i).cloned() {+ paint_text_marks(ui, view, &text, i, xf, resp.dragged());+ if selects_text+ && !input.consumed+ && let Some(p) = pointer.filter(|p| r.contains(*p))+ {+ text_pointer_input(ui, view, &text, TextPointer { page: i, xf, rect: r, info, tool, resp, ptr: ptr.clone(), pointer: p });+ }}+ }- /// Re-run the search on all pages whose text is known (after the query changed).- pub fn rerun_find(&mut self) {- let Some(f) = self.find.as_mut() else { return };- f.case_query = f.query.clone();- f.matches.clear();- f.current = None;- if f.case_query.trim().is_empty() {- return;- }- let mut pages: Vec<usize> = self.texts.keys().copied().collect();- pages.sort();- for &p in &pages {- if let Some(text) = self.texts.get(&p) {- f.matches.extend(text.find_opts(&f.case_query, f.case_sensitive, f.whole_words).into_iter().map(|r| (p, r)));+ fn paint_text_marks(ui: &egui::Ui, view: &DocView, text: &PageText, page: usize, xf: PageXform, dragging: bool) {+ let painter = ui.painter();+ let to_screen = |g: [f32; 4]| xf.view_rect(g);+ if let Some(find) = &view.find {+ for (index, (match_page, range)) in find.matches.iter().enumerate() {+ if *match_page != page {+ continue;+ }+ let fill = if find.current == Some(index) {+ Color32::from_rgba_unmultiplied(255, 140, 0, 110)+ } else {+ Color32::from_rgba_unmultiplied(255, 214, 0, 90)+ };+ for line_rect in text.line_rects(range.clone()) {+ painter.rect_filled(to_screen(line_rect).expand(1.0), CornerRadius::same(2), fill);}}- f.matches.sort_by_key(|(p, r)| (*p, r.start));- if !f.matches.is_empty() {- // First match at or after the page being viewed.- let cur = self.current;- let i = f.matches.iter().position(|(p, _)| *p >= cur).unwrap_or(0);- f.current = Some(i);- let (p, _) = f.matches[i];- self.flash_match(p);+ }+ if view.all_text {+ for line_rect in text.line_rects(0..text.glyphs.len()) {+ painter.rect_filled(to_screen(line_rect), CornerRadius::same(1), Color32::from_rgba_unmultiplied(0x3A, 0x7B, 0xF0, 70));}}-- fn refresh_find_page(&mut self, page: usize) {- let (Some(f), Some(text)) = (self.find.as_mut(), self.texts.get(&page)) else { return };- if f.case_query.trim().is_empty() {- return;+ if let Some(selection) = view.selection.filter(|selection| selection.page == page) {+ for line_rect in selection.rects(text) {+ painter.rect_filled(to_screen(line_rect), CornerRadius::same(1), Color32::from_rgba_unmultiplied(0x3A, 0x7B, 0xF0, 70));}- let current_key = f.current.and_then(|c| f.matches.get(c).cloned());- f.matches.retain(|(p, _)| *p != page);- f.matches.extend(text.find_opts(&f.case_query, f.case_sensitive, f.whole_words).into_iter().map(|r| (page, r)));- f.matches.sort_by_key(|(p, r)| (*p, r.start));- f.current = current_key.as_ref().and_then(|k| f.matches.iter().position(|m| m == k));- if f.current.is_none() && !f.matches.is_empty() {- // First match at or after the page being viewed.- let cur = self.current;- let i = f.matches.iter().position(|(p, _)| *p >= cur).unwrap_or(0);- f.current = Some(i);- let (p, _) = f.matches[i];- if current_key.is_none() {- self.flash_match(p);- }+ if let Span::Column { rect } = selection.span+ && dragging+ {+ let outline = Stroke::new(1.0, Color32::from_rgb(0x3A, 0x7B, 0xF0));+ painter.rect_stroke(to_screen(rect), CornerRadius::ZERO, outline, egui::StrokeKind::Middle);}}+ }- /// Go to match `i` (the Search panel's results).- pub fn go_to_match(&mut self, i: usize) {- let Some(f) = self.find.as_mut() else { return };- let Some(&(p, _)) = f.matches.get(i) else { return };- f.current = Some(i);- self.go_to_page(p);- self.goto_point = None;- self.flash_match(p);- }+ struct TextPointer<'a> {+ page: usize,+ xf: PageXform,+ rect: Rect,+ info: &'a DocInfo,+ tool: QuickTool,+ resp: &'a egui::Response,+ ptr: PagePointer,+ pointer: Pos2,+ }- /// Move to the next/previous match.- pub fn find_step(&mut self, forward: bool) {- let Some(f) = self.find.as_mut() else { return };- if f.matches.is_empty() {- return;- }- let n = f.matches.len();- let c = f.current.unwrap_or(0);- let next = if forward { (c + 1) % n } else { (c + n - 1) % n };- f.current = Some(next);- let p = f.matches[next].0;- // Only explicit search navigation joins history; background refresh uses flash_match alone.- self.go_to_page(p);- self.goto_point = None;- self.flash_match(p);- }+ struct TextGesture<'a> {+ page: usize,+ xf: PageXform,+ rect: Rect,+ tool: QuickTool,+ ptr: PagePointer,+ resp: &'a egui::Response,+ pointer: Pos2,+ vx: f32,+ vy: f32,+ over_text: bool,+ over_link: bool,+ column: bool,+ }- fn flash_match(&mut self, page: usize) {- let frac = self- .find- .as_ref()- .and_then(|f| f.current.and_then(|c| f.matches.get(c)))- .and_then(|(p, r)| self.texts.get(p).and_then(|t| t.glyphs.get(r.start)).map(|g| g.rect[1]))- .zip(self.page_heights.get(page).copied())- .map(|(y, h)| ((y - 60.0) / h).clamp(0.0, 1.0))- .unwrap_or(0.0);- self.goto = Some((page, frac));- self.current = page;- self.reset_coarse_state();- }+ fn text_pointer_input(ui: &mut egui::Ui, view: &mut DocView, text: &PageText, pointer: TextPointer<'_>) {+ let TextPointer { page, xf, rect, info, tool, resp, ptr, pointer: screen_pointer } = pointer;+ let (vx, vy) = xf.screen_to_view(screen_pointer);+ let over_text = text.glyphs.iter().any(|glyph| vx >= glyph.rect[0] && vx <= glyph.rect[2] && vy >= glyph.rect[1] && vy <= glyph.rect[3]);+ let over_link = info.links.iter().any(|link| link.page == page && xf.user_rect(info, page, link.rect).contains(screen_pointer));+ let column = tool == QuickTool::ColumnSelect || ui.input(|input| input.modifiers.alt);+ let gesture = TextGesture { page, xf, rect, tool, ptr, resp, pointer: screen_pointer, vx, vy, over_text, over_link, column };+ update_text_cursor(view, &gesture);+ update_selection_on_press(ui, view, text, &gesture);+ update_dragged_selection(view, text, &gesture);+ finish_text_pointer_gesture(ui, view, text, &gesture);+ }- /// Screen position of the centre of glyph `glyph` on `page`, if that page is on screen and its- /// text layer is loaded (used by UI tests and automation to aim pointer input).- pub fn glyph_screen_pos(&self, page: usize, glyph: usize) -> Option<Pos2> {- let (_, xf) = self.screen_xforms.iter().find(|(p, _)| *p == page)?;- let g = self.texts.get(&page)?.glyphs.get(glyph)?;- Some(xf.view_rect(g.rect).center())+ fn update_text_cursor(view: &mut DocView, gesture: &TextGesture<'_>) {+ // A press on a link selects nothing (it is the link's), so no cursor here says it would.+ if gesture.column && !gesture.over_link {+ view.cursor.claim(Layer::Text, egui::CursorIcon::Crosshair);+ } else if gesture.over_text && !gesture.over_link {+ view.cursor.claim(Layer::Text, egui::CursorIcon::Text);}+ }- /// Selected text, if any (⌘C).- pub fn selected_text(&self) -> Option<String> {- let s = self.selection?;- let t = self.texts.get(&s.page)?;- Some(s.text(t)).filter(|x| !x.is_empty())+ fn update_selection_on_press(ui: &egui::Ui, view: &mut DocView, text: &PageText, gesture: &TextGesture<'_>) {+ // A press held by what keeps its drag (a link, a comment that moves) selects no text; one on+ // text markup lets its drag select the text underneath.+ let press_here = gesture.ptr.origin.is_some_and(|origin| gesture.rect.contains(origin));+ if gesture.ptr.pressed().is_some() && press_here && !view.router.keeps_drag() {+ let now = ui.input(|input| input.time);+ let (max_delay, max_dist) = ui.ctx().options(|options| (options.input_options.max_double_click_delay, options.input_options.max_click_dist));+ let consecutive = now - view.last_press_time <= max_delay && view.last_press_pos.is_some_and(|pos| pos.distance(gesture.pointer) <= max_dist);+ view.clicks = if consecutive { view.clicks.saturating_add(1) } else { 1 };+ view.last_press_time = now;+ view.last_press_pos = Some(gesture.pointer);+ let clicks = selection_click_count(view.clicks, gesture.tool);+ if clicks >= 2+ && gesture.over_text+ && let Some((first, last)) = text.nearest(gesture.vx, gesture.vy).and_then(|anchor| click_unit(text, clicks, anchor))+ {+ view.selection = Some(Selection::run(gesture.page, first, last));+ }}-- pub fn thumb(&self, page: usize) -> Option<&TextureHandle> {- self.thumbs.get(&page).map(|t| &t.tex)+ if gesture.resp.drag_started() && press_here && !view.router.keeps_drag() {+ view.actions_dismissed = None;+ view.selection_drag = true;+ let origin = gesture.ptr.origin.unwrap_or(gesture.pointer);+ let (ox, oy) = gesture.xf.screen_to_view(origin);+ if view.clicks < 2 {+ view.selection = if gesture.column {+ Some(Selection { page: gesture.page, span: Span::Column { rect: [ox, oy, gesture.vx, gesture.vy] } })+ } else {+ text.nearest(ox, oy).map(|anchor| Selection::run(gesture.page, anchor, anchor))+ };+ }}+ }- /// Drops wheel state after a discontinuous jump so the destination cannot- /// inherit momentum from the previous viewport.- fn reset_coarse_state(&mut self) {- self.wheel.clear_motion();- self.wheel_boost_x.reset();- self.wheel_boost_y.reset();- }+ fn selection_click_count(clicks: u32, tool: QuickTool) -> u32 {+ if clicks > 2 && tool != QuickTool::Select { 1 } else { clicks }+ }- pub fn go_to_page(&mut self, page: usize) {- let page = page.min(self.page_count.saturating_sub(1));- if page != self.current {- // The view history (Previous view / Next view).- if self.back.last() != Some(&self.current) {- self.back.push(self.current);- if self.back.len() > 200 {- self.back.remove(0);+ fn update_dragged_selection(view: &mut DocView, text: &PageText, gesture: &TextGesture<'_>) {+ let clicks = selection_click_count(view.clicks, gesture.tool);+ if gesture.resp.dragged()+ && let Some(selection) = view.selection.as_mut().filter(|selection| selection.page == gesture.page)+ {+ match &mut selection.span {+ Span::Run { anchor, head } if clicks >= 2 => {+ if let Some(hit) = text.nearest(gesture.vx, gesture.vy)+ && let Some((first, last)) = click_unit(text, clicks, *anchor)+ {+ let (to_first, to_last) = click_unit(text, clicks, hit).unwrap_or((hit, hit));+ (*anchor, *head) = if to_first < first { (last, to_first) } else { (first, to_last.max(last)) };}}- self.forward.clear();- }- // Partial wheel motion belongs to the old place.- self.reset_coarse_state();- self.goto = Some((page, 0.0));- self.current = page;- }-- /// Go to a destination, a bookmark's or a link's (ISO 32000-2 §12.3.2.2): its page, scrolled- /// and zoomed as `dest` asks, as Acrobat does. `/XYZ` puts (left, top) at the window's- /// top-left at its zoom (null or 0 keeps the zoom); `/Fit`, `/FitH` and `/FitV` switch to fit- /// page, width and height with `top` or `left` at the window's edge; `/FitR` zooms so the- /// rectangle fits, centred. The `B` (content box) forms are read as the page. A null- /// coordinate keeps that scroll position (null `top` on a new page: its top), and a point- /// past the end of the document scrolls as far as it can.- pub fn go_to_dest(&mut self, page: usize, dest: DestView, info: &DocInfo) {- self.go_to_page(page);- let page = self.current;- self.goto_point = None;- let Some(p) = info.pages.get(page) else { return };- let point = |x: Option<f32>, y: Option<f32>| p.dest_fraction(x, y, self.rotation);- // The window's top-left as far as pages go: its left edge is the gutter that keeps them- // clear of the floating quick-action bar, so `left` 0 shows the page's edge beside it.- let corner = vec2(SIDE, 0.0);- let (fx, fy, rel) = match dest {- DestView::Top => return,- DestView::Xyz { left, top, zoom } => {- if let Some(z) = zoom {- self.zoom = z.clamp(0.08, 64.0);- self.fit = Fit::None;- self.zoom_anchor = None;+ Span::Run { head, .. } => {+ if let Some(hit) = text.nearest(gesture.vx, gesture.vy) {+ *head = hit;}- let [fx, fy] = point(left, top);- (fx, fy, corner)- }- DestView::Fit => {- self.fit = Fit::Page;- return;- }- DestView::FitH { top } => {- self.fit = Fit::Width;- let [fx, fy] = point(None, top);- (fx, fy, corner)- }- DestView::FitV { left } => {- self.fit = Fit::Height;- let [fx, fy] = point(left, None);- (fx, fy, corner)}- DestView::FitR { rect } => {- let ([Some(ax), Some(ay)], [Some(bx), Some(by)]) = (point(Some(rect[0]), Some(rect[3])), point(Some(rect[2]), Some(rect[1]))) else {- return;- };- // The rectangle as displayed, in points (it can be turned a quarter).- let (dw, dh) = self.display_size(p);- let (w, h) = ((ax - bx).abs() * dw, (ay - by).abs() * dh);- if w >= 1.0 && h >= 1.0 && self.viewport_w >= 1.0 && self.viewport_h >= 1.0 {- self.zoom = (self.viewport_w / (w * PT)).min(self.viewport_h / (h * PT)).clamp(0.08, 64.0);- self.fit = Fit::None;- self.zoom_anchor = None;- }- (Some((ax + bx) / 2.0), Some((ay + by) / 2.0), vec2(self.viewport_w, self.viewport_h) / 2.0)+ Span::Column { rect } => {+ rect[2] = gesture.vx;+ rect[3] = gesture.vy;}- };- if fx.is_some() || fy.is_some() {- self.goto_point = Some((page, fx, fy, rel));}}-- /// Next page (`true`) or previous page. In two-page view this moves a whole spread: the other- /// page of the spread is already on screen, so stepping to it wouldn't move the view (#70).- pub fn step_page(&mut self, forward: bool) {- let c = self.current;- let last = self.page_count.saturating_sub(1);- let (target, first) = match self.layout {- PageLayout::TwoUp => {- // Spreads are [0, 1], [2, 3], … or, with a cover page, [0], [1, 2], [3, 4], ….- let first = if self.cover { c.saturating_sub((c + 1) % 2) } else { c - c % 2 };- let target = match (forward, self.cover && c == 0) {- (true, true) => 1,- (true, false) => first.saturating_add(2),- (false, _) if self.cover && first <= 1 => 0,- (false, _) => first.saturating_sub(2),- };- (target, first)- }- PageLayout::Single if forward => (c + 1, c),- PageLayout::Single => (c.saturating_sub(1), c),- };- // Past either end there is nowhere to go: stay put rather than re-align the view, which- // would scroll the page back to its top.- if if forward { target > last } else { first == 0 } {- return;- }- self.go_to_page(target);- }-- /// Page-editor focus and drafts belong to a document, even while another tab is active.- pub(crate) fn page_input_id(&self) -> egui::Id {- egui::Id::new(("page-input", self.id.0))- }-- /// The idle page box and unchanged-input lookup share the same label fallback.- pub(crate) fn current_page_label(&self, label: Option<&str>) -> String {- label.filter(|l| !l.is_empty()).map(str::to_owned).unwrap_or_else(|| (self.current + 1).to_string())- }-- /// Retain the current page when `typed` exactly matches its displayed label, even if- /// another page has that label. Otherwise resolve a trimmed label (case-insensitive),- /// then a physical page number. `false` when it names no page.- pub fn go_to_typed(&mut self, typed: &str, labels: &[String]) -> bool {- // Compare the displayed value before trimming: a label may itself contain spaces.- // Repeated labels occur in restarted sections and prefix-only ranges.- if self.current < self.page_count && self.current_page_label(labels.get(self.current).map(String::as_str)) == typed {- return true;- }- let t = typed.trim();- let page = labels- .iter()- .position(|l| !l.is_empty() && l.eq_ignore_ascii_case(t))- .or_else(|| t.parse::<usize>().ok().filter(|n| *n >= 1).map(|n| n - 1));- match page {- Some(p) if p < self.page_count => {- self.go_to_page(p);- true- }- _ => false,- }- }-- /// View ▸ Page navigation ▸ Previous view (`false`) / Next view (`true`).- pub fn view_history(&mut self, forward: bool) -> bool {- let (from, to) = if forward { (&mut self.forward, &mut self.back) } else { (&mut self.back, &mut self.forward) };- let Some(page) = from.pop() else { return false };- to.push(self.current);- let page = page.min(self.page_count.saturating_sub(1));- self.goto = Some((page, 0.0));- self.current = page;- self.reset_coarse_state();- true+ if gesture.resp.drag_stopped()+ && view.selection.is_some_and(|selection| {+ selection.page == gesture.page && matches!(selection.span, Span::Column { .. }) && selection.text(text).is_empty()+ })+ {+ view.selection = None;}+ }- /// Select all: every page in Organize, or every word on the current page.- pub fn select_all(&mut self) -> bool {- if self.organize {- self.selected = (0..self.page_count).collect();- // Keep the current page as the anchor for the next Shift-click.- self.select_anchor = (self.page_count > 0).then_some(self.current);- return !self.selected.is_empty();- }- let page = self.current;- let Some(t) = self.texts.get(&page) else { return false };- if t.glyphs.is_empty() {- return false;+ fn finish_text_pointer_gesture(ui: &egui::Ui, view: &mut DocView, text: &PageText, gesture: &TextGesture<'_>) {+ let release_clicks = if gesture.resp.triple_clicked() {+ view.clicks.max(2).saturating_add(1)+ } else if gesture.resp.double_clicked() {+ view.clicks.max(2)+ } else {+ 0+ };+ if release_clicks > 0 {+ view.clicks = release_clicks;+ }+ let clicks = selection_click_count(view.clicks, gesture.tool);+ if release_clicks > 0+ && clicks >= 2+ && gesture.over_text+ && view.selection.is_none()+ && let Some((first, last)) = text.nearest(gesture.vx, gesture.vy).and_then(|anchor| click_unit(text, clicks, anchor))+ {+ view.selection = Some(Selection::run(gesture.page, first, last));+ } else if gesture.resp.clicked() && view.clicks < 2 && !view.router.keeps_drag() {+ let shift = ui.input(|input| input.modifiers.shift);+ match (+ view.selection.as_mut().filter(|selection| shift && selection.page == gesture.page).map(|selection| &mut selection.span),+ text.nearest(gesture.vx, gesture.vy),+ ) {+ (Some(Span::Run { head, .. }), Some(hit)) => *head = hit,+ _ => view.selection = None,}- self.selection = Some(Selection::run(page, 0, t.glyphs.len() - 1));- true}+ }- /// Rotate the view 90° clockwise or counter-clockwise (View ▸ Rotate View, ⇧⌘+ / ⇧⌘−).- pub fn rotate_view(&mut self, clockwise: bool) {- self.rotation = (self.rotation + if clockwise { 90 } else { 270 }) % 360;- self.goto = Some((self.current, 0.0));- self.reset_coarse_state();+ /// Everything drawn over the page after its text: pictures, comments, content, links, fields, marks+ /// and badges.+ fn page_overlays(ui: &mut egui::Ui, view: &mut DocView, frame: &mut PageFrame<'_>, slot: &PageSlot, input: &PageInput) {+ let PageEnv {+ added,+ allowed,+ calc_order,+ can_modify,+ comments_hidden,+ doc,+ doc_links,+ editing_content,+ form,+ generation,+ info,+ prefs,+ preparing,+ redact_mark,+ table_preview,+ tool,+ unobstructed,+ ..+ } = frame.env;+ let PageSlot { i, xf, .. } = *slot;+ let PageFrame { resp, ptr, pointer, .. } = *frame;+ let painter = ui.painter();+ let tool_cx = PageToolContext { ui, resp, xf: &xf, ptr, page: i, doc, info };+ let pcx = comments::PageCx { page: i, xf: &xf, ptr, info, tool, prefs, allowed, hidden: comments_hidden, redact_mark };+ if tool == QuickTool::Select && !input.consumed {+ crate::image_pick::page_input(resp, &xf, i, info, doc, pointer, view);+ }+ crate::image_pick::drop_stale(doc, view);+ crate::image_pick::paint(painter, &xf, i, info, view);+ // A cancelled press ends no selection: no markup or redaction is made from it.+ if !view.press_cancelled {+ comments::page_after_text(resp, &pcx, view);+ if tool == QuickTool::Redact && can_modify {+ crate::redact_ui::after_text(resp, i, info, view);+ }+ }+ if input.area_tool {+ crate::redact_ui::paint(painter, i, view, pointer);+ }+ comments::paint_page(ui, painter, &pcx, view);+ if editing_content {+ crate::content_ui::paint_page(painter, &xf, i, info, added, view, pointer);}-- /// Switch the zoom mode, keeping the current page in view.- pub fn set_fit(&mut self, fit: Fit) {- self.fit = fit;- self.goto = Some((self.current, 0.0));- self.reset_coarse_state();+ if tool == QuickTool::EditText {+ crate::object_ui::paint(painter, &xf, i, info, &view.objects);}-- /// Switch the base page display (Single or Two-page), leaving continuous scrolling as it is.- /// A no-op when the layout is already current, so re-selecting it never yanks a scrolled view- /// back to the top.- pub fn set_layout(&mut self, layout: PageLayout) {- if self.layout == layout {- return;- }- self.layout = layout;- self.goto = Some((self.current, 0.0));- self.reset_coarse_state();+ if tool == QuickTool::EnhanceCamera {+ crate::camera_ui::paint(painter, &xf, i, view);}-- /// Whether the view scrolls continuously (as opposed to one page or spread at a time).- pub fn continuous(&self) -> bool {- self.continuous+ if tool == QuickTool::Link {+ crate::link_ui::paint(painter, &xf, i, info, doc_links, view, pointer);}-- /// Turn continuous scrolling on or off, keeping the current page in view. A no-op when it is- /// already in that state.- pub fn set_continuous(&mut self, continuous: bool) {- if self.continuous != continuous {- self.continuous = continuous;- self.goto = Some((self.current, 0.0));- self.reset_coarse_state();+ if preparing {+ crate::prepare::paint_page(tool_cx, form, view);+ if let Some(preview) = &table_preview {+ crate::field_table_ui::paint_preview(painter, &xf, i, preview);}- }-- /// Set the whole page display at once (the base layout and continuous scrolling together),- /// as the control channel and settings do through a single [`display_token`].- pub fn set_display(&mut self, layout: PageLayout, continuous: bool) {- self.set_layout(layout);- self.set_continuous(continuous);- }-- /// Set the cover page in two-page view. A no-op unless something changed.- pub fn set_cover(&mut self, cover: bool) {- if self.cover != cover {- self.cover = cover;- self.goto = Some((self.current, 0.0));- self.reset_coarse_state();+ if calc_order {+ let selected = view.prepare.selected.as_ref().map(|(name, _)| name.as_str());+ if let Some(field) = crate::calc_order_ui::paint_page(tool_cx, form, &view.calc_order, generation, selected) {+ frame.calc_hover = Some(field);+ }}+ } else {+ crate::forms_ui::paint_page(painter, &xf, i, info, form, view, pointer);+ }++ // Form-field highlight (Acrobat's "Highlight existing fields"); required fields get a+ // red border. Radio buttons and round XFA check boxes are round, and so is theirs (as+ // in Acrobat). Only what can be filled is marked: a read-only widget (its field's, or a+ // radio button's own) is left as it is drawn.+ paint_field_highlights(painter, &xf, info, form.as_slice(), i, view.highlight_fields);+ // Links: the hand and the link's target, which count only for the tools that follow or+ // edit links (`Layer::reached_by`). Tips draw above the palette, so none shows while it is+ // open, even beside it. A click follows the link its press was on, released over it: one that+ // slips off the link first follows nothing, as a button's does.+ if unobstructed+ && resp.clicked()+ && tool == QuickTool::Select+ && !input.consumed+ && let Some(owner @ crate::page_router::Owner::Link { index }) = view.router.owner(i)+ && pointer.and_then(|p| link_hit(info, &xf, i, p)).is_some_and(|h| h.owner == owner)+ && let Some(l) = info.links.get(index)+ {+ frame.out.clicked_link = Some(l.target.clone());}-- /// Whether the cover page setting applies: only two-page view has a cover page.- pub fn cover_applies(&self) -> bool {- self.layout == PageLayout::TwoUp- }-- /// One wheel event in a non-continuous view, where the wheel turns pages or spreads (the- /// rules are in `wheel_pager`): `dy` is its vertical delta (negative scrolls down) and `now`- /// is egui time. With `can_turn` false the gesture is followed but the page stays. Returns- /// whether the page turned.- pub fn single_page_wheel(&mut self, unit: egui::MouseWheelUnit, dy: f32, phase: egui::TouchPhase, now: f64, can_turn: bool) -> bool {- if self.continuous {- return false;+ // Comments say what they are with any tool, beside its cursor, as Acrobat's do.+ comments::describe(&pcx, view);+ for (mp, mr, mc) in &view.compare_marks {+ if *mp == i {+ let sr = xf.user_rect(info, i, *mr).expand(1.5);+ painter.rect_filled(sr, CornerRadius::same(2), mc.gamma_multiply(0.28));}- let Some(forward) = self.wheel.feed(unit, dy, phase, now, can_turn) else { return false };- let before = self.current;- self.step_page(forward);- self.current != before}-- /// One wheel event in a non-continuous view whose page is taller than the window, where the- /// wheel pans (#1924). Once the view is at the bottom (top) edge, scrolling on turns to the- /// next (previous) page, which shows its top (bottom). A smooth gesture that panned the page- /// has to end first (see `WheelPager::feed_edge`). `can_turn` is false when something else- /// owns the wheel. Returns whether the page turned.- pub fn single_page_wheel_edge(&mut self, unit: egui::MouseWheelUnit, dy: f32, phase: egui::TouchPhase, now: f64, can_turn: bool) -> bool {- if self.continuous {- return false;- }- // Only an up-to-date view counts: the page drawn is the shown one, with no jump pending.- let edge = self.goto.is_none()- && self.goto_point.is_none()- && self.single_edges.is_some_and(|(page, top, bottom)| page == self.current && if dy < 0.0 { bottom } else { top });- let Some(forward) = self.wheel.feed_edge(unit, dy, phase, now, can_turn && edge) else { return false };- let before = self.current;- self.step_page(forward);- if self.current == before {- return false;- }- if !forward {- // Going back lands on the bottom of the previous page.- self.goto = Some((self.current, 1.0));+ if let Some((fp, fr, t0)) = view.flash+ && fp == i+ {+ let now = ui.input(|inp| inp.time);+ let t0 = if t0 == 0.0 { now } else { t0 };+ view.flash = Some((fp, fr, t0));+ let age = (now - t0) as f32;+ if age < 1.6 {+ let a = ((1.6 - age) / 1.6 * 255.0) as u8;+ let sr = xf.user_rect(info, i, fr).expand(4.0);+ painter.rect_stroke(+ sr,+ CornerRadius::same(3),+ Stroke::new(2.5, Color32::from_rgba_unmultiplied(0x1B, 0x63, 0xE0, a)),+ egui::StrokeKind::Outside,+ );+ ui.ctx().request_repaint();+ } else {+ view.flash = None;+ }+ }+ // Validation is viewer chrome over the signer's original artwork, which+ // may still say "Signature Not Verified". These badges never enter document+ // streams, image/text exports, vector printing or Print as Image.+ for badge in signature_badges(&doc.signatures, i) {+ let [x0, y0, x1, y1] = badge.rect;+ let sr = xf.user_rect(info, i, [x0 as f32, y0 as f32, x1 as f32, y1 as f32]);+ let (icon, color) = crate::sign_ui::signature_status_style(badge.status);+ painter.rect_stroke(sr, CornerRadius::same(2), Stroke::new(1.5, color), egui::StrokeKind::Outside);+ // A widget too small for the mark keeps its outline: the verdict still shows.+ if sr.width() < 4.0 || sr.height() < 4.0 {+ continue;+ }+ // Big enough to read at a glance, small enough to leave the signer's own+ // text visible around it.+ let side = (sr.width().min(sr.height()) * 0.8).clamp(24.0, 192.0);+ let mark = Rect::from_center_size(sr.center(), vec2(side, side));+ icons::paint(ui, mark, icon, side * 0.64, color);+ // Overlapping widgets paint in order, so the topmost badge's verdict is the tip, with+ // any tool; a link's or a comment's tip wins over any badge.+ if pointer.is_some_and(|p| mark.expand(2.0).contains(p)) {+ view.cursor.describe(Subject::SignatureBadge, badge.summary.to_string());}- self.single_edges = None;- true- }-- /// Displayed page size in points for this view rotation.- fn display_size(&self, p: &pdfcraft_render::PageInfo) -> (f32, f32) {- if self.rotation % 180 == 90 { (p.height, p.width) } else { (p.width, p.height) }- }-- /// Marquee Zoom: zoom so `r` (on screen) fills the window, centred.- pub fn zoom_to_rect(&mut self, r: Rect) {- let Some((page, pr)) = self.screen_rects.iter().find(|(_, pr)| pr.contains(r.center())).copied() else { return };- let k = (self.viewport_screen.width() / r.width().max(1.0)).min(self.viewport_screen.height() / r.height().max(1.0));- let f = (r.center() - pr.min) / pr.size();- self.zoom = (self.zoom * k).clamp(0.08, 64.0);- self.fit = Fit::None;- self.zoom_anchor = Some((page, f.x.clamp(0.0, 1.0), f.y.clamp(0.0, 1.0), self.viewport_screen.center() - self.viewport_screen.min));- }-- /// View ▸ Zoom ▸ Fit Visible: zoom so the visible content of `page` (display-normalised- /// [x0, y0, x1, y1], i.e. after view rotation) spans the window's width, its left edge at- /// the window's left and its top at the top.- pub fn fit_content(&mut self, page: usize, content: [f32; 4]) -> bool {- const PAD: f32 = 16.0;- let Some((_, pr)) = self.screen_rects.iter().find(|(p, _)| *p == page).copied() else { return false };- let w = (content[2] - content[0]).max(0.01) * pr.width();- let k = (self.viewport_screen.width() - 2.0 * PAD).max(50.0) / w.max(1.0);- self.zoom = (self.zoom * k).clamp(0.08, 64.0);- self.fit = Fit::None;- self.zoom_anchor = Some((page, content[0].clamp(0.0, 1.0), content[1].clamp(0.0, 1.0), vec2(PAD, MARGIN)));- true}+ }- /// How large the page grid draws its pages (1.0 = the usual thumbnails).- pub fn grid_zoom(&self) -> f32 {- self.grid_zoom+ fn paint_field_highlights(painter: &egui::Painter, xf: &PageXform, info: &DocInfo, form: &[pdfcraft_engine::FormField], page: usize, enabled: bool) {+ if !enabled {+ return;}-- /// Zoom the page grid; out-of-range values are clamped and nonsense is ignored.- pub fn set_grid_zoom(&mut self, zoom: f32) {- if zoom.is_finite() {- self.grid_zoom = zoom.clamp(*GRID_ZOOM_RANGE.start(), *GRID_ZOOM_RANGE.end());+ for field in form.iter() {+ let required = field.has(pdfcraft_engine::field_flags::REQUIRED);+ for widget in field.widgets.iter().filter(|widget| widget.page == Some(page) && !widget.hidden && !widget.read_only) {+ let rect = widget.rect;+ let screen_rect = xf.user_rect(info, page, [rect[0] as f32, rect[1] as f32, rect[2] as f32, rect[3] as f32]);+ let tint = Color32::from_rgba_unmultiplied(0x6E, 0x8E, 0xF5, 48);+ let (width, color) = if required { (2.0, Color32::from_rgb(0xE3, 0x22, 0x22)) } else { (1.0, Color32::from_rgb(0x6E, 0x8E, 0xF5)) };+ if widget.round {+ let radius = screen_rect.width().min(screen_rect.height()) / 2.0;+ painter.circle_filled(screen_rect.center(), radius, tint);+ painter.circle_stroke(screen_rect.center(), radius - width / 2.0, Stroke::new(width, color));+ } else {+ painter.rect_filled(screen_rect, CornerRadius::same(1), tint);+ painter.rect_stroke(screen_rect, CornerRadius::same(1), Stroke::new(width, color), egui::StrokeKind::Inside);+ }}}+ }- /// How many device pixels wide the grid's sharp render of `page` is, if it has one.- pub fn grid_page_pixels(&self, page: usize) -> Option<u32> {- self.grid_pages.get(&page).map(|(w, _)| *w)- }-- /// Zoom keeping the centre of the view still.- pub fn set_zoom(&mut self, zoom: f32) {- // CLI/view options can set zoom before the first layout. Rect::NOTHING has no- // finite centre yet, but an initial zoom still needs to leave the default fit mode.- let centre = if self.viewport_screen.is_positive() { self.viewport_screen.center() } else { Pos2::ZERO };- self.zoom_at(zoom, centre);- }-- /// Zoom keeping the document point under `screen_pos` still (pinch, ⌘-scroll).- pub fn zoom_at(&mut self, zoom: f32, screen_pos: Pos2) {- if !zoom.is_finite() || !screen_pos.is_finite() {- return;- }- let zoom = zoom.clamp(0.08, 64.0);- if zoom == self.zoom && self.fit == Fit::None {- return;- }- // In gutters/gaps, anchor relative to the nearest page rather than jumping to its top.- // Fractions outside 0..1 preserve the pointer's position outside the page as well.- let anchor =- self.screen_rects.iter().min_by(|(_, a), (_, b)| a.distance_sq_to_pos(screen_pos).total_cmp(&b.distance_sq_to_pos(screen_pos))).map(- |(p, r)| {- let f = (screen_pos - r.min) / r.size();- (*p, f.x, f.y, screen_pos - self.viewport_screen.min)- },- );- self.zoom = zoom;- self.fit = Fit::None;- match anchor {- Some(a) => self.zoom_anchor = Some(a),- // Nothing on screen yet (e.g. a launch option): align the current page instead.- None => self.goto = Some((self.current, 0.0)),- }+ fn draw_page(ui: &mut egui::Ui, view: &mut DocView, frame: &mut PageFrame<'_>, i: usize) {+ let PageEnv { allowed, comments_hidden, doc, editing_content, info, ppp, prefs, rects, redact_mark, scale, t, tool, .. } = frame.env;+ let PageFrame { ptr, origin, visible, pressed, pointer, .. } = *frame;+ let r = snap_to_pixels(rects[i].translate(origin.to_vec2()), ppp);+ if !r.intersects(visible.expand(400.0)) {+ return;}+ if pressed && frame.pressed_page.is_none() && pointer.is_some_and(|p| r.contains(p)) {+ frame.pressed_page = Some(i);+ }+ if r.intersects(visible) {+ frame.visible_now.push(i);+ view.screen_rects.push((i, r));+ view.screen_xforms.push((i, PageXform { rect: r, rot: view.rotation, pw: info.pages[i].width.max(1.0), ph: info.pages[i].height.max(1.0) }));+ }+ let overlap = r.intersect(visible).height();+ if i == view.current {+ frame.current_overlap = overlap;+ frame.current_height = r.height();+ }+ // Pages shown equally (two rows wholly on screen) differ only by rounding: the+ // topmost one counts.+ if overlap > frame.best_overlap + PAGE_TIE {+ frame.best_overlap = overlap;+ frame.current = i;+ }+ let xf = PageXform { rect: r, rot: view.rotation, pw: info.pages[i].width.max(1.0), ph: info.pages[i].height.max(1.0) };+ paint_page_surface(ui, view, frame, &PageSlot { i, r, xf });+ let painter = ui.painter();+ view.text_background.paint(painter, &xf, i, view.line_editor.as_ref(), view.content.draft.as_ref());+ if editing_content {+ view.move_background.paint(painter, &xf, i, info, &view.content, pointer);+ }+ if view.show_page_gaps {+ painter.rect_stroke(r, CornerRadius::ZERO, Stroke::new(0.5, t.border.gamma_multiply(0.8)), egui::StrokeKind::Outside);+ }++ let slot = PageSlot { i, r, xf };+ // A cancelled press takes nothing until the button is up.+ let input = if view.press_cancelled { PageInput { consumed: true, area_tool: false } } else { page_tool_input(ui, view, frame, &slot) };+ let painter = ui.painter();+ let pcx = comments::PageCx { page: i, xf: &xf, ptr, info, tool, prefs, allowed, hidden: comments_hidden, redact_mark };+ let preview_target = (matches!(tool, QuickTool::Select | QuickTool::Fill(_)) && !comments_hidden).then_some(view.comments.selected).flatten();+ view.signature_drag.prepare(ui.ctx(), doc, preview_target, scale);+ view.signature_drag.paint(painter, &pcx, &view.comments, view.pending_edit.as_ref());+ // Any other comment being moved: drawn where it goes, over the page that still shows it+ // where it was.+ let stale = view.signature_drag.moving_page().is_some_and(|p| view.page_out_of_date(p));+ view.signature_drag.prepare_move(ui.ctx(), doc, &view.comments, view.pending_edit.as_ref(), stale, scale);+ view.signature_drag.paint_move(painter, &pcx, &view.comments, view.pending_edit.as_ref());++ // Any press on the page ends Select All of the document: text read or not, any tool,+ // on a link too.+ // A press that lands on something drawn over the page (a menu, a dialog) is not one.+ if view.all_text && frame.pressed_page == Some(i) {+ view.all_text = false;+ }+ text_layer(ui, view, frame, &slot, &input);+ page_overlays(ui, view, frame, &slot, &input);+ }- /// A zoom typed as a percentage ("150", "150%", " 62.5 % ") as a zoom factor; `None` unless it is a- /// finite, positive number. `set_zoom` clamps it to the supported range.- pub fn parse_zoom_percent(typed: &str) -> Option<f32> {- let percent = typed.trim().trim_end_matches('%').trim_end().parse::<f32>().ok()?;- (percent.is_finite() && percent > 0.0).then_some(percent / 100.0)- }+ /// The link under `p` on `page`: the hand, and where a click goes. Only the Select tool follows+ /// links and the Link tool edits them (`Layer::reached_by`).+ fn link_hit(info: &DocInfo, xf: &PageXform, page: usize, p: Pos2) -> Option<crate::page_router::Hit> {+ let (index, l) = info.links.iter().enumerate().rfind(|(_, l)| l.page == page && xf.user_rect(info, page, l.rect).contains(p))?;+ let label = match &l.target {+ LinkTarget::Page(n, _) => crate::i18n::fmt(tl!("Go to page {p}"), &[("p", info.pages.get(*n).map(|p| p.label.as_str()).unwrap_or("?"))]),+ LinkTarget::Uri(u) => u.clone(),+ LinkTarget::SetLayers { .. } => tl!("Set layer visibility").to_string(),+ LinkTarget::RemoteGoTo { file, .. } => file.clone(),+ LinkTarget::Other(s) => crate::i18n::fmt(tl!("{s} action"), &[("s", s)]),+ };+ let owner = crate::page_router::Owner::Link { index };+ Some(crate::page_router::Hit { tip: Some(label), ..crate::page_router::Hit::new(owner, Layer::Link, egui::CursorIcon::PointingHand) })+ }- /// Standard zoom steps (as in Acrobat's zoom menu).- pub fn zoom_step(&mut self, up: bool) {- const STEPS: [f32; 17] = [0.1, 0.25, 0.33, 0.5, 0.66, 0.75, 1.0, 1.25, 1.5, 2.0, 3.0, 4.0, 6.0, 8.0, 12.0, 16.0, 32.0];- let z = self.zoom;- let next = if up { STEPS.iter().copied().find(|s| *s > z * 1.01) } else { STEPS.iter().rev().copied().find(|s| *s < z * 0.99) };- if let Some(n) = next {- self.set_zoom(n);+ /// Escape while the pages hold a press abandons the gesture it drives, whichever tool's: nothing is+ /// placed, drawn, moved, resized or opened, and the press is ignored until the button is up. The+ /// frame of the release still belongs to the cancelled press.+ fn cancel_on_escape(ctx: &egui::Context, view: &mut DocView, ptr: &PagePointer) {+ // Over once the button is up and its release seen, or when a new press comes (its release and+ // the next press can share a frame).+ let new_press = matches!(ptr.edges.last(), Some(crate::page_pointer::Edge::Press(_)));+ if view.press_cancelled && (new_press || !ptr.any_down && ptr.edges.is_empty()) {+ view.press_cancelled = false;+ }+ if !view.press_cancelled && ptr.origin.is_some() && ptr.primary_down && ctx.input_mut(|i| i.consume_key(egui::Modifiers::NONE, egui::Key::Escape))+ {+ // A text selection being dragged goes with its drag: the markup, redaction or Replace+ // Text that its end would make is not made.+ if view.selection_drag {+ view.clear_selection();}+ view.cancel_pointer_gestures();+ view.press_cancelled = true;}+ }- /// Start collecting demand from every consumer before scheduling or uploading results.- pub(crate) fn begin_render_frame(&mut self) {- self.frame_geometry_changed = false;- self.pages_panel = None;- self.panel_gap = None;- self.thumb_demand.clear();- self.frame_queue.clear();- self.frame_visible.clear();- }-- pub(crate) fn need_thumbnail(&mut self, page: usize, visible: bool) {- if page >= self.page_count {- return;- }- if let Some(priority) = self.thumb_demand.get_mut(&page) {- *priority |= visible;- } else if self.thumb_demand.len() < MAX_THUMB_DEMAND {- self.thumb_demand.insert(page, visible);- } else if visible && let Some(prefetch) = self.thumb_demand.iter().find_map(|(&p, &v)| (!v).then_some(p)) {- self.thumb_demand.remove(&prefetch);- self.thumb_demand.insert(page, true);+ fn draw_pages(+ ui: &mut egui::Ui,+ viewport: Rect,+ view: &mut DocView,+ env: &PageEnv<'_>,+ out: &mut PageOut,+ signature_preview: &mut Option<(crate::fill_sign::SavedSig, egui::TextureHandle)>,+ ) -> PageRenders {+ let PageEnv {+ allowed,+ auto_delta,+ avail,+ boost_extra,+ calc_order,+ can_copy,+ can_modify,+ content_h,+ content_w,+ doc,+ edge_delta,+ form,+ generation,+ glide,+ hand,+ info,+ key_scroll,+ middle_gesture,+ modal,+ navigation_enabled,+ precise_scroll,+ prefs,+ preparing,+ selection_wheel,+ single_paging,+ tool,+ unobstructed,+ visible_pages,+ y_shift,+ ..+ } = *env;+ // egui's drag responses accept every pointer button. Keep a wheel gesture from also+ // selecting text, drawing a mark, or panning with the Hand tool.+ if middle_gesture {+ let opacity = ui.opacity();+ ui.disable();+ // Only interactions pause; the document must keep its original colours.+ ui.set_opacity(opacity);+ }+ // Middle-button auto-scroll, the keyboard, precise touchpad input (#759) and its glide+ // (#531), accelerated wheel surplus (#1072), and a drawing's edge scroll; positive y+ // moves the content down. All scroll without easing, unlike egui's wheel default.+ // ScrollArea ignores wheel input during a widget drag. Defer the wheel contribution+ // until after the text widgets when a selection owns that drag.+ let wheel_delta = if selection_wheel { Vec2::ZERO } else { precise_scroll + boost_extra };+ let delta = auto_delta + edge_delta - vec2(0.0, key_scroll) + wheel_delta + glide;+ if delta != Vec2::ZERO && delta.is_finite() {+ ui.scroll_with_delta_animation(delta, egui::style::ScrollAnimation::none());+ }+ let (resp_rect, resp) = ui.allocate_exact_size(vec2(content_w, content_h), Sense::click_and_drag());+ view.page_widget = Some(resp.id);+ // A drag lasts only while egui reports it, so the mark can't outlive one.+ if !resp.dragged_by(egui::PointerButton::Primary) {+ view.selection_drag = false;+ }+ // The Hand tool pans by this widget's drag, before the pages are laid out (above).+ if hand {+ if resp.dragged() {+ view.cursor.claim(Layer::Drag, egui::CursorIcon::Grabbing);+ } else if resp.hovered() {+ view.cursor.claim(Layer::ToolArea, egui::CursorIcon::Grab);+ }+ }+ let origin = resp_rect.min - vec2(0.0, y_shift);+ let visible = viewport.translate(resp_rect.min.to_vec2());+ view.screen_rects.clear();+ view.screen_xforms.clear();+ // The pointer as the pages see it: nothing over them (a dialog from the frame it opens),+ // or a press they hold. The page modules read it rather than egui's raw pointer state.+ let ptr = PagePointer::read(ui, &resp, modal);+ cancel_on_escape(ui.ctx(), view, &ptr);+ view.router.settle(ptr.any_down, !ptr.edges.is_empty());+ // A new press is no longer the last one's, wherever it lands (the page it is on gives it+ // its owner; in the gap between pages it has none).+ if ptr.pressed().is_some() {+ view.router.cancel();+ // The page widget is not focusable. Explicitly return keyboard ownership from Pages+ // when the user presses the document, without stealing focus through a modal.+ if let Some(id) = view.pages_focus_id {+ ui.memory_mut(|m| m.surrender_focus(id));+ }+ }+ let pointer = ptr.pos;+ // A press on a page makes it the current one (as in Acrobat), so a page command with+ // no selection (Rotate, Delete) acts on the page the reader pointed at, not on a page+ // gone to earlier that still shows whole beside it.+ let pressed = unobstructed && ptr.pressed().is_some();+ if resp.secondary_clicked() {+ // Set again below when the right-click lands on a link.+ view.links.context = None;+ }+ let mut frame = PageFrame {+ env: *env,+ resp: &resp,+ ptr: &ptr,+ origin,+ visible,+ pressed,+ pointer,+ signature_preview,+ out: std::mem::take(out),+ wanted: Vec::new(),+ visible_now: Vec::new(),+ current: view.current,+ best_overlap: -1.0,+ current_overlap: -1.0,+ current_height: f32::INFINITY,+ pressed_page: None,+ calc_hover: None,+ };+ for &i in visible_pages {+ draw_page(ui, view, &mut frame, i);+ }+ let PageFrame {+ wanted, visible_now, mut current, best_overlap, current_overlap, current_height, pressed_page, calc_hover, out: page_out, ..+ } = frame;+ let PageOut {+ mut canvas_action,+ clicked_link,+ mut copy_selected,+ mut field_menu,+ field_placed,+ field_props,+ hover_text: _,+ image_action,+ open_boxes,+ open_initials,+ open_signature,+ open_table,+ primary_down: _,+ refused,+ stamp_placed,+ } = page_out;+ let painter = ui.painter();+ if calc_order {+ view.calc_order.set_hover_page(calc_hover);+ let selected = view.prepare.selected.as_ref().map(|(name, _)| name.as_str());+ crate::calc_order_ui::paint_trace(ui, painter, visible, &view.calc_order, generation, selected);+ }+ // The pages' one cursor, from the claim on the highest layer the tool reaches, and the tip.+ let hover_text = pointer.filter(|_| unobstructed).zip(view.cursor.resolve(ui.ctx(), tool));+ // ScrollArea ignores the wheel while any widget is dragged, so a text-selection drag+ // scrolls the page itself (#721). After the page loop, so it keeps scrolling once the+ // pointer leaves the selection's page for the gap or the next page; over the whole+ // document area, like #759. Combine direct and smoothed motion in one request so mixed+ // Point and Line events retain their full contribution.+ if selection_wheel {+ let smooth = if view.precise_scroll_until == 0.0 { ui.input_mut(|input| std::mem::take(&mut input.smooth_scroll_delta)) } else { Vec2::ZERO };+ let delta = precise_scroll + boost_extra + smooth;+ if delta != Vec2::ZERO && delta.is_finite() {+ ui.scroll_with_delta_animation(delta, egui::style::ScrollAnimation::none());}}-- /// Only the displayed document owns raster textures. Tabs keep their document and view- /// state, but do not each retain a separate full application texture allowance.- pub(crate) fn suspend_rendering(&mut self, pool: &RenderPool) {- self.begin_render_frame();- self.pages.clear();- self.tiles.clear();- self.thumbs.clear();- self.grid_pages.clear();- self.print_pages.clear();- self.stale_thumbs.clear();- self.stale_tiles.clear();- self.waiting_since.clear();- // Signature previews own a separate renderer and image/background textures.- self.signature_drag = Default::default();- self.text_background = Default::default();- self.move_background = Default::default();- if !self.last_queue.is_empty() {- pool.set_queue(Vec::new());- self.last_queue.clear();- }- // Results already finished for this tab would otherwise sit in its pool, rasters and- // all, until the tab is shown again. (An inline pool renders inside try_recv: skip it.)- if !pool.is_inline() {- while pool.try_recv().is_some() {}+ // Held at the top or bottom edge, or dragged past it, a text selection scrolls the view+ // so it can reach text off screen (#1670); the selection follows the pointer on its page.+ if view.selection_drag+ && navigation_enabled+ && unobstructed+ && !single_paging+ && let Some(p) = ptr.pos+ {+ let dy = crate::autoscroll::edge_delta(p.y, avail, ui.input(|i| i.stable_dt));+ if dy != 0.0 {+ view.end_find_following();+ ui.scroll_with_delta_animation(vec2(0.0, dy), egui::style::ScrollAnimation::none());+ // Keep scrolling while the pointer rests there and sends no events.+ ui.ctx().request_repaint();}}-- fn thumbnail_requests(&self, info: &DocInfo, ppp: f32) -> Vec<RenderRequest> {- let mut pages: Vec<_> = self.thumb_demand.iter().map(|(&p, &visible)| (p, visible)).collect();- pages.sort_unstable_by_key(|&(p, visible)| (!visible, p));- // At high DPI or in a very large viewport every demanded cell still fits the same- // byte allowance. Both dimensions are capped, including tall/wide page boxes.- // The count is rounded up to a power of two: the scale is part of each request's tag,- // so a density that followed every row scrolling in or out would re-render them all.- let density = thumbnail_density(pages.len(), ppp);- pages- .into_iter()- .filter_map(|(page, _)| {- let p = info.pages.get(page)?;- let scale = thumbnail_scale(p.width, p.height, density);- Some(RenderRequest {- page,- kind: RequestKind::Pixels,- tile: None,- scale,- tag: THUMB_TAG | u64::from(scale.to_bits()),- // Thumbnails are previews: tiny images are skipped for them.- preview: true,- })- })- .collect()- }-- /// Admit current demand within explicit byte limits. Cached and pending surfaces share- /// the allowance, so an evicted page can be requested again without a permanent done set.- fn prepare_render_queue(&mut self, info: &DocInfo, ppp: f32) -> Vec<RenderRequest> {- let requests = std::mem::take(&mut self.frame_queue);- let mut queue = Vec::new();- let mut pages = HashSet::new();- let mut tiles = HashSet::new();- let mut tile_tags = HashSet::new();- let mut grid = Vec::new();- let (mut page_bytes, mut tile_bytes) = (0usize, 0usize);- for req in requests.iter().filter(|r| r.kind == RequestKind::Pixels) {- let Some(p) = info.pages.get(req.page) else { continue };- // Organize-grid renders: only the cells in view that need one (organize_grid).- if req.tag & GRID_TAG != 0 {- grid.push(*req);- continue;+ // The page navigated to stays current while no page shows more of itself, so the next+ // page step starts from it rather than from a page further down the screen (#188).+ // It also stays current while it is wholly on screen: a short page (a cheque) gone to+ // from the Pages panel shows less of itself than the tall page below it, and must not+ // hand the highlight to that page.+ if current_overlap >= best_overlap - PAGE_TIE || current_overlap >= current_height - PAGE_TIE {+ current = view.current;+ }+ if let Some(p) = pressed_page {+ current = p;+ }+ if view.continuous {+ view.current = current;+ }+ resp.context_menu(|ui| {+ // Preparing a form: the selected field's menu.+ if preparing && let Some((name, wi)) = view.prepare.selected.clone() {+ // Several fields: Align, Center, Distribute, Set Fields to Same Size.+ if !view.prepare.also.is_empty() {+ use crate::prepare::Arrange as A;+ let others = view.prepare.also.clone();+ let anchor = (name.clone(), wi);+ let mut pick = |ui: &mut egui::Ui, op: A, label: &str| {+ if ui.add_enabled(can_modify, egui::Button::new(tl!(label))).clicked() {+ view.pending_edit = crate::prepare::arrange(form, &anchor, &others, op);+ ui.close();+ }+ };+ ui.menu_button(tl!("Align"), |ui| {+ pick(ui, A::AlignLeft, "Left");+ pick(ui, A::AlignRight, "Right");+ pick(ui, A::AlignTop, "Top");+ pick(ui, A::AlignBottom, "Bottom");+ pick(ui, A::AlignCenterV, "Center vertically");+ pick(ui, A::AlignCenterH, "Center horizontally");+ });+ ui.menu_button(tl!("Distribute"), |ui| {+ pick(ui, A::DistributeH, "Horizontally");+ pick(ui, A::DistributeV, "Vertically");+ });+ ui.menu_button(tl!("Set Fields to Same Size"), |ui| {+ pick(ui, A::SameHeight, "Height");+ pick(ui, A::SameWidth, "Width");+ pick(ui, A::SameSize, "Both");+ });+ ui.separator();}- // Print-preview rasters: a few sheets at the pane's size (the dialog bounds them).- if req.tag & PRINT_TAG != 0 {- if !self.errors.contains_key(&req.page) {- queue.push(*req);- }- continue;+ if ui.button(tl!("Properties…")).clicked() {+ field_menu = Some(FieldMenu::Properties);+ ui.close();}- // On-screen work is always admitted (the viewport bounds it); the limits only- // decide how much prefetch fits beside it.- let visible = self.frame_visible.contains(&req.page);- if let Some(tile) = req.tile {- // Keyed by exact device-pixel origin: the tile side varies with the zoom- // (`tile_side`), so grid indices would need the scale to decode.- let key = (req.page, req.tag, tile.x, tile.y);- let bytes = rgba_bytes(tile.w as usize, tile.h as usize);- if (!visible && tile_bytes.saturating_add(bytes) > TILE_BYTES) || !tiles.insert(key) {- continue;- }- tile_bytes = tile_bytes.saturating_add(bytes);- tile_tags.insert(req.tag);- if !self.tiles.contains_key(&key) || self.stale_tiles.contains(&key) {- queue.push(*req);- }- } else {- let bytes = rgba_bytes(device_pixels(p.width, req.scale) as usize, device_pixels(p.height, req.scale) as usize);- if (!visible && (page_bytes.saturating_add(bytes) > PAGE_BYTES || pages.len() >= MAX_CACHED_PAGES)) || !pages.insert(req.page) {- continue;- }- page_bytes = page_bytes.saturating_add(bytes);- if self.pages.get(&req.page).is_none_or(|p| p.tag != req.tag) {- queue.push(*req);- }+ if ui.add_enabled(can_modify, egui::Button::new(tl!("Duplicate…"))).clicked() {+ field_menu = Some(FieldMenu::Duplicate(name.clone()));+ ui.close();}- }- // Pages no longer demanded stay cached while the allowance has room, nearest to the- // current page first, so turning back a page shows it at once instead of rendering.- let mut undemanded: Vec<usize> = self.pages.keys().copied().filter(|p| !pages.contains(p)).collect();- undemanded.sort_by_key(|p| p.abs_diff(self.current));- let mut kept = pages.len();- for page in undemanded {- let bytes = self.pages.get(&page).map_or(0, |p| texture_bytes(&p.tex));- if kept < MAX_CACHED_PAGES && page_bytes.saturating_add(bytes) <= PAGE_BYTES {- page_bytes = page_bytes.saturating_add(bytes);- kept += 1;- pages.insert(page);+ ui.separator();+ let delete = if view.prepare.also.is_empty() { "Delete" } else { "Delete selected fields" };+ if ui.add_enabled(can_modify, egui::Button::new(tl!(delete))).clicked() {+ view.pending_edit = crate::prepare::delete_selected(view);+ ui.close();}+ return;}- self.pages.retain(|p, _| pages.contains(p));- // Tiles of an earlier zoom (not a demanded scale) stay while the canvas keeps them, a- // bounded few under a page whose current tiles are still missing (OLD_TILES). Tiles of a- // page on screen stay too even when this frame does not demand them (#2196): the viewport- // moves while zooming, so a tile that was sharp a moment ago falls outside the demanded- // rectangle, and dropping it made every pan or zoom back a cold miss that re-blurred the- // page and re-interpreted it once per tile. The per-frame cap below (OLD_TILES,- // nearest scale first) is what bounds how much of that stays.- self.tiles.retain(|key, _| tiles.contains(key) || !tile_tags.contains(&key.1) || self.frame_visible.contains(&key.0));- self.stale_tiles.retain(|key| self.tiles.contains_key(key));- queue.extend(grid);- // Opening (or turning to) a page queues its pixels alongside thumbnails and- // text extraction. The workers would otherwise spend the first seconds on- // thumbnails and search text while the visible page stays blank: hold those- // until no visible main-page raster is still missing. Errored pages never- // block: they are never re-requested.- let visible_mains_pending = queue.iter().any(|r| {- r.kind == RequestKind::Pixels- && r.tag & (GRID_TAG | PRINT_TAG | THUMB_TAG | TEXT_TAG) == 0- && self.frame_visible.contains(&r.page)- && !self.errors.contains_key(&r.page)- });- if visible_mains_pending {- // Caches are kept; demand is re-evaluated next frame once pixels arrive.- return queue;- }- let thumbs = self.thumbnail_requests(info, ppp);- let mut thumb_bytes = 0usize;- let mut admitted = HashSet::new();- for req in thumbs {- let Some(p) = info.pages.get(req.page) else { continue };- let bytes = rgba_bytes(device_pixels(p.width, req.scale) as usize, device_pixels(p.height, req.scale) as usize);- if thumb_bytes.saturating_add(bytes) > THUMB_BYTES || self.errors.contains_key(&req.page) {- continue;+ if let Some((page, index)) = view.links.context {+ if ui.button(tl!("Properties…")).clicked() {+ view.links.open_existing = Some((page, index));+ ui.close();}- thumb_bytes += bytes;- admitted.insert(req.page);- if self.thumbs.get(&req.page).is_none_or(|t| t.tag != req.tag) || self.stale_thumbs.contains(&req.page) {- queue.push(req);+ if ui.add_enabled(can_modify, egui::Button::new(tl!("Delete"))).clicked() {+ view.pending_edit = Some(Edit::DeleteLink { page, index });+ view.links.selected = None;+ view.links.context = None;+ ui.close();+ }+ ui.separator();+ if ui.add_enabled(can_modify, egui::Button::new(tl!("Remove all links"))).clicked() {+ view.pending_edit = Some(Edit::RemoveLinks { pages: None });+ view.links.selected = None;+ view.links.context = None;+ ui.close();}- }- self.thumbs.retain(|p, _| admitted.contains(p));- self.stale_thumbs.retain(|p| admitted.contains(p));- self.retain_text_layers();- // Visible main pages and thumbnails take precedence over background search work.- queue.extend(requests.into_iter().filter(|r| r.kind == RequestKind::Text));- queue- }-- /// Drop text layers nothing can still need. Every visited page's text used to stay- /// cached for the session. Keep visible, selected and matched pages plus the nearest- /// prefetch window; evicted pages re-extract on revisit. (Count window only: unlike- /// rasters there is no byte budget here.) While a search is active keep everything:- /// demand still wants every page, so evicting would re-request evicted pages each- /// frame and churn the workers. Failures are never evicted either: they cost nothing- /// to remember, and evicting one would re-request and re-fail it every frame.- fn retain_text_layers(&mut self) {- if self.texts.len() <= MAX_CACHED_TEXT_PAGES {- return;- }- if self.find.as_ref().is_some_and(|f| !f.case_query.trim().is_empty()) {- return;- }- let mut keep: HashSet<usize> = self.frame_visible.clone();- if let Some(s) = self.selection {- keep.insert(s.page);- }- if let Some(f) = self.find.as_ref() {- keep.extend(f.matches.iter().map(|(p, _)| *p));- }- let mut rest: Vec<usize> = self.texts.keys().filter(|p| !keep.contains(*p)).copied().collect();- rest.sort_by_key(|p| p.abs_diff(self.current));- keep.extend(rest.into_iter().take(MAX_CACHED_TEXT_PAGES));- self.texts.retain(|p, _| keep.contains(p));- }-- pub(crate) fn finish_render_frame(&mut self, ctx: &egui::Context, info: &DocInfo, pool: &RenderPool) {- if self.frame_geometry_changed {- // Dialogs and edits can replace pages after the canvas collected demand. Its- // scales and indexes belong to the old pages, not to the new renderer (#3149).- self.begin_render_frame();- self.last_queue.clear();- pool.set_queue(Vec::new());- ctx.request_repaint();return;}- let queue = self.prepare_render_queue(info, ctx.pixels_per_point());- if queue != self.last_queue {- pool.set_queue(queue.clone());- self.last_queue = queue;- }- if !self.hold_rasters {- self.receive(ctx, pool);- }- if !self.last_queue.is_empty() {- ctx.request_repaint_after(std::time::Duration::from_millis(30));- }- }-- /// Pull a bounded batch of current results into textures. Demand is committed first, so- /// offscreen results and obsolete scale/configuration tags never allocate a ColorImage.- pub fn receive(&mut self, ctx: &egui::Context, pool: &RenderPool) {- let budget = if pool.is_inline() { 1 } else { RESULTS_PER_FRAME };- let mut uploaded = 0usize;- #[cfg(not(target_arch = "wasm32"))]- let started = std::time::Instant::now();- for _ in 0..budget {- let Some(r) = pool.try_recv() else { break };- uploaded = uploaded.saturating_add(self.receive_result(ctx, r));- // One whole-page upload may exceed the frame allowance; it must still progress.- if uploaded >= UPLOAD_BYTES_PER_FRAME {- break;+ if view.comments.selected.is_none() {+ let selected = view.selected_text().is_some_and(|t| !t.is_empty());+ let key = crate::commands::shortcut_label(ui.ctx(), crate::commands::COPY);+ if ui.add_enabled(can_copy && selected, egui::Button::new(tl!("Copy")).shortcut_text(key)).clicked() {+ copy_selected = true;+ ui.close();}- #[cfg(not(target_arch = "wasm32"))]- if started.elapsed() >= std::time::Duration::from_millis(4) {- break;- }- }- }-- fn receive_result(&mut self, ctx: &egui::Context, r: pdfcraft_render::RenderedPage) -> usize {- if !self.last_queue.contains(&r.request) {- return 0;+ ui.separator();}- ctx.request_repaint();- if r.request.kind == RequestKind::Text {- match r.text {- Some(t) => {- self.texts.insert(r.request.page, t);- self.refresh_find_page(r.request.page);- }+ // Over a picture (and no comment): Copy Image, as in Acrobat's page menu.+ let mut copy_image = None;+ if view.comments.selected.is_none()+ && let Some((page, at)) = view.comments.context_at+ {+ // The page's content is parsed once per right-click, not on every frame the menu is open.+ let key = egui::Id::unique("copy-image-under-menu");+ let cached = ui.data(|d| d.get_temp::<(usize, [f64; 2], Option<usize>)>(key)).filter(|c| c.0 == page && c.1 == at);+ let hit = match cached {+ Some(c) => c.2,None => {- log::warn!("page {} text: {}", r.request.page + 1, r.error.unwrap_or_default());- self.text_failed.insert(r.request.page);- if let Some(f) = self.find.as_mut() {- let current_key = f.current.and_then(|c| f.matches.get(c).cloned());- f.matches.retain(|(p, _)| *p != r.request.page);- f.current = current_key.and_then(|k| f.matches.iter().position(|m| *m == k));- if f.current.is_none() && !f.matches.is_empty() {- let cur = self.current;- f.current = Some(f.matches.iter().position(|(p, _)| *p >= cur).unwrap_or(0));- }- }+ let hit = doc.page_image_at(page, at);+ ui.data_mut(|d| d.insert_temp(key, (page, at, hit)));+ hit}- }- return 0;- }- if let Some(e) = r.error {- log::warn!("page {}: {e}", r.request.page + 1);- self.errors.insert(r.request.page, e);- return 0;- }- // Even current demand may have been sized with obsolete geometry or a different- // device limit. Check before cache eviction, conversion and every upload path.- let max_side = ctx.input(|i| i.max_texture_side);- if r.width == 0 || r.height == 0 || r.width as usize > max_side || r.height as usize > max_side {- return 0;- }- // Remember heavy pages: only these get the zoom/pan settle holds, so fast pages- // never pay added latency. Stale entries die with the tiles on edits.- if r.millis >= SLOW_MILLIS {- self.slow_pages.insert(r.request.page);- }- let page = r.request.page;- let bytes = rgba_bytes(r.width as usize, r.height as usize);- if bytes != r.rgba.len() || !self.admit_texture(r.request, bytes) {- return 0;- }- // The length was checked above, so the renderer's buffer becomes the texture data as is.- let img = texture_image([r.width as usize, r.height as usize], r.rgba);- if let Some(t) = r.request.tile {- let key = (page, r.request.tag, t.x, t.y);- let tex = ctx.load_texture(format!("tile-{:?}-{page}-{}-{}", self.id, t.x, t.y), img, TextureOptions::LINEAR);- self.tiles.insert(key, tex);- self.stale_tiles.remove(&key);- if !self.stale_tiles.iter().any(|k| k.0 == page) {- self.forms.unbaked.retain(|(_, p)| *p != page);- self.comments.page_rendered(page);- }- } else if r.request.tag & PRINT_TAG != 0 {- let tex = ctx.load_texture(- format!("print-{:?}-{page}", self.id),- if r.request.tag & GRAYSCALE_TAG != 0 { grayscale(img) } else { img },- TextureOptions::LINEAR,- );- self.print_pages.insert(page, (r.request.tag, tex));- } else if r.request.tag & GRID_TAG != 0 {- let tex = ctx.load_texture(format!("grid-{:?}-{page}", self.id), img, TextureOptions::LINEAR);- self.grid_pages.insert(page, (r.width, tex));- } else if r.request.tag & THUMB_TAG != 0 {- let tex = ctx.load_texture(format!("thumb-{:?}-{page}", self.id), img, TextureOptions::LINEAR);- self.thumbs.insert(page, PageTex { tag: r.request.tag, tex });- self.stale_thumbs.remove(&page);- } else {- let tex = ctx.load_texture(format!("page-{:?}-{page}", self.id), img, TextureOptions::LINEAR);- self.pages.insert(page, PageTex { tag: r.request.tag, tex });- self.signature_drag.page_received(page);- self.move_background.page_received(page);- self.comments.page_rendered(page);- self.waiting_since.remove(&page);- if !self.stale_tiles.iter().any(|k| k.0 == page) {- self.forms.unbaked.retain(|(_, p)| *p != page);- }- }- bytes- }-- /// Check real dimensions before conversion, including stale textures kept during edits.- /// Dropping an old handle releases its backend allocation after the current frame.- fn admit_texture(&mut self, req: RenderRequest, bytes: usize) -> bool {- // An on-screen page or tile is always taken (the viewport bounds it): it may evict- // off-screen rasters but never another on-screen one, and is never refused.- let visible = req.tag & THUMB_TAG == 0 && self.frame_visible.contains(&req.page);- // Organize-grid renders are bounded by the cells in view (organize_grid). Print- // previews are the sheets around the one on screen.- if req.tag & (GRID_TAG | PRINT_TAG) != 0 {- return true;- }- if let Some(t) = req.tile {- let key = (req.page, req.tag, t.x, t.y);- self.tiles.remove(&key);- let retained = self.tiles.values().fold(0usize, |n, tex| n.saturating_add(texture_bytes(tex)));- visible || bytes <= TILE_BYTES.saturating_sub(retained)- } else {- let thumb = req.tag & THUMB_TAG != 0;- let (cache, limit) = if thumb { (&mut self.thumbs, THUMB_BYTES) } else { (&mut self.pages, PAGE_BYTES) };- cache.remove(&req.page);- let mut retained = cache.values().fold(0usize, |n, p| n.saturating_add(texture_bytes(&p.tex)));- // A zoom/DPI change can temporarily retain larger stale images than the new- // demand estimates. Evict those first, then let the current demand refill them.- let on_screen = |p: &usize| !thumb && self.frame_visible.contains(p);- while retained.saturating_add(bytes) > limit {- let Some(page) = cache.keys().copied().filter(|p| !on_screen(p)).max_by_key(|p| p.abs_diff(self.current)) else { break };- if let Some(old) = cache.remove(&page) {- retained = retained.saturating_sub(texture_bytes(&old.tex));+ };+ if let Some(image) = hit {+ if ui.button(tl!("Copy Image")).clicked() {+ copy_image = Some(comments::CanvasAction::CopyImage(page, image));+ ui.close();}+ if ui.button(tl!("Copy Image in Original Format")).clicked() {+ copy_image = Some(comments::CanvasAction::CopyImageFile(page, image));+ ui.close();+ }+ ui.separator();}- visible || bytes <= limit.saturating_sub(retained)}- }+ canvas_action =+ comments::context_menu(ui, view, info, &|page, index| doc.annotation_deletable(page, index), prefs, allowed, can_modify).or(copy_image);+ });+ *out = PageOut {+ canvas_action,+ clicked_link,+ copy_selected,+ field_menu,+ field_placed,+ field_props,+ hover_text,+ image_action,+ open_boxes,+ open_initials,+ open_signature,+ open_table,+ primary_down: ptr.primary_down,+ refused,+ stamp_placed,+ };+ (wanted, visible_now)+ }- fn fit_zoom(&mut self, info: &DocInfo) {- let largest = |side: fn((f32, f32)) -> f32| info.pages.iter().map(|p| side(self.display_size(p))).fold(1.0, f32::max);- let max_w = largest(|s| s.0);- // A single page shown on its own fits that page. Every other display (scrolling, or a- // two-page spread) fits its largest page, so the zoom holds still while pages of other- // sizes scroll or page past.- let (w, h) = if self.layout == PageLayout::Single && !self.continuous {- info.pages.get(self.current).map_or_else(|| (max_w, largest(|s| s.1)), |p| self.display_size(p))+ /// A zoom the fit mode changed keeps the page at the top of the view in place.+ fn anchor_zoom_change(view: &mut DocView, avail_width: f32, old_zoom: f32) {+ if view.shown && view.zoom_anchor.is_none() && view.goto.is_none() && view.goto_point.is_none() && (view.zoom - old_zoom).abs() > 1e-4 {+ let prev_viewport = view.viewport_screen;+ let top_y = prev_viewport.min.y;+ let anchor = view+ .screen_rects+ .iter()+ .find(|(_, r)| r.min.y <= top_y && r.max.y > top_y)+ .map(|(p, r)| {+ let fy = if r.height() > 0.0 { ((top_y - r.min.y) / r.height()).clamp(0.0, 1.0) } else { 0.0 };+ (*p, fy, 0.0f32)+ })+ .or_else(|| view.screen_rects.iter().find(|(_, r)| r.min.y >= top_y).map(|(p, r)| (*p, 0.0f32, (r.min.y - top_y).max(0.0))))+ .or_else(|| view.screen_rects.last().map(|(p, r)| (*p, 1.0f32, (r.max.y - top_y).max(0.0))));+ if let Some((page, fy, rel_y)) = anchor {+ view.zoom_anchor = Some((page, 0.5, fy, vec2(avail_width / 2.0, rel_y)));} else {- (max_w, largest(|s| s.1))- };- let avail_w = (self.viewport_w - 2.0 * SIDE).max(100.0);- let per_row = if self.layout == PageLayout::TwoUp { 2.0 } else { 1.0 };- match self.fit {- Fit::Width => self.zoom = (avail_w - GAP * (per_row - 1.0)) / (w * PT * per_row),- Fit::Page => {- let zw = (avail_w - GAP * (per_row - 1.0)) / (w * PT * per_row);- let zh = (self.viewport_h - 2.0 * MARGIN) / (h * PT);- self.zoom = zw.min(zh);- }- Fit::Height => self.zoom = (self.viewport_h - 2.0 * MARGIN) / (h * PT),- Fit::None => {}+ view.zoom_anchor = Some((view.current, 0.5, 0.0, vec2(avail_width / 2.0, MARGIN)));}- self.zoom = self.zoom.clamp(0.08, 64.0);}+ }- /// Width of the scroll content. Single-page view sizes it to the page it shows, so a- /// wider page elsewhere in the document can't push the shown one off-centre.- fn content_width(&self, info: &DocInfo, avail_w: f32) -> f32 {- let single = (self.layout == PageLayout::Single && !self.continuous).then(|| self.current.min(info.pages.len().saturating_sub(1)));- let shown = info.pages.iter().enumerate().filter(|&(i, _)| single.is_none_or(|c| c == i));- let max_w = shown.map(|(_, p)| self.display_size(p).0).fold(0.0, f32::max);- let per_row = if self.layout == PageLayout::TwoUp { 2.0 } else { 1.0 };- (max_w * self.zoom * PT * per_row + 2.0 * SIDE).max(avail_w)- }+ /// What the pager needs to know about the page row on screen.+ #[derive(Clone, Copy)]+ struct PagingCx<'a> {+ row: &'a [usize],+ rects: &'a [Rect],+ avail: Rect,+ middle_gesture: bool,+ unobstructed: bool,+ }- /// Page rects in content coordinates (origin at the scroll content's top-left).- fn layout(&self, info: &DocInfo, content_w: f32) -> Vec<Rect> {- let s = self.zoom * PT;- let mut rects = Vec::with_capacity(info.pages.len());- let mut y = MARGIN;- match self.layout {- PageLayout::Single => {- for p in &info.pages {- let (w, h) = self.display_size(p);- let size = vec2(w * s, h * s);- rects.push(Rect::from_min_size(pos2(((content_w - size.x) / 2.0).max(SIDE), y), size));- y += size.y + GAP;- }- }- PageLayout::TwoUp => {- // With a cover page, the first page sits alone on the right.- let rows: Vec<&[pdfcraft_render::PageInfo]> = if self.cover && !info.pages.is_empty() {- std::iter::once(&info.pages[..1]).chain(info.pages[1..].chunks(2)).collect()- } else {- info.pages.chunks(2).collect()- };- for (ri, pair) in rows.into_iter().enumerate() {- let sizes: Vec<Vec2> = pair.iter().map(|p| self.display_size(p)).map(|(w, h)| vec2(w * s, h * s)).collect();- let row_w: f32 = sizes.iter().map(|v| v.x).sum::<f32>() + GAP * (sizes.len() as f32 - 1.0);- let row_h = sizes.iter().map(|v| v.y).fold(0.0, f32::max);- let mut x = if self.cover && ri == 0 { (content_w / 2.0 + GAP / 2.0).max(SIDE) } else { ((content_w - row_w) / 2.0).max(SIDE) };- for size in sizes {- rects.push(Rect::from_min_size(pos2(x, y + (row_h - size.y) / 2.0), size));- x += size.x + GAP;+ /// Not scrolling: when the whole page or spread fits, the wheel turns pages instead. Returns whether+ /// paging owns the wheel, and whether it turned the page at an edge.+ fn single_page_paging(ui: &egui::Ui, view: &mut DocView, cx: &PagingCx<'_>) -> (bool, bool) {+ let (mut single_paging, mut edge_turned) = (false, false);+ let PagingCx { row, rects, avail, middle_gesture, unobstructed } = *cx;+ if !view.continuous {+ // The row's bounding box on screen (one page, or a two-page spread).+ let row_rect = row.iter().filter_map(|&i| rects.get(i)).copied().reduce(Rect::union);+ // Within a point, so layout rounding can't stop a fitting page from turning.+ let fits = row_rect.is_some_and(|r| r.height() + 2.0 * MARGIN <= avail.height() + 1.0);+ let can_turn = !middle_gesture && unobstructed && ui.rect_contains_pointer(avail);+ single_paging = can_turn && fits;+ // Every wheel event goes to the pager, so it follows each trackpad touch to its end+ // even while the page can't turn.+ ui.input(|i| {+ for e in &i.events {+ if let egui::Event::MouseWheel { unit, delta, phase, modifiers, .. } = e {+ // Zooming (⌘ or Ctrl) and sideways scrolling (Shift) never turn pages.+ let dy = if modifiers.command || modifiers.ctrl || modifiers.shift { 0.0 } else { delta.y };+ if fits {+ view.single_page_wheel(*unit, dy, *phase, i.time, can_turn);+ } else {+ edge_turned |= view.single_page_wheel_edge(*unit, dy, *phase, i.time, can_turn);}- y += row_h + GAP;}}- }- rects- }-- fn render_scale(&self, ppp: f32) -> f32 {- // Exactly the device scale: a raster at any other scale is resampled on screen, which- // blurs every line and glyph (#260).- self.zoom * PT * ppp- }-- /// Set whether the print preview rasters become luminance before upload. Toggling it drops- /// the colour previews: new requests carry the grayscale tag, so stale ones are replaced.- pub(crate) fn set_print_grayscale(&mut self, grayscale: bool) {- if self.grayscale != grayscale {- self.grayscale = grayscale;- self.print_pages.clear();- }- }-- /// Queue sharp rasters for the print preview. Pages that leave the nearby sheets are dropped.- /// Previews render with reading colours off (the request's tag tells the renderer): they must- /// match the printout, which is imposed from the uncoloured document.- pub(crate) fn queue_print_previews(&mut self, pages: &[(usize, f32)]) {- self.print_pages.retain(|page, _| pages.iter().any(|(p, _)| p == page));- for &(page, scale) in pages {- if self.errors.contains_key(&page) || !scale.is_finite() || scale <= 0.0 {- continue;- }- let tag = scale_tag(scale) | PRINT_TAG | if self.grayscale { GRAYSCALE_TAG } else { 0 };- let fresh = self.print_pages.get(&page).is_some_and(|(have, _)| *have == tag);- if !fresh {- self.frame_queue.push(RenderRequest { page, kind: RequestKind::Pixels, tile: None, scale, tag, preview: false });- }+ });+ if single_paging {+ // Paging owns vertical wheel motion here. A diagonal gesture keeps its sideways+ // part, as `ScrollArea` itself handles each axis.+ ui.input_mut(|i| i.smooth_scroll_delta.y = 0.0);}}+ (single_paging, edge_turned)}- /// The hover popup for an annotation. Replies and Fill & Sign marks (typed text, checks, signatures)- /// show none: they are page content being edited, not comments.- fn annotation_hover_text(a: &pdfcraft_render::Annotation) -> Option<String> {- if a.in_reply_to.is_some() || a.fill_sign {- return None;- }- let who = a.author.clone().unwrap_or_else(|| a.subtype.clone());- let body = a.contents.clone().unwrap_or_default();- Some(if body.is_empty() { who } else { format!("{who}\n{body}") })- }-- /// The request tag for a raster at `scale`: equal tags mean the same scale (to 1/65536).- fn scale_tag(scale: f32) -> u64 {- (f64::from(scale) * 65536.0).round() as u64- }-- /// The scale of a raster tagged by [`scale_tag`].- fn tag_scale(tag: u64) -> f32 {- (tag as f64 / 65536.0) as f32- }-- /// Device-pixel side of a page tile at `scale` for a page `page_max_px` device pixels on- /// its long side. Each tile costs a full page interpret, so tiles grow with the zoom and- /// with the page: a zoomed viewport, or a giant sheet shown whole, is covered by a few- /// large tiles instead of dozens of small ones. Bounded by the render backend (tile sides- /// above 4096 are clamped there) and kept granular at ordinary zooms.- fn tile_side(scale: f32, page_max_px: u32) -> u32 {- if !scale.is_finite() || scale <= 0.0 {- return TILE;- }- let by_zoom = (TILE as f32 * (scale / 6.0)).clamp(TILE as f32, 4096.0) as u32;- // At most four tiles along the long side, so a giant sheet needs a handful of- // interprets instead of dozens.- by_zoom.max(page_max_px.div_ceil(4).min(4096))- }-- /// Tiles of earlier zooms kept for a page while its current tiles are rendered.- const OLD_TILES: usize = 64;-- /// A page whose raster took at least this long is heavy: zoom/pan holds apply to it,- /// so gestures stay on stretched surfaces instead of queueing full-page interprets.- const SLOW_MILLIS: u32 = 500;-- /// `r` moved so its corner lies on a whole physical pixel, so that a raster drawn from there- /// maps texel for texel onto the screen.- fn snap_to_pixels(r: Rect, ppp: f32) -> Rect {- let snap = |v: f32| (v * ppp).round() / ppp;- Rect::from_min_size(pos2(snap(r.min.x), snap(r.min.y)), r.size())- }-- /// Maps between a page's coordinate spaces and the screen, including view rotation.- ///- /// *View space* is the page as rendered (points, y down, the document's own `/Rotate` applied);- /// normalised page coordinates `(u, v)` are view space divided by the page size. The view- /// rotation (View ▸ Rotate View) turns the page clockwise on screen by `rot` degrees.- #[derive(Clone, Copy)]- pub struct PageXform {- /// The page's rectangle on screen (already rotated, so width/height may be swapped).- pub rect: Rect,- pub rot: u16,- /// Page size in view space (unrotated by the view).- pub pw: f32,- pub ph: f32,+ /// This frame's wheel motion over the page view, after paging and point/line suppression.+ struct Wheel {+ precise_scroll: Vec2,+ line_base: Vec2,+ boost_extra: Vec2,+ has_page: bool,+ /// The pager owns the vertical axis (single-page view, or the rest of a gesture that turned the page).+ paging_owns_vertical: bool,}- impl PageXform {- /// Draw an image in the PDF user-space `rect` as a custom stamp's appearance draws it: turned- /// back by `turn` (the page /Rotate it was placed for), so with the page's own rotation it- /// reads upright as displayed.- pub(crate) fn paint_user_image(- &self,- painter: &egui::Painter,- tex: egui::TextureId,- p: &pdfcraft_render::PageInfo,- rect: [f64; 4],- turn: i64,- color: Color32,- ) {- let mut mesh = egui::Mesh::with_texture(tex);- let (w, h) = (rect[2] - rect[0], rect[3] - rect[1]);- let (shown_w, shown_h) = if turn % 180 == 0 { (w, h) } else { (h, w) };- let [a, b, c, d, e, f] = pdfcraft_model::view_matrix_for(turn, rect);- for (u, v) in [(0.0_f32, 0.0_f32), (1.0, 0.0), (1.0, 1.0), (0.0, 1.0)] {- // The texture's (u, v), from its top-left, in the picture's upright frame, then in user space.- let (dx, dy) = (f64::from(u) * shown_w, f64::from(1.0 - v) * shown_h);- let (x, y) = (a * dx + c * dy + e, b * dx + d * dy + f);- let q = p.user_to_view(x as f32, y as f32);- mesh.vertices.push(egui::epaint::Vertex { pos: self.norm_to_screen(q[0] / self.pw, q[1] / self.ph), uv: pos2(u, v), color });- }- mesh.add_triangle(0, 1, 2);- mesh.add_triangle(0, 2, 3);- painter.add(egui::Shape::mesh(mesh));- }- pub fn norm_to_screen(&self, u: f32, v: f32) -> Pos2 {- let (a, b) = match self.rot {- 90 => (1.0 - v, u),- 180 => (1.0 - u, 1.0 - v),- 270 => (v, 1.0 - u),- _ => (u, v),- };- pos2(self.rect.left() + a * self.rect.width(), self.rect.top() + b * self.rect.height())- }-- pub fn screen_to_norm(&self, p: Pos2) -> (f32, f32) {- let (a, b) = ((p.x - self.rect.left()) / self.rect.width().max(1e-3), (p.y - self.rect.top()) / self.rect.height().max(1e-3));- match self.rot {- 90 => (b, 1.0 - a),- 180 => (1.0 - a, 1.0 - b),- 270 => (1.0 - b, a),- _ => (a, b),- }- }-- /// Screen point → view space (points).- pub fn screen_to_view(&self, p: Pos2) -> (f32, f32) {- let (u, v) = self.screen_to_norm(p);- (u * self.pw, v * self.ph)- }-- /// A view-space rect [x0, y0, x1, y1] → screen rect.- pub fn view_rect(&self, g: [f32; 4]) -> Rect {- Rect::from_two_pos(self.norm_to_screen(g[0] / self.pw, g[1] / self.ph), self.norm_to_screen(g[2] / self.pw, g[3] / self.ph))- }-- /// A PDF user-space rect (crop box, document `/Rotate`) → screen rect.- pub fn user_rect(&self, info: &DocInfo, page: usize, r: [f32; 4]) -> Rect {- let p = &info.pages[page];- let [cx0, cy0, cx1, cy1] = p.crop;- let (cw, ch) = ((cx1 - cx0).max(1.0), (cy1 - cy0).max(1.0));- let norm = |x: f32, y: f32| -> (f32, f32) {- let (u, v) = ((x - cx0) / cw, (cy1 - y) / ch);- match p.rotation {- 90 => (1.0 - v, u),- 180 => (1.0 - u, 1.0 - v),- 270 => (v, 1.0 - u),- _ => (u, v),- }- };- let (a, b) = (norm(r[0], r[1]), norm(r[2], r[3]));- Rect::from_two_pos(self.norm_to_screen(a.0, a.1), self.norm_to_screen(b.0, b.1))- }-- /// This transform resized to a raster of `px` device pixels (width, height before the view- /// rotation), so each of its texels covers one screen pixel. The rectangle's corner must- /// already be on a whole pixel ([`snap_to_pixels`]).- fn texel_aligned(&self, px: [usize; 2], ppp: f32) -> PageXform {- let (w, h) = (px[0] as f32 / ppp, px[1] as f32 / ppp);- let size = if self.rot % 180 == 90 { vec2(h, w) } else { vec2(w, h) };- PageXform { rect: Rect::from_min_size(self.rect.min, size), ..*self }- }-- /// Draw a texture covering the normalised page region, rotated with the view.- pub fn paint_image(&self, painter: &egui::Painter, tex: egui::TextureId, u0: f32, v0: f32, u1: f32, v1: f32) {- let mut mesh = egui::Mesh::with_texture(tex);- let corners = [(u0, v0, 0.0, 0.0), (u1, v0, 1.0, 0.0), (u1, v1, 1.0, 1.0), (u0, v1, 0.0, 1.0)];- for (u, v, tu, tv) in corners {- mesh.vertices.push(egui::epaint::Vertex { pos: self.norm_to_screen(u, v), uv: pos2(tu, tv), color: Color32::WHITE });- }- mesh.add_triangle(0, 1, 2);- mesh.add_triangle(0, 2, 3);- painter.add(egui::Shape::mesh(mesh));- }- }-- pub fn shortcuts(view: &mut DocView, ctx: &egui::Context, speed: crate::scroll_speed::ScrollSpeed) {- use egui::{Key, KeyboardShortcut, Modifiers};- if ctx.input_mut(|i| i.consume_shortcut(&KeyboardShortcut::new(Modifiers::COMMAND, Key::F))) {- view.open_find();- }- let cmd = |k| KeyboardShortcut::new(Modifiers::COMMAND, k);- let pressed = |s: KeyboardShortcut| ctx.input_mut(|i| i.consume_shortcut(&s));- // ⌘G / ⇧⌘G step through the matches from the find field too, as in Acrobat and Preview- // (#2669): ahead of the text-input check, but only while there is a search to step.- if view.find.is_some() {- if pressed(KeyboardShortcut::new(Modifiers::COMMAND | Modifiers::SHIFT, Key::G)) {- view.find_step(false);- } else if pressed(cmd(Key::G)) {- view.find_step(true);- }- }- if ctx.egui_wants_keyboard_input() {- return;- }- // Rotation first: egui matches ⌘+ loosely with respect to Shift.- if pressed(KeyboardShortcut::new(Modifiers::COMMAND | Modifiers::SHIFT, Key::Plus))- || pressed(KeyboardShortcut::new(Modifiers::COMMAND | Modifiers::SHIFT, Key::Equals))- {- view.rotate_view(true);- }- if pressed(KeyboardShortcut::new(Modifiers::COMMAND | Modifiers::SHIFT, Key::Minus)) {- view.rotate_view(false);- }- // In the page grid ⌘+ / ⌘− / ⌘0 size its pages instead (looking is always allowed).- let (zoom_in, zoom_out, zoom_reset) = (pressed(cmd(Key::Plus)) || pressed(cmd(Key::Equals)), pressed(cmd(Key::Minus)), pressed(cmd(Key::Num0)));- if view.organize {- if zoom_in {- view.grid_zoom_request = Some(view.grid_zoom * GRID_ZOOM_STEP);- }- if zoom_out {- view.grid_zoom_request = Some(view.grid_zoom / GRID_ZOOM_STEP);- }- if zoom_reset {- view.grid_zoom_request = Some(1.0);- }- } else {- if zoom_in {- view.zoom_step(true);- }- if zoom_out {- view.zoom_step(false);- }- if zoom_reset {- view.fit = Fit::Page;- view.goto = Some((view.current, 0.0));- }- }- if pressed(cmd(Key::Num1)) {- view.set_zoom(1.0);- }- if pressed(cmd(Key::Num2)) {- view.fit = Fit::Width;- view.goto = Some((view.current, 0.0));- }- if pressed(cmd(Key::OpenBracket)) {- view.view_history(false);- }- if pressed(cmd(Key::CloseBracket)) {- view.view_history(true);- }- let key = |k| ctx.input(|i| i.key_pressed(k));- if key(Key::Escape) {- if view.camera.is_some() || view.camera_done.is_some() {- view.pending_action = Some(ViewAction::CancelCamera);- } else if view.selection.is_some() {- view.selection = None;- } else {- view.find = None;- }- }- if key(Key::Home) {- view.go_to_page(0);- }- if key(Key::End) {- view.go_to_page(usize::MAX);- }- // As in Acrobat: → / ← go to the next / previous page in every layout (#185), and so do- // ⌘Page Down / ⌘Page Up, or plain Page Down / Page Up in single-page view.- let command = ctx.input(|i| i.modifiers.command);- let scrolls = view.continuous;- if key(Key::ArrowRight) || (key(Key::PageDown) && (command || !scrolls)) {- view.step_page(true);- }- if key(Key::ArrowLeft) || (key(Key::PageUp) && (command || !scrolls)) {- view.step_page(false);- }- // ↓ / ↑ scroll a line, and Page Down / Page Up a screen where the pages scroll. In- // single-page view, ↓ / ↑ turn the page once there is nothing left to scroll that way, as- // the wheel does (#273): always on a page that fits.- // The Scroll speed preference sets how far ↓ / ↑ go as well as the wheel (#985); Page Down /- // Page Up keep a screen.- if !command {- let line = KEY_SCROLL_LINE * speed.factor();- let screen = (view.viewport_h - KEY_SCROLL_LINE).max(KEY_SCROLL_LINE);- let steps = [(Key::ArrowDown, line), (Key::ArrowUp, -line), (Key::PageDown, screen), (Key::PageUp, -screen)];- for (k, by) in steps {- let arrow = matches!(k, Key::ArrowDown | Key::ArrowUp);- if !key(k) || !(scrolls || arrow) {- continue;- }- let forward = k == Key::ArrowDown;- // Only an up-to-date view counts: the page drawn is the current one, with no jump pending.- let at_end = !scrolls- && view.goto.is_none()- && view.single_edges.is_some_and(|(page, top, bottom)| page == view.current && if forward { bottom } else { top });- if at_end {- let before = view.current;- view.step_page(forward);- if !forward && view.current != before {- // Going back up lands on the bottom of the previous page.- view.goto = Some((view.current, 1.0));- }- view.single_edges = None;- } else {- view.key_scroll += by;- }- }- }- }-- /// How far ↓ / ↑ scroll at Normal speed (Scroll speed halves or doubles it). Page Down / Page Up- /// keep this much of the previous screen in view.- const KEY_SCROLL_LINE: f32 = 40.0;- /// Suppression window for egui's eased copy of point input.- ///- /// egui 0.36.2 drains `WheelState::after_events` tail deltas by 90% per 0.1 s.- const SUPPRESS_SECS: f64 = 0.25;- /// Short rolling extension while egui still has an unprocessed wheel tail.- const SUPPRESS_TAIL_SECS: f64 = 0.05;-- pub fn document_area(app: &mut PdfCraftApp, index: usize, ui: &mut egui::Ui) {- let t = Tokens::get(ui.ctx());- // Keyboard scrolling applies to this frame's page view only, never later.- let key_scroll = std::mem::take(&mut app.views[index].key_scroll);- // The Search panel closed: its search moves to the find bar.- let search_open = app.right == Some(crate::RightPanel::Search);- if let Some(f) = app.views[index].find.as_mut()- && f.in_panel- && !search_open- {- f.in_panel = false;- }- // The snapshot notice bar's Close was clicked: close here, where no document borrow is- // held. The tab is looked up by id: indices may have shifted since the click, and the- // flag rides its own view, so a stale flag can never close the wrong tab.- let pending = app.views.get(index).filter(|v| v.close_requested).map(|v| v.id).and_then(|id| app.views.iter().position(|v| v.id == id));- if let Some(i) = pending {- app.views[i].close_requested = false;- if app.has_unsaved_work(i) {- app.close_request = Some(crate::CloseRequest::Tab(app.views[i].id));- } else {- app.close_tab(i);- }- return;- }- let Some(doc) = app.session.get(app.views[index].id) else { return };- let info = &doc.info;- if info.pages.is_empty() {- app.views[index].auto_scroll.cancel();- ui.centered_and_justified(|ui| ui.label(tl!("This document has no pages.")));- return;- }- // The print dialog queues its own rasters later in the frame. Closing it drops them.- if app.dialog != Some(crate::Dialog::Print) {- app.views[index].print_pages.clear();- }- // The Prepare a form panel is open (or a field tool is picked): fields are edited, not filled.- let preparing = app.is_preparing();- // Edit a PDF: added text and images can be selected, moved and edited.- let editing_content =- (app.left_open && app.left == crate::LeftPanel::Tool("edit")) || matches!(app.quick_tool, QuickTool::AddText | QuickTool::EditText);- let text_style = app.text_style.clone();- let view = &mut app.views[index];- // Opened without the owner password and something is restricted.- let secured = doc.security_summary().is_some_and(|s| !(s.owner || (s.permissions.modify() && s.permissions.assemble())));- let repaired = !doc.repair_log().is_empty();- match notices(view, doc, secured, repaired, crate::sign_ui::banner(&doc.signatures), ui, &t) {- #[cfg(not(target_arch = "wasm32"))]- Some(Notice::Reload) => app.watch.reload_request = Some(view.id),- #[cfg(target_arch = "wasm32")]- Some(Notice::Reload) => {}- Some(Notice::Repairs) => app.dialog = Some(crate::Dialog::Properties(crate::PropsTab::Advanced)),- Some(Notice::Security) => app.dialog = Some(crate::Dialog::Properties(crate::PropsTab::Security)),- Some(Notice::Unlock) => app.unlock_prompt = Some(crate::UnlockPrompt::new(doc, None)),- // Flags the view: the tab closes at the top of the next frame, where no document- // borrow is held.- Some(Notice::Close) => {- if let Some(view) = app.views.get_mut(index) {- view.close_requested = true;- }- }- Some(Notice::Signatures) => app.right = Some(RightPanel::Signatures),- Some(Notice::FieldHighlights(on)) => app.view_defaults.highlight_fields = on,- Some(Notice::Console) => app.dialog = Some(crate::Dialog::JsConsole),- None => {}- }- // No dialog, close prompt or palette over the page: only then does page input count.- let unobstructed = !app.modal_open() && !app.palette_open;- let view = &mut app.views[index];- if view.organize {- organize_grid(view, doc, unobstructed, app.show_page_edge_shadows, ui, &t);- return;- }-- let avail = ui.available_rect_before_wrap();- view.viewport_w = avail.width();- view.viewport_h = avail.height();- let old_zoom = view.zoom;- view.fit_zoom(info);- if view.shown && view.zoom_anchor.is_none() && view.goto.is_none() && view.goto_point.is_none() && (view.zoom - old_zoom).abs() > 1e-4 {- let prev_viewport = view.viewport_screen;- let top_y = prev_viewport.min.y;- let anchor = view- .screen_rects- .iter()- .find(|(_, r)| r.min.y <= top_y && r.max.y > top_y)- .map(|(p, r)| {- let fy = if r.height() > 0.0 { ((top_y - r.min.y) / r.height()).clamp(0.0, 1.0) } else { 0.0 };- (*p, fy, 0.0f32)- })- .or_else(|| view.screen_rects.iter().find(|(_, r)| r.min.y >= top_y).map(|(p, r)| (*p, 0.0f32, (r.min.y - top_y).max(0.0))))- .or_else(|| view.screen_rects.last().map(|(p, r)| (*p, 1.0f32, (r.max.y - top_y).max(0.0))));- if let Some((page, fy, rel_y)) = anchor {- view.zoom_anchor = Some((page, 0.5, fy, vec2(avail.width() / 2.0, rel_y)));- } else {- view.zoom_anchor = Some((view.current, 0.5, 0.0, vec2(avail.width() / 2.0, MARGIN)));- }- }-- // Pinch / ctrl+scroll zoom, anchored on the current page.- let zoom_delta = crate::motion::zoom_delta(ui.ctx());- // Exclude the previous frame's scrollbar tracks from gesture activation.- let navigation_rect = if view.viewport_screen.is_positive() { avail.intersect(view.viewport_screen) } else { avail };- let navigation_enabled = app.dialog.is_none() && app.close_request.is_none() && !app.palette_open && ui.is_enabled() && ui.input(|i| i.focused);- if zoom_delta.is_finite() && zoom_delta > 0.0 && zoom_delta != 1.0 && navigation_enabled && ui.rect_contains_pointer(navigation_rect) {- let z = view.zoom * zoom_delta;- match ui.input(|i| i.pointer.hover_pos()) {- Some(p) => view.zoom_at(z, p),- None => view.set_zoom(z),- }- }- view.viewport_screen = avail;- let auto_delta = if unobstructed {- view.auto_scroll.update(ui, avail, false)- } else {- view.auto_scroll.cancel();- Vec2::ZERO- };-- // Drawing a comment: the pointer in a band along any edge (or just past it) scrolls the view- // that way, so a point beyond what is shown can be reached without letting go of the tool.- let edge_delta = if unobstructed && matches!(view.comments.gesture, Some(comments::Gesture::Draw { .. })) {- let (pointer, dt) = ui.input(|i| (if i.pointer.any_down() { i.pointer.latest_pos() } else { i.pointer.hover_pos() }, i.stable_dt));- crate::autoscroll::edge_scroll(pointer, avail, dt)- } else {- Vec2::ZERO- };- if edge_delta != Vec2::ZERO {- ui.ctx().request_repaint();- }-- let content_w = view.content_width(info, avail.width());- let rects = view.layout(info, content_w);- // When not scrolling continuously, only one row is shown at a time: the current page, or the- // current two-page spread (with the cover rule). These indices drive paging, which pages are- // drawn, and the content height (#752). Empty for a document with no pages.- let shown_row = |view: &DocView| -> Vec<usize> {- if rects.is_empty() {- return Vec::new();- }- let last = rects.len() - 1;- let cur = view.current.min(last);- match view.layout {- PageLayout::Single => vec![cur],- PageLayout::TwoUp if view.cover && cur == 0 => vec![0],- PageLayout::TwoUp => {- let first = if view.cover { cur - (cur + 1) % 2 } else { cur - cur % 2 };- if first < last { vec![first, first + 1] } else { vec![first] }- }- }- };- let row = shown_row(view);- let middle_gesture = view.auto_scroll.blocks_input();- // Not scrolling: when the whole page or spread fits, the wheel would do nothing, so it turns- // pages instead; zoomed in far enough to pan, it pans, and at the edge it turns the page on- // (#1924, `single_page_wheel_edge`). Touch drags are untouched: with- // nothing to pan, touch users turn pages with the rail buttons, the page box and the arrow- // keys. Runs before `visible_pages` so the frame that turns the page draws it.- let mut single_paging = false;- let mut edge_turned = false;- if !view.continuous {- // The row's bounding box on screen (one page, or a two-page spread).- let row_rect = row.iter().filter_map(|&i| rects.get(i)).copied().reduce(Rect::union);- // Within a point, so layout rounding can't stop a fitting page from turning.- let fits = row_rect.is_some_and(|r| r.height() + 2.0 * MARGIN <= avail.height() + 1.0);- let can_turn = !middle_gesture && unobstructed && ui.rect_contains_pointer(avail);- single_paging = can_turn && fits;- // Every wheel event goes to the pager, so it follows each trackpad touch to its end- // even while the page can't turn.- ui.input(|i| {- for e in &i.events {- if let egui::Event::MouseWheel { unit, delta, phase, modifiers } = e {- // Zooming (⌘ or Ctrl) and sideways scrolling (Shift) never turn pages.- let dy = if modifiers.command || modifiers.ctrl || modifiers.shift { 0.0 } else { delta.y };- if fits {- view.single_page_wheel(*unit, dy, *phase, i.time, can_turn);- } else {- edge_turned |= view.single_page_wheel_edge(*unit, dy, *phase, i.time, can_turn);- }- }- }- });- if single_paging {- // Paging owns vertical wheel motion here. A diagonal gesture keeps its sideways- // part, as `ScrollArea` itself handles each axis.- ui.input_mut(|i| i.smooth_scroll_delta.y = 0.0);- }- }- // Point input bypasses egui smoothing for 1:1 motion. Line input keeps egui's configured,- // smoothed base and adds only the accelerated surplus. While point suppression is active,- // reconstruct line and page input here so current coarse events survive without exposing an- // older eased tail.+ /// Point input bypasses egui smoothing for 1:1 motion. Line input keeps egui's configured, smoothed+ /// base and adds only the accelerated surplus. While point suppression is active, line and page+ /// input are reconstructed so current coarse events survive without exposing an older eased tail.+ fn read_wheel(ui: &mut egui::Ui, view: &mut DocView, avail: Rect, single_paging: bool, edge_turned: bool) -> Wheel {let now = ui.input(|i| i.time);let input = if ui.rect_contains_pointer(avail) {// Match the line distance used by egui's other scroll areas.@@@ -5288,1177 -2955,542 +2956,548 @@@ fn tool_selects_text(tool: QuickTool, p}}- /// A luminance preview for a monochrome print. `Color32` stores premultiplied pixels, so a- /// non-opaque colour's alpha is restored after multiplying the unmultiplied RGB by its- /// luminance. This uses the display gamma-space weights users expect in editors/print dialogs,- /// not the linear-light coefficients of a colour-managed render.- fn grayscale(mut img: egui::ColorImage) -> egui::ColorImage {- for c in img.pixels.iter_mut() {- let a = c.a();- let luminance = f32::from(c.r()) * 0.299_f32 + f32::from(c.g()) * 0.587_f32 + f32::from(c.b()) * 0.114_f32;- let gray = if a == 0 || a == 255 {- luminance.round() as u8- } else {- // Unmultiply first, so translucent content keeps its paper-relative luminance.- let f = f32::from(a) / 255.0;- let un = [f32::from(c.r()) / f, f32::from(c.g()) / f, f32::from(c.b()) / f];- let l = un[0] * 0.299_f32 + un[1] * 0.587_f32 + un[2] * 0.114_f32;- (f * l).round() as u8- };- *c = Color32::from_rgba_premultiplied(gray, gray, gray, a);+ /// Holds sharp re-renders while the zoom is still moving: a new scale every frame would cancel the+ /// in-flight full-page interpret and restart it, so on a heavy page (a CAD plot with ~1000 images+ /// renders for seconds) the sharp raster never arrives and the view looks stuck on a soft image.+ /// The stale raster stays stretched meanwhile; the sharp request goes out once the zoom settles.+ fn hold_sharp_renders(ui: &egui::Ui, view: &mut DocView, scale: f32) -> bool {+ let now_scale = ui.input(|i| i.time);+ if (scale - view.last_scale).abs() > f32::EPSILON {+ view.last_scale = scale;+ view.sharp_hold_until = now_scale + 0.35;+ ui.ctx().request_repaint_after(std::time::Duration::from_millis(380));}- img+ now_scale < view.sharp_hold_until}- #[cfg(test)]- mod tests {- #[test]- fn page_size_hint_zone_is_the_bottom_left_quadrant() {- let area = Rect::from_min_max(pos2(100.0, 50.0), pos2(500.0, 450.0));- assert!(in_size_hint_zone(area, pos2(110.0, 440.0)));- assert!(!in_size_hint_zone(area, pos2(110.0, 100.0)), "top-left");- assert!(!in_size_hint_zone(area, pos2(400.0, 440.0)), "bottom-right");- assert!(!in_size_hint_zone(area, pos2(50.0, 440.0)), "outside");- assert!(!in_size_hint_zone(area, pos2(f32::NAN, 440.0)));- }-- use super::*;-- #[test]- fn typed_zoom_percentages_parse() {- for (typed, zoom) in [("150", 1.5), ("150%", 1.5), (" 62.5 % ", 0.625), ("6400%", 64.0)] {- assert_eq!(DocView::parse_zoom_percent(typed), Some(zoom), "{typed}");- }- for typed in ["", "%", "abc", "0", "-50", "NaN", "inf", "1e40", "150%%x", "%150"] {- assert_eq!(DocView::parse_zoom_percent(typed), None, "{typed}");+ /// A destination's position (bookmarks, links) refines `goto`: its point at the window's top-left,+ /// or the centre of a /FitR rectangle at the window's centre.+ fn refine_goto_point(mut scroll: egui::ScrollArea, view: &mut DocView, geometry: &ScrollGeometry<'_>) -> egui::ScrollArea {+ let ScrollGeometry { rects, y_shift, content_w, content_h, avail, .. } = *geometry;+ if let Some((page, fx, fy, rel)) = view.goto_point.take() {+ let r = rects[page.min(rects.len() - 1)];+ // Within the content, so an unreachable point never shows a frame scrolled past the end.+ let (max_x, max_y) = ((content_w - avail.width()).max(0.0), (content_h - avail.height()).max(0.0));+ if let Some(fx) = fx {+ scroll = scroll.horizontal_scroll_offset((r.left() + fx * r.width() - rel.x).clamp(0.0, max_x));}- }-- /// A rotated (landscape) page is drawn as wide as the cell allows and centred in the picture- /// area, as Acrobat draws it, not as a small strip pinned to the top; a portrait page still- /// fills the area's height; neither covers the checkbox corner or the label below.- #[test]- fn grid_pages_are_centred_and_as_large_as_the_cell_allows() {- let cell = Rect::from_min_size(pos2(100.0, 50.0), vec2(190.0, 282.0));- let area = Rect::from_min_max(pos2(cell.left(), cell.top() + 16.0), pos2(cell.right(), cell.bottom() - 72.0));- let checkbox = Rect::from_min_size(cell.min + vec2(8.0, 8.0), Vec2::splat(20.0));- let landscape = grid_page_rect(cell, vec2(842.0, 595.0));- assert!((landscape.center().y - area.center().y).abs() < 0.01, "centred vertically: {landscape:?}");- assert!((landscape.center().x - cell.center().x).abs() < 0.01);- assert!((landscape.width() - (cell.width() - 32.0)).abs() < 0.01, "as wide as the cell allows: {landscape:?}");- assert!(!landscape.intersects(checkbox));- let portrait = grid_page_rect(cell, vec2(595.0, 842.0));- assert!(area.contains_rect(portrait), "inside the picture area: {portrait:?}");- assert!((portrait.center().y - area.center().y).abs() < 0.01);- assert!(portrait.left() >= checkbox.right(), "clear of the checkbox: {portrait:?}");- // Degenerate sizes still give a finite rectangle inside the cell.- for page in [vec2(0.0, 0.0), vec2(1e9, 1.0), vec2(1.0, 1e9), vec2(f32::NAN, 10.0), vec2(f32::INFINITY, 10.0)] {- let r = grid_page_rect(cell, page);- assert!(r.is_finite() && cell.contains_rect(r), "{page:?} -> {r:?}");+ if let Some(fy) = fy {+ scroll = scroll.vertical_scroll_offset((r.top() - y_shift + fy * r.height() - rel.y).clamp(0.0, max_y));}}+ scroll+ }- fn annotation(fill_sign: bool) -> pdfcraft_render::Annotation {- pdfcraft_render::Annotation {- page: 0,- subtype: "FreeText".into(),- author: None,- contents: Some("Hello".into()),- modified: None,- name: None,- in_reply_to: None,- rect: [0.0; 4],- color: None,- index: 0,- state: None,- quads: Vec::new(),- locked: false,- intent: None,- fill_sign,- }+ /// Draws the document tab at `index`: its notice bars, then its pages (or the Organize grid) in a+ /// scroll area with this frame's zoom, scrolling, tool input, overlays and render requests.+ pub fn document_area(app: &mut PdfCraftApp, index: usize, ui: &mut egui::Ui) {+ let t = Tokens::get(ui.ctx());+ // Keyboard scrolling applies to this frame's page view only, never later.+ let key_scroll = std::mem::take(&mut app.views[index].key_scroll);+ if key_scroll != 0.0 {+ app.views[index].end_find_following();}-- #[test]- fn hover_popup_skips_fill_and_sign_marks() {- assert_eq!(annotation_hover_text(&annotation(false)).as_deref(), Some("FreeText\nHello"));- assert_eq!(annotation_hover_text(&annotation(true)), None);+ // The Search panel closed: its search moves to the find bar.+ let search_open = app.right == Some(crate::RightPanel::Search);+ if let Some(f) = app.views[index].find.as_mut()+ && f.in_panel+ && !search_open+ {+ f.in_panel = false;}-- fn signature(signed: bool, visible: bool, page: Option<usize>, rect: Option<[f64; 4]>) -> pdfcraft_engine::SignatureInfo {- pdfcraft_engine::SignatureInfo {- field: "Signature1".into(),- signed,- page,- rect,- visible,- signer: None,- certificate: None,- chain: Vec::new(),- date: None,- signing_time: None,- reason: None,- location: None,- contact: None,- sub_filter: None,- doc_timestamp: false,- certify: None,- revision: 1,- signed_len: 0,- digest: None,- algorithm: None,- timestamp: false,- timestamp_time: None,- status: pdfcraft_engine::SignatureStatus::Valid,- modification: pdfcraft_engine::sign::Modification::None,- details: Vec::new(),- }+ if close_requested_tab(app, index) {+ return;}-- #[test]- fn signature_badges_keep_signed_visible_widgets_on_the_page() {- let rect = [10.0, 10.0, 100.0, 50.0];- let signatures =- vec![signature(true, true, Some(0), Some(rect)), signature(true, true, Some(1), Some(rect)), signature(true, true, Some(0), Some(rect))];- let badges = signature_badges(&signatures, 0);- assert_eq!(badges.len(), 2);- assert_eq!(badges[0].rect, rect);+ let Some(doc) = app.session.get(app.views[index].id) else { return };+ let info = &doc.info;+ let paper = app.session.reading_colors(app.views[index].id).and_then(|c| c.params).map_or(Color32::WHITE, |p| {+ let [r, g, b] = p.background;+ Color32::from_rgb(r, g, b)+ });+ if info.pages.is_empty() {+ app.views[index].auto_scroll.cancel();+ ui.centered_and_justified(|ui| ui.label(tl!("This document has no pages.")));+ return;}-- #[test]- fn signature_badges_skip_unsigned_invisible_and_unplaced_fields() {- let rect = [10.0, 10.0, 100.0, 50.0];- let signatures = vec![- signature(false, true, Some(0), Some(rect)),- signature(true, false, Some(0), Some(rect)),- signature(true, true, Some(0), None),- signature(true, true, Some(0), Some(rect)),- ];- let badges = signature_badges(&signatures, 0);- assert_eq!(badges.len(), 1);- assert_eq!(badges[0].rect, rect);+ // The print dialog queues its own rasters later in the frame. Closing it drops them.+ if app.dialog != Some(crate::Dialog::Print) {+ app.views[index].print_pages.clear();}-- #[test]- fn signature_badges_skip_rectangles_that_cannot_reach_the_screen() {- let hostile = vec![- [f64::NAN, 10.0, 100.0, 50.0],- [10.0, f64::INFINITY, 100.0, 50.0],- [10.0, 10.0, f64::NEG_INFINITY, 50.0],- [10.0, 10.0, 1e300, 50.0],- [10.0, 10.0, 100.0, 50.0],- ];- let signatures: Vec<_> = hostile.into_iter().map(|rect| signature(true, true, Some(0), Some(rect))).collect();- let badges = signature_badges(&signatures, 0);- assert_eq!(badges.len(), 1);+ // The Prepare a form panel is open (or a field tool is picked): fields are edited, not filled.+ let preparing = app.is_preparing();+ // Prepare a form ▸ Calculation order: the order's steps and links on the page.+ let calc_order = preparing && app.left_open && app.left == crate::LeftPanel::CalculationOrder;+ // Edit a PDF: added text and images can be selected, moved and edited.+ let editing_content =+ (app.left_open && app.left == crate::LeftPanel::Tool("edit")) || matches!(app.quick_tool, QuickTool::AddText | QuickTool::EditText);+ let text_style = app.text_style.clone();+ let show_secured_notice = app.show_secured_notice;+ let view = &mut app.views[index];+ // Opened without the owner password and something is restricted. The notice says so unless+ // the user turned it off (#4035): the restrictions themselves, and Document Properties ▸+ // Security, stay as they are.+ let secured = show_secured_notice && doc.security_summary().is_some_and(|s| !(s.owner || (s.permissions.modify() && s.permissions.assemble())));+ let repaired = !doc.repair_log().is_empty();+ let notice = notices(view, doc, secured, repaired, crate::sign_ui::banner(&doc.signatures), ui, &t);+ apply_notice(app, index, notice);+ let Some(doc) = app.session.get(app.views[index].id) else { return };+ let info = &doc.info;+ // No dialog, close prompt or palette over the page: only then does page input count.+ let modal = app.modal_open();+ let unobstructed = !modal && !app.palette_open;+ let organize_zoom = app.organize_zoom;+ let view = &mut app.views[index];+ if view.organize {+ // One remembered grid size for every document, kept in the settings.+ view.set_grid_zoom(organize_zoom);- organize_grid(view, info, doc.allows_assembly(), doc.dirty, unobstructed, ui, &t);++ organize_grid(view, doc, unobstructed, app.show_page_edge_shadows, ui, &t);+ app.organize_zoom = view.grid_zoom();+ return;}- #[test]- fn snapshot_tabs_read_like_their_source_plus_the_suffix() {- let snap = Snapshot { kind: SnapshotKind::SignedVersion, revision: 1, from: "report.pdf".into() };- assert_eq!(snapshot_tab_name("Report", "report.pdf", &snap), "Report (signed version)");- let rev = Snapshot { kind: SnapshotKind::Revision, revision: 2, from: "report.pdf".into() };- assert_eq!(snapshot_tab_name("Report", "report.pdf", &rev), "Report (revision 2)");- assert_eq!(snapshot_tab_name("report.pdf", "report.pdf", &snap), "report.pdf");- assert_eq!(snapshot_tab_name("report (revision 2).pdf", "report (revision 2).pdf", &rev), "report (revision 2).pdf");- }+ let avail = ui.available_rect_before_wrap();+ view.viewport_w = avail.width();+ view.viewport_h = avail.height();+ let old_zoom = view.zoom;+ view.fit_zoom(info);+ anchor_zoom_change(view, avail.width(), old_zoom);- #[test]- fn grayscale_converts_colours_to_their_luminance() {- let img = egui::ColorImage::new([2, 1], vec![Color32::from_rgb(255, 0, 0), Color32::from_rgba_premultiplied(0, 51, 102, 128)]);- let gray = grayscale(img);- let opaque = gray.pixels[0];- assert_eq!(opaque.to_array(), [76, 76, 76, 255]);- // Unmultiply RGB first, so a translucent colour keeps its paper-relative luminance.- let translucent = gray.pixels[1];- assert_eq!(translucent.to_array(), [42, 42, 42, 128]);- }+ // Pinch / ctrl+scroll zoom, anchored on the current page.+ let zoom_delta = crate::motion::zoom_delta(ui.ctx());+ // Exclude the previous frame's scrollbar tracks from gesture activation.+ let navigation_rect = if view.viewport_screen.is_positive() { avail.intersect(view.viewport_screen) } else { avail };+ let navigation_enabled = app.dialog.is_none() && app.close_request.is_none() && !app.palette_open && ui.is_enabled() && ui.input(|i| i.focused);+ let present = presentation_click_state(ui, view, navigation_rect, navigation_enabled && app.quick_tool == QuickTool::Select);+ pinch_zoom(ui, view, zoom_delta, navigation_rect, navigation_enabled);+ view.viewport_screen = avail;+ let (auto_delta, edge_delta) = auto_scroll_deltas(ui, view, avail, unobstructed);- #[test]- fn black_white_and_transparents_are_preserved_by_grayscale() {- let img = egui::ColorImage::new([3, 1], vec![Color32::BLACK, Color32::WHITE, Color32::TRANSPARENT]);- let gray = grayscale(img);- assert_eq!(gray.pixels[0].to_array(), [0, 0, 0, 255]);- assert_eq!(gray.pixels[1].to_array(), [255, 255, 255, 255]);- assert_eq!(gray.pixels[2].to_array(), [0, 0, 0, 0]);- }+ let content_w = view.content_width(info, avail.width());+ let rects = view.layout(info, content_w, ui.ctx().pixels_per_point());+ // When not scrolling continuously, only one row is shown at a time: the current page, or the+ // current two-page spread (with the cover rule). These indices drive paging, which pages are+ // drawn, and the content height (#752). Empty for a document with no pages.+ let row = shown_row(view, &rects);+ let middle_gesture = view.auto_scroll.blocks_input();+ // Not scrolling: when the whole page or spread fits, the wheel would do nothing, so it turns+ // pages instead; zoomed in far enough to pan, it pans, and at the edge it turns the page on+ // (#1924, `single_page_wheel_edge`). Touch drags are untouched: with+ // nothing to pan, touch users turn pages with the rail buttons, the page box and the arrow+ // keys. Runs before `visible_pages` so the frame that turns the page draws it.+ let (single_paging, edge_turned) = single_page_paging(ui, view, &PagingCx { row: &row, rects: &rects, avail, middle_gesture, unobstructed });+ // Point input bypasses egui smoothing for 1:1 motion. Line input keeps egui's configured,+ // smoothed base and adds only the accelerated surplus. While point suppression is active,+ // reconstruct line and page input here so current coarse events survive without exposing an+ // older eased tail.+ let now = ui.input(|i| i.time);+ let Wheel { precise_scroll, line_base, boost_extra, has_page, paging_owns_vertical } = read_wheel(ui, view, avail, single_paging, edge_turned);+ let animates = app.animation_effects.animates(app.motion.reduced);+ let may_glide = !paging_owns_vertical && !middle_gesture && navigation_enabled && unobstructed && animates;+ let wheel_scrolled = precise_scroll != Vec2::ZERO || line_base != Vec2::ZERO || boost_extra != Vec2::ZERO || has_page;+ let motion = GlideCx { now, may_glide, key_scroll, auto_delta, zoom_delta, edge_delta, wheel_scrolled };+ let glide = step_glide(ui, view, avail, &motion);+ // The wheel may have turned the page above: draw the row it turned to. Measured from the old+ // row, the jump to the new page scrolled both out of view, a blank frame on every turn forward.+ let row = shown_row(view, &rects);+ let visible_pages: Vec<usize> = if view.continuous { (0..rects.len()).collect() } else { row.clone() };+ let (y_shift, content_h) = if view.continuous {+ (0.0, rects.iter().map(|r| r.bottom()).reduce(f32::max).map(|bottom| bottom + MARGIN).unwrap_or(0.0))+ } else {+ // Only the current row scrolls into view; the content is its bounding box plus margins.+ match row.iter().filter_map(|&i| rects.get(i)).copied().reduce(Rect::union) {+ Some(r) => (r.top() - MARGIN, r.height() + 2.0 * MARGIN),+ None => (0.0, 0.0),+ }+ };- #[test]- fn rendered_rasters_become_texture_images_without_a_copy() {- let pdf = b"%PDF-1.4- 1 0 obj << /Type /Catalog /Pages 2 0 R >> endobj- 2 0 obj << /Type /Pages /Kids [3 0 R] /Count 1 >> endobj- 3 0 obj << /Type /Page /Parent 2 0 R /MediaBox [0 0 100 50] /Contents 4 0 R >> endobj- 4 0 obj << /Length 35 >> stream- 0 0 1 rg 10 10 30 20 re f- endstream endobj- trailer << /Root 1 0 R >>- %%EOF";- let mut r = pdfcraft_render::PageRenderer::new(Arc::new(pdf.to_vec()), Default::default());- let out = r.render(RenderRequest { page: 0, kind: RequestKind::Pixels, tile: None, scale: 1.5, tag: 0, preview: false });- assert!(out.error.is_none(), "{:?}", out.error);- let size = [out.width as usize, out.height as usize];- let copied = egui::ColorImage::from_rgba_premultiplied(size, &out.rgba);- let at = out.rgba.as_ptr();- let img = texture_image(size, out.rgba);- assert_eq!(img, copied);- assert_eq!(img.pixels.as_ptr().cast::<u8>(), at, "the renderer's own buffer");+ let mut scroll = page_scroll_area(+ ui,+ view,+ &ScrollGeometry { rects: &rects, y_shift, content_w, content_h, avail, middle_gesture, hand: app.quick_tool == QuickTool::Hand },+ );+ let ppp = ui.ctx().pixels_per_point();+ let scale = view.render_scale(ppp);+ let tag = scale_tag(scale);+ // Hold sharp re-renders while the zoom is still moving: a new scale every frame would+ // cancel the in-flight full-page interpret and restart it, so on a heavy page (a CAD+ // plot with ~1000 images renders for seconds) the sharp raster never arrives and the+ // view looks stuck on a soft image. The stale raster stays stretched meanwhile; the+ // sharp request goes out once the zoom settles.+ let sharp_held = hold_sharp_renders(ui, view, scale);+ view.current_scale_tag = tag;+ let hand = app.quick_tool == QuickTool::Hand;+ let tool = app.quick_tool;+ // Text selection runs for the Select tool and for the markup tools (highlight…).+ let selects_text = tool_selects_text(tool, preparing);+ let prefs = &app.comment_prefs;+ let redact_mark = (app.redact_prefs.hover_fill, app.redact_prefs.opacity);+ let units = app.units;+ let allowed = doc.allows_annotation();+ let can_copy = doc.allows_copying();+ let comments_hidden = doc.comments_hidden();+ let form = doc.form.clone();+ let generation = doc.edit_generation();+ let can_fill = doc.allows_form_filling();+ let can_crop = doc.allows_assembly();+ let signature = app.signature.clone();+ let initials = app.initials.clone();+ let author = app.comment_prefs.author.clone();+ let today = app.session.today();+ // In Preferences ▸ Date format, or why it can't be stamped into the PDF.+ let date_text = crate::date_text_for_pdf(&app.session);+ let by_line = app.session.stamp_by_line(&author);+ let custom_stamp = match app.quick_tool {+ QuickTool::CustomStamp(i) => app.custom_stamps.get(i).cloned(),+ _ => None,+ };+ let mut open_props: Option<(usize, usize)> = None;+ // The table being set up in its window, shown on its own document's page.+ let table_preview = app.field_table_draft.as_mut().filter(|d| d.doc == view.id).and_then(|d| Some(d.preview(info.pages.get(d.page)?, &form)));+ let can_modify = doc.allows_modification();+ if preparing {+ crate::prepare::after_refresh(view, &form);+ } else {+ view.prepare.selected = None;}-- #[test]- fn tiles_stay_granular_up_close_and_cover_giant_sheets_in_a_handful() {- // Ordinary zooms keep 1024 px tiles; degenerate scales fall back to it, never zero.- assert_eq!(tile_side(1.0, 2000), TILE);- assert_eq!(tile_side(4.0, 2000), TILE);- assert_eq!(tile_side(f32::NAN, 2000), TILE);- assert_eq!(tile_side(f32::INFINITY, 2000), TILE);- assert_eq!(tile_side(0.0, 2000), TILE);- // Zoomed viewports need a few large tiles instead of many small ones.- assert_eq!(tile_side(12.0, 2000), 2048);- assert_eq!(tile_side(20.0, 2000), 3413);- assert_eq!(tile_side(100.0, 2000), 4096);- // A giant sheet at fit width (6740 px long side) is covered four tiles a side.- assert_eq!(tile_side(96.0 / 72.0, 6740), 1685);- // The backend clamps tile sides at 4096.- assert_eq!(tile_side(20.0, 100_000), 4096);+ view.objects.prepare(doc, tool == QuickTool::EditText && can_modify, ui.ctx());+ view.text_background.prepare(ui.ctx(), doc, view.line_editor.as_ref(), view.content.draft.as_ref(), scale);+ let added = if editing_content { doc.added().to_vec() } else { Vec::new() };+ let doc_links = if tool == QuickTool::Link { doc.links().to_vec() } else { Vec::new() };+ if editing_content {+ crate::content_ui::after_refresh(view, &added);+ } else {+ view.content.selected = None;}+ view.move_background.prepare(ui.ctx(), doc, &view.content, scale);- #[test]- fn grid_zoom_is_clamped_and_sharp_renders_tolerate_a_pinch() {- assert!(sharp_enough(900, 876.0) && sharp_enough(800, 876.0) && sharp_enough(1300, 876.0));- assert!(!sharp_enough(264, 876.0), "a thumbnail stretched over a zoomed page");- assert!(!sharp_enough(876, 200.0), "far larger than drawn: wasteful");- assert!(!sharp_enough(100, 0.0) && !sharp_enough(100, f32::NAN));- let mut v = view(3, PageLayout::Single, true);- for odd in [f32::NAN, f32::INFINITY] {- v.set_grid_zoom(odd);- assert_eq!(v.grid_zoom(), 1.0);- }- v.set_grid_zoom(99.0);- assert_eq!(v.grid_zoom(), 3.0);- v.set_grid_zoom(-4.0);- assert_eq!(v.grid_zoom(), 0.5);+ scroll = refine_goto_point(scroll, view, &ScrollGeometry { rects: &rects, y_shift, content_w, content_h, avail, middle_gesture, hand });+ let selection_wheel = view.selection_drag && navigation_enabled && unobstructed && !single_paging && ui.rect_contains_pointer(avail);+ let env = PageEnv {+ added: &added,+ allowed,+ author: &author,+ auto_delta,+ avail,+ boost_extra,+ by_line: &by_line,+ calc_order,+ can_copy,+ can_crop,+ can_fill,+ can_modify,+ comments_hidden,+ content_h,+ content_w,+ custom_stamp: &custom_stamp,+ date_text: &date_text,+ doc,+ doc_links: &doc_links,+ edge_delta,+ editing_content,+ form: &form,+ generation,+ glide,+ hand,+ info,+ initials: &initials,+ key_scroll,+ middle_gesture,+ modal,+ navigation_enabled,+ paper,++ show_page_edge_shadows: app.show_page_edge_shadows,+ ppp,+ precise_scroll,+ prefs,+ preparing,+ rects: &rects,+ redact_mark,+ scale,+ selection_wheel,+ selects_text,+ signature: &signature,+ single_paging,+ t: &t,+ table_preview: &table_preview,+ tag,+ text_style: &text_style,+ tool,+ units,+ unobstructed,+ visible_pages: &visible_pages,+ y_shift,+ fill_text_size: app.fill_text_size,+ fill_text_color: app.fill_text_color,+ today,+ };+ let mut page_out = PageOut::default();++ let fade_strength = ui.spacing().scroll.fade.strength;++ if !app.show_page_edge_shadows {++ ui.spacing_mut().scroll.fade.strength = 0.0;+ }+ let out = page_scroll(ui, scroll, egui::Id::unique(("page-view-scope", view.id)), |ui, viewport| {+ draw_pages(ui, viewport, view, &env, &mut page_out, &mut app.signature_preview)+ });++ ui.spacing_mut().scroll.fade.strength = fade_strength;+ let PageOut {+ canvas_action,+ clicked_link,+ mut copy_selected,+ field_menu,+ field_placed,+ mut field_props,+ hover_text,+ mut image_action,+ open_boxes,+ open_initials,+ open_signature,+ open_table,+ primary_down,+ mut refused,+ stamp_placed,+ } = page_out;+ view.single_edges = visible_pages.first().copied().filter(|_| !view.continuous).map(|page| {+ // At the top once the page's top edge shows where going to a page puts it (a gap+ // below the window's top). Within a point, as for wheel paging, so layout rounding+ // can't hide an edge.+ let max_y = (out.content_size.y - out.inner_rect.height()).max(0.0);+ (page, out.state.clamped_offset().y <= MARGIN - view.page_gap() + 1.0, out.state.clamped_offset().y >= max_y - 1.0)+ });- fn view(pages: usize, layout: PageLayout, continuous: bool) -> DocView {- let info = pdfcraft_render::DocInfo {- pages: (0..pages)- .map(|_| pdfcraft_render::PageInfo { width: 300.0, height: 400.0, label: String::new(), crop: [0.0, 0.0, 300.0, 400.0], rotation: 0 })- .collect(),- ..Default::default()- };- DocView::new(DocId(1), &info, ViewDefaults { layout, continuous, ..Default::default() })+ view.viewport_screen = out.inner_rect;+ view.auto_scroll.paint(ui, avail);+ if unobstructed && matches!(tool, QuickTool::Select | QuickTool::ColumnSelect) {+ copy_selected |= selection_actions(ui, avail, view, info, prefs, allowed && !comments_hidden, can_copy);}- fn history_search_view() -> DocView {- let mut v = view(5, PageLayout::Single, true);- v.texts.insert(- 3,- pdfcraft_render::PageText {- glyphs: vec![pdfcraft_render::TextGlyph {- text: "match".into(),- rect: [20.0, 260.0, 60.0, 280.0],- quad: [[20.0, 260.0], [60.0, 260.0], [60.0, 280.0], [20.0, 280.0]],- direction: [1.0, 0.0],- }],- line_of: vec![0],- space_before: vec![false],- }- .into(),- );- v.find = Some(Find { matches: vec![(3, 0..1), (3, 0..1), (1, 0..1)], current: Some(2), ..Default::default() });- v- }+ // Collect all main-page demand, including cached surfaces, for byte admission later.+ // Pan-settle debounce for tiled pages: each tile costs a full page interpret, so holding+ // fresh tiles back while the scroll offset is still moving keeps a drag on the stretched+ // backdrop/older tiles instead of queueing a storm of interprets (one per frame) that+ // the workers cannot cancel mid-operator. Fresh tiles go out once the pan settles;+ // pages with nothing on screen yet still queue.+ let pan_held = track_scroll(ui, view, &out, glide);+ plan_renders(ui, view, info, out.inner, &RenderPlan { visible_pages: &visible_pages, tag, scale, sharp_held, pan_held, hand });- #[test]- fn explicit_search_jumps_record_history_and_keep_match_destination() {- for step in [None, Some(true), Some(false)] {- let mut v = history_search_view();- v.page_input = "draft in progress".into();- v.goto_point = Some((3, Some(0.8), Some(0.9), Vec2::ZERO));- if let Some(forward) = step {- v.find_step(forward);- } else {- v.go_to_match(0);- }- assert_eq!(v.back, vec![0], "explicit search jump must remember its origin");- assert_eq!(v.goto, Some((3, 0.5)), "keep the match offset instead of the page top");- assert_eq!(v.current, 3);- assert_eq!(v.current_page_label(None), "4");- // Chrome refreshes the idle page box; navigation must not overwrite a draft- // that may still be focused. DocView does not own the editor's focus state.- assert_eq!(v.page_input, "draft in progress");- assert!(v.goto_point.is_none(), "an earlier link destination cannot override the search offset");- v.go_to_match(1);- assert_eq!(v.back, vec![0], "same-page matches do not duplicate history");- assert!(v.view_history(false));- assert_eq!(v.current, 0);- assert!(v.view_history(true));- assert_eq!(v.current, 3);- assert!(v.view_history(false));- v.go_to_match(2);- assert!(v.forward.is_empty(), "a new explicit jump discards Forward");- assert_eq!(v.back, vec![0]);- }+ let text_done = frame_overlays(ui, view, &env, primary_down, hover_text);+ if let Some(why) = view.objects.notice.take() {+ refused = Some(why);}-- #[test]- fn automatic_search_updates_do_not_record_history_or_discard_forward() {- let mut v = history_search_view();- v.forward = vec![4];- v.find = Some(Find { query: "match".into(), ..Default::default() });- v.rerun_find();- assert_eq!(v.current, 3);- assert_eq!(v.goto, Some((3, 0.5)));- assert!(v.back.is_empty());- assert_eq!(v.forward, vec![4]);- v.current = 0;- v.find.as_mut().unwrap().current = None;- v.refresh_find_page(3);- assert_eq!(v.current, 3);- assert!(v.back.is_empty());- assert_eq!(v.forward, vec![4]);+ let form_notice = view.forms.notice.take();+ // One crop, then back to selecting (as Acrobat does).+ let cropped = view.pending_edit.as_ref().is_some_and(|e| matches!(e, pdfcraft_engine::Edit::SetPageBox { .. }));+ let mut tool = app.quick_tool;+ comments::keys(ui.ctx(), view, &mut tool, allowed);+ if preparing {+ crate::prepare::keys(ui.ctx(), view);}-- #[test]- fn text_layers_evict_far_pages_but_keep_visible_and_matches() {- let info = thumbnail_info(100);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- v.current = 50;- v.frame_visible = HashSet::from([50, 51]);- for p in 0..100 {- v.texts.insert(p, Arc::new(PageText::default()));- }- v.text_failed.insert(0);- v.text_failed.insert(99);- v.find = Some(Find { matches: vec![(0, 0..1)], ..Default::default() });- let _ = v.prepare_render_queue(&info, 1.0);- assert!(v.texts.contains_key(&50) && v.texts.contains_key(&51), "visible pages stay");- assert!(v.texts.contains_key(&0), "matched pages stay");- assert!(v.texts.contains_key(&49), "nearest prefetch window stays");- assert!(!v.texts.contains_key(&99), "far pages go");- assert_eq!(v.texts.len(), 2 + 1 + MAX_CACHED_TEXT_PAGES, "visible + matched + prefetch window");- assert!(v.text_failed.contains(&0) && v.text_failed.contains(&99), "failures are bytes-free: never evict");+ if editing_content {+ crate::content_ui::keys(ui.ctx(), view);}-- #[test]- fn text_layers_keep_the_selection_page() {- let info = thumbnail_info(100);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- let text = PageText {- glyphs: vec![pdfcraft_render::TextGlyph { text: "x".into(), rect: [0.0, 0.0, 10.0, 10.0], quad: [[0.0, 0.0]; 4], direction: [1.0, 0.0] }],- line_of: vec![0],- space_before: vec![false],- };- for p in 0..100 {- v.texts.insert(p, Arc::new(text.clone()));- }- v.select_text(0, 0, 0);- v.current = 90;- v.frame_visible = HashSet::from([90, 91]);- let _ = v.prepare_render_queue(&info, 1.0);- assert_eq!(v.selected_text().as_deref(), Some("x"), "stale selections still copy");+ if tool == QuickTool::Link {+ crate::link_ui::keys(ui.ctx(), view);+ } else {+ view.links.selected = None;}-- #[test]- fn text_layers_stay_while_a_search_is_active() {- let info = thumbnail_info(100);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- v.current = 50;- v.frame_visible = HashSet::from([50]);- for p in 0..100 {- v.texts.insert(p, Arc::new(PageText::default()));- }- v.find = Some(Find { query: "dup".into(), case_query: "dup".into(), matches: vec![(0, 0..1)], ..Default::default() });- let _ = v.prepare_render_queue(&info, 1.0);- assert_eq!(v.texts.len(), 100, "evicting mid-search would churn the workers");+ if stamp_placed {+ tool = QuickTool::Select;}-- fn thumbnail_info(count: usize) -> DocInfo {- DocInfo {- pages: (0..count)- .map(|i| {- let (width, height) = match i % 3 {- 0 => (612.0, 792.0),- 1 => (200.0, 4000.0),- _ => (4000.0, 200.0),- };- pdfcraft_render::PageInfo { width, height, label: (i + 1).to_string(), crop: [0.0, 0.0, width, height], rotation: 0 }- })- .collect(),- ..Default::default()- }+ // Text: each click on the page starts a box (#74); Done in the editor goes back to selecting.+ if text_done && tool == QuickTool::AddText {+ tool = QuickTool::Select;}-- #[test]- fn ten_thousand_pages_only_demand_viewport_and_prefetch_at_both_densities() {- let info = thumbnail_info(10_000);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- let cols = 4;- let rows = info.pages.len().div_ceil(cols);- for ppp in [1.0, 2.0] {- for row in [0, 1234, rows - 1] {- v.begin_render_frame();- let range = thumbnail_rows(row as f32 * 250.0, row as f32 * 250.0 + 750.0, 250.0, rows);- for p in range.start * cols..(range.end * cols).min(info.pages.len()) {- v.need_thumbnail(p, p / cols == row);- }- let queue = v.prepare_render_queue(&info, ppp);- assert!(queue.len() <= 5 * cols, "only three visible rows and two prefetch rows");- assert_eq!(queue.first().unwrap().page / cols, row, "visible cells precede prefetch");- let bytes: usize = queue- .iter()- .map(|r| {- let p = &info.pages[r.page];- let (w, h) = (device_pixels(p.width, r.scale), device_pixels(p.height, r.scale));- assert!(w <= (THUMB_W * ppp).ceil() as u32);- assert!(h <= (THUMB_H * ppp).ceil() as u32);- rgba_bytes(w as usize, h as usize)- })- .sum();- assert!(bytes <= THUMB_BYTES);- assert_eq!(queue, v.prepare_render_queue(&info, ppp), "unchanged demand reconstructs the same work");- }- }+ // One field, then back to selecting (Acrobat's default without "Keep tools pinned").+ if field_placed {+ tool = QuickTool::Select;}-- #[test]- fn oversized_thumbnail_viewport_scales_all_admitted_cells_to_one_budget() {- let info = thumbnail_info(10_000);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- for page in 0..MAX_THUMB_DEMAND {- v.need_thumbnail(page, true);- }- let queue = v.prepare_render_queue(&info, 2.0);- assert_eq!(queue.len(), MAX_THUMB_DEMAND);- let bytes: usize = queue- .iter()- .map(|r| {- let p = &info.pages[r.page];- rgba_bytes(device_pixels(p.width, r.scale) as usize, device_pixels(p.height, r.scale) as usize)- })- .sum();- assert!(bytes <= THUMB_BYTES);+ if matches!(field_menu, Some(FieldMenu::Properties)) {+ field_props = true;}-- fn solid_result(request: RenderRequest, w: u32, h: u32) -> pdfcraft_render::RenderedPage {- pdfcraft_render::RenderedPage {- request,- width: w,- height: h,- rgba: pdfcraft_render::Pixels::from(vec![u32::MAX; rgba_bytes(w as usize, h as usize) / 4]),- text: None,- error: None,- warnings: Vec::new(),- millis: 0,+ let field_props = field_props.then(|| view.prepare.selected.clone()).flatten();+ match canvas_action {+ Some(comments::CanvasAction::Edit(e)) => view.pending_edit = Some(*e),+ // `choose_right_panel` would borrow all of `app` while `view` is held; same effect.+ Some(comments::CanvasAction::OpenComments) => {+ app.right = Some(RightPanel::Comments);+ app.comments_panel_closed = false;}+ Some(comments::CanvasAction::Properties(p, i)) => open_props = Some((p, i)),+ Some(comments::CanvasAction::CopyImage(p, i)) => image_action = Some(crate::edit_text_ui::ImageAction::Copy(p, i)),+ Some(comments::CanvasAction::CopyImageFile(p, i)) => image_action = Some(crate::edit_text_ui::ImageAction::CopyFile(p, i)),+ None => {}}-- /// #3149: the replacement dialog commits after the canvas collected this frame's demand.- #[test]- fn replacing_a_page_after_layout_never_uploads_an_oversized_texture() {- let ctx = egui::Context::default();- ctx.input_mut(|i| i.max_texture_side = 2048);- let mut app = PdfCraftApp::new();- let original = app.session.create_blank(200.0, 300.0, 1).unwrap();- let replacement = app.session.create_blank(400.0, 500.0, 1).unwrap();- app.open_bytes("original.pdf", None, original.as_ref().clone()).unwrap();- let request = RenderRequest { scale: 4.7, tag: scale_tag(4.7), ..Default::default() };- app.views[0].frame_queue = vec![request];- app.views[0].frame_visible.insert(0);- assert!(app.apply_edit(Edit::ReplacePages { pages: vec![0], name: "replacement.pdf".into(), bytes: replacement, src_pages: vec![0] }));- let doc = app.session.get(app.views[0].id).unwrap();- assert_eq!((doc.info.pages[0].width, doc.info.pages[0].height), (400.0, 500.0));- let edited_bytes = doc.bytes.clone();- let pool = RenderPool::new_inline(doc.display.clone(), Default::default());- app.views[0].finish_render_frame(&ctx, &doc.info, &pool);- assert!(app.views[0].last_queue.is_empty(), "old geometry must not reach the replacement renderer");-- // The next layout can render a bounded backdrop and sharp tiles at the same zoom.- let backdrop = RenderRequest { scale: 2048.0 / 500.0, tag: scale_tag(2048.0 / 500.0), ..request };- let tile = RenderRequest { tile: Some(Tile { x: 0, y: 0, w: 1024, h: 1024 }), ..request };- for _ in 0..2 {- let view = &mut app.views[0];- view.begin_render_frame();- view.frame_visible.insert(0);- view.frame_queue = vec![backdrop, tile];- view.finish_render_frame(&ctx, &doc.info, &pool);- }- let view = &app.views[0];- assert_eq!(view.pages.get(&0).unwrap().tex.size(), [1639, 2048]);- assert_eq!(view.tiles.get(&(0, tile.tag, 0, 0)).unwrap().size(), [1024, 1024]);- assert!(view.errors.is_empty());- assert_eq!(doc.bytes, edited_bytes, "rendering preserves the unsaved edit");- assert!(doc.dirty);- assert_eq!(doc.can_undo(), Some("Replace page"));+ schedule_presentation_turn(ui, view, present, clicked_link.is_some());+ let remote_open = follow_link(app, index, clicked_link);+ if tool == QuickTool::Crop && cropped {+ tool = QuickTool::Select;}+ let tool = finish_sign_requests(app, index, tool);+ app.quick_tool = tool;+ let requests = FrameRequests {+ open_props,+ field_props,+ field_menu,+ image_action,+ refused,+ open_signature,+ open_initials,+ open_boxes,+ open_table,+ form_notice,+ copy_selected,+ remote_open,+ form,+ generation,+ avail,+ };+ apply_frame_requests(app, index, ui, requests);+ }- #[test]- fn oversized_raster_results_do_not_replace_cached_textures() {- let ctx = egui::Context::default();- ctx.input_mut(|i| i.max_texture_side = 64);- for request in [- RenderRequest::default(),- RenderRequest { tag: THUMB_TAG, ..Default::default() },- RenderRequest { tag: GRID_TAG, ..Default::default() },- RenderRequest { tag: PRINT_TAG, ..Default::default() },- RenderRequest { tile: Some(Tile { x: 0, y: 0, w: 64, h: 32 }), ..Default::default() },- ] {- let mut view = DocView::new(DocId(1), &thumbnail_info(1), ViewDefaults::default());- view.last_queue = vec![request];- let texture = |v: &DocView| {- v.pages- .values()- .map(|p| &p.tex)- .chain(v.thumbs.values().map(|p| &p.tex))- .chain(v.grid_pages.values().map(|(_, t)| t))- .chain(v.print_pages.values().map(|(_, t)| t))- .chain(v.tiles.values())- .map(|t| (t.id(), t.size()))- .collect::<Vec<_>>()- };- assert_eq!(view.receive_result(&ctx, solid_result(request, 64, 32)), 64 * 32 * 4);- let cached = texture(&view);- assert_eq!(cached.len(), 1);- for (w, h) in [(65, 32), (32, 65), (65, 65), (0, 32), (32, 0)] {- assert_eq!(view.receive_result(&ctx, solid_result(request, w, h)), 0, "{request:?}: {w}x{h}");- assert_eq!(texture(&view), cached, "an invalid result must keep the previous raster");- }- assert_eq!(view.receive_result(&ctx, solid_result(request, 32, 64)), 32 * 64 * 4);- assert_eq!(texture(&view)[0].1, [32, 64], "valid results still make progress");- }- }+ /// What the frame's input asked the app to do, once the document is no longer borrowed.+ struct FrameRequests {+ open_props: Option<(usize, usize)>,+ field_props: Option<(String, usize)>,+ field_menu: Option<FieldMenu>,+ image_action: Option<crate::edit_text_ui::ImageAction>,+ refused: Option<String>,+ open_signature: bool,+ open_initials: bool,+ open_boxes: bool,+ open_table: Option<(usize, [f64; 4])>,+ form_notice: Option<crate::forms_ui::FormNotice>,+ copy_selected: bool,+ remote_open: Option<(pdfcraft_engine::DocId, String, pdfcraft_render::RemoteDestination)>,+ form: Arc<Vec<pdfcraft_engine::FormField>>,+ generation: u64,+ avail: Rect,+ }- #[test]- fn thumbnails_release_on_scroll_panel_close_and_request_again_after_eviction() {- let ctx = egui::Context::default();- let info = thumbnail_info(10_000);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- v.need_thumbnail(0, true);- let first = v.prepare_render_queue(&info, 1.0);- v.last_queue = first.clone();- assert_eq!(v.receive_result(&ctx, solid_result(first[0], 132, 171)), 132 * 171 * 4);- assert!(v.prepare_render_queue(&info, 1.0).is_empty());- v.begin_render_frame();- v.need_thumbnail(9999, true);- v.prepare_render_queue(&info, 1.0);- assert!(v.thumbs.is_empty(), "jump releases old handles");- v.begin_render_frame();- v.need_thumbnail(0, true);- assert_eq!(v.prepare_render_queue(&info, 1.0), first, "an evicted result must be requested again");- v.begin_render_frame();- assert!(v.prepare_render_queue(&info, 1.0).is_empty(), "closing consumers cancels thumbnail work");+ /// Opens the dialogs and runs the app commands the frame asked for.+ fn apply_frame_requests(app: &mut PdfCraftApp, index: usize, ui: &mut egui::Ui, requests: FrameRequests) {+ let FrameRequests {+ open_props,+ field_props,+ field_menu,+ image_action,+ refused,+ open_signature,+ open_initials,+ open_boxes,+ open_table,+ form_notice,+ copy_selected,+ remote_open,+ form,+ generation,+ avail,+ } = requests;+ if let Some((page, at)) = app.views[index].comments.attach_at.take() {+ app.attach_file_comment(page, at);}-- #[test]- fn stale_results_are_rejected_before_conversion_after_dpi_invalidation_and_suspend() {- let ctx = egui::Context::default();- let info = thumbnail_info(1);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- v.need_thumbnail(0, true);- let first = v.prepare_render_queue(&info, 1.0)[0];- v.last_queue = v.prepare_render_queue(&info, 2.0);- // Valid pixels: only the request gate can keep these out (a size check can't).- let obsolete = || solid_result(first, 132, 171);- assert_eq!(v.receive_result(&ctx, obsolete()), 0);- assert!(v.thumbs.is_empty(), "a result for the old DPI is not uploaded");- // The same result is uploaded while its request is current.- v.last_queue = vec![first];- assert_eq!(v.receive_result(&ctx, obsolete()), 132 * 171 * 4);- v.thumbs.clear();- v.invalidate_content();- assert_eq!(v.receive_result(&ctx, obsolete()), 0);- assert!(v.thumbs.is_empty(), "nor after the content changed");- let pool = RenderPool::new_inline(Arc::new(Vec::new()), Default::default());- v.last_queue = vec![first];- v.suspend_rendering(&pool);- assert_eq!(v.receive_result(&ctx, obsolete()), 0);- assert!(v.thumbs.is_empty(), "nor after the tab was suspended");+ if let Some((p, i)) = open_props {+ app.open_comment_props(p, i);}-- #[test]- fn editing_after_layout_preserves_stale_page_until_replacement() {- let ctx = egui::Context::default();- let info = thumbnail_info(1);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- let req = RenderRequest { scale: 1.0, tag: 1000, ..Default::default() };- v.last_queue = vec![req];- v.receive_result(&ctx, solid_result(req, 10, 10));- v.frame_queue = vec![req];- v.page_changed(0);- assert_eq!(v.prepare_render_queue(&info, 1.0), vec![req]);- assert_eq!(v.pages.get(&0).unwrap().tag, STALE_TAG);+ if let Some((p, i)) = app.views[index].comments.default_request.take() {+ app.make_comment_default(p, i);}-- /// #1858: a released drawing stays painted from its points until a raster that has it- /// arrives. A page raster that lands before the drawing's edit is applied (in full screen the- /// edit waits for the next frame, and a render already under way can finish first) is of the- /// document without it, and must not end the preview.- #[test]- fn a_raster_from_before_a_drawing_is_committed_keeps_it_drawn() {- let ctx = egui::Context::default();- let info = thumbnail_info(1);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- let req = RenderRequest { scale: 1.0, tag: 1000, ..Default::default() };- v.comments.settle(0.0, 0, crate::comments::CommentTool::Ink, &[[10.0, 10.0], [40.0, 30.0]]);- v.last_queue = vec![req];- assert!(v.receive_result(&ctx, solid_result(req, 10, 10)) > 0, "the raster is taken");- assert_eq!(v.comments.settling_len(), 1, "a raster from before the commit doesn't have the stroke");- v.comments.drawings_committed();- v.last_queue = vec![req];- assert!(v.receive_result(&ctx, solid_result(req, 10, 10)) > 0);- assert_eq!(v.comments.settling_len(), 0, "a raster after the commit draws it");- // An edit that fails leaves nothing to wait for.- v.comments.settle(0.0, 0, crate::comments::CommentTool::Ink, &[[10.0, 10.0], [40.0, 30.0]]);- v.comments.drawings_refused();- assert_eq!(v.comments.settling_len(), 0, "a refused drawing isn't left painted");+ if let Some((p, i, open)) = app.views[index].comments.attachment_request.take() {+ let doc = app.views[index].id;+ app.comment_attachment_action(doc, p, i, open);}-- #[test]- fn page_and_tile_admission_accounts_for_bytes_before_count_limits() {- let mut info = thumbnail_info(40);- for p in &mut info.pages {- p.width = 4000.0;- p.height = 4000.0;- }- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- v.frame_queue = (0..40).map(|page| RenderRequest { page, scale: 1.0, tag: 1000, ..Default::default() }).collect();- let queue = v.prepare_render_queue(&info, 1.0);- assert_eq!(queue.len(), 2, "128 MiB admits two 4000-square pages, not 24");- v.frame_queue = (0..40)- .map(|page| RenderRequest { page, scale: 1.0, tag: 1000, tile: Some(Tile { x: 0, y: 0, w: 1024, h: 1024 }), ..Default::default() })- .collect();- assert_eq!(v.prepare_render_queue(&info, 1.0).len(), 32);- assert!(!v.admit_texture(RenderRequest::default(), PAGE_BYTES + 1));+ if let Some((name, w)) = field_props {+ app.open_field_props(&name, w);}-- #[test]- fn on_screen_pages_and_tiles_are_admitted_beyond_the_prefetch_allowance() {- let ctx = egui::Context::default();- let mut info = thumbnail_info(40);- for p in &mut info.pages {- p.width = 2000.0;- p.height = 2000.0;- }- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- // Ten 16 MB pages on screen (a zoomed-out HiDPI view) exceed the 128 MiB allowance.- v.frame_visible = (0..10).collect();- v.frame_queue = (0..40).map(|page| RenderRequest { page, scale: 1.0, tag: 1000, ..Default::default() }).collect();- let queue = v.prepare_render_queue(&info, 1.0);- let pages: Vec<usize> = queue.iter().map(|r| r.page).collect();- assert_eq!(pages, (0..10).collect::<Vec<_>>(), "every on-screen page, and no prefetch past the allowance");- v.last_queue = queue.clone();- for req in &queue {- assert!(v.receive_result(&ctx, solid_result(*req, 2000, 2000)) > 0, "on-screen page {} uploaded", req.page);- }- assert_eq!(v.pages.len(), 10, "none evicted another on-screen page");- // A 5K viewport needs more 1024-pixel tiles than the tile allowance holds.- v.frame_queue = (0..40)- .map(|x| RenderRequest { page: 0, scale: 1.0, tag: 1000, tile: Some(Tile { x: x * TILE, y: 0, w: 1024, h: 1024 }), ..Default::default() })- .collect();- assert_eq!(v.prepare_render_queue(&info, 1.0).len(), 40);+ if let Some(FieldMenu::Duplicate(name)) = field_menu {+ let pages = app.session.get(app.views[index].id).map_or(1, |d| d.info.pages.len());+ app.duplicate_draft = Some(crate::DuplicateDraft { name, all: true, from: 1, to: pages });+ app.dialog = Some(crate::Dialog::DuplicateField);}-- #[test]- fn a_page_turned_back_to_is_still_cached() {- let ctx = egui::Context::default();- let info = thumbnail_info(10);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- let req = |page| RenderRequest { page, scale: 1.0, tag: 1000, ..Default::default() };- v.frame_visible = [0].into();- v.frame_queue = vec![req(0)];- v.last_queue = v.prepare_render_queue(&info, 1.0);- v.receive_result(&ctx, solid_result(req(0), 100, 130));- // Single-page view moves on to page 1: page 0 is no longer demanded.- v.begin_render_frame();- v.current = 1;- v.frame_visible = [1].into();- v.frame_queue = vec![req(1)];- assert_eq!(v.prepare_render_queue(&info, 1.0), vec![req(1)]);- assert!(v.pages.contains_key(&0), "kept while the allowance has room");- // And back: nothing to render.- v.begin_render_frame();- v.current = 0;- v.frame_visible = [0].into();- v.frame_queue = vec![req(0)];- assert!(v.prepare_render_queue(&info, 1.0).is_empty());+ if let Some((page, rect)) = app.views[index].links.open_new.take() {+ app.open_link_props(page, Some(rect), None);}-- #[test]- fn visible_pages_render_before_thumbnails_and_text() {- let ctx = egui::Context::default();- let info = thumbnail_info(4);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- let main = RenderRequest { page: 0, scale: 1.0, tag: 1000, ..Default::default() };- let text = RenderRequest { page: 0, kind: RequestKind::Text, scale: 1.0, tag: TEXT_TAG, ..Default::default() };- // Opening page 0 queues its pixels and text alongside Pages-panel thumbnails.- v.begin_render_frame();- v.frame_visible = [0].into();- v.frame_queue = vec![main, text];- for p in 1..4 {- v.need_thumbnail(p, true);- }- let queue = v.prepare_render_queue(&info, 1.0);- assert_eq!(queue, vec![main], "visible pixels first: no thumbnails or text yet");- // Once the visible raster arrives, background work is admitted.- v.last_queue = queue;- assert!(v.receive_result(&ctx, solid_result(main, 100, 130)) > 0);- v.begin_render_frame();- v.frame_visible = [0].into();- v.frame_queue = vec![text];- for p in 1..4 {- v.need_thumbnail(p, true);- }- let queue = v.prepare_render_queue(&info, 1.0);- assert!(queue.iter().any(|r| r.kind == RequestKind::Text), "text admitted after pixels");- assert!(queue.iter().any(|r| r.tag & THUMB_TAG != 0), "thumbnails admitted after pixels");- assert!(!queue.iter().any(|r| r.kind == RequestKind::Pixels && r.tag & THUMB_TAG == 0), "no main pixels re-requested");- // An errored visible page never holds background work back.- v.errors.insert(0, "gone".to_string());- v.begin_render_frame();- v.frame_visible = [0].into();- v.frame_queue = vec![main, text];- for p in 1..4 {- v.need_thumbnail(p, true);- }- let queue = v.prepare_render_queue(&info, 1.0);- assert!(queue.iter().any(|r| r.kind == RequestKind::Text), "text admitted despite the error");- assert!(queue.iter().any(|r| r.tag & THUMB_TAG != 0), "thumbnails still admitted");+ if let Some((page, i)) = app.views[index].links.open_existing.take() {+ app.open_link_props(page, None, Some(i));}-- #[test]- fn thumbnail_tags_do_not_change_as_a_row_scrolls_in_or_out() {- let info = thumbnail_info(10_000);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- let tags = |v: &mut DocView, cells: usize| {- v.begin_render_frame();- for page in 0..cells {- v.need_thumbnail(page, true);- }- v.thumbnail_requests(&info, 2.0).into_iter().map(|r| (r.page, r.tag)).collect::<HashMap<_, _>>()- };- // 2x on a large screen: about 70 cells, give or take a row of six.- let (a, b) = (tags(&mut v, 70), tags(&mut v, 76));- assert!((0..70).all(|p| a[&p] == b[&p]), "a row more or less re-renders nothing");+ if let Some((page, quads)) = app.views[index].pending_redaction.take() {+ let author = app.comment_prefs.author.clone();+ app.views[index].pending_edit = Some(if app.quick_tool == QuickTool::Comment(comments::CommentTool::Highlight) {+ // An area highlight: a highlight over the box.+ let style = app.comment_prefs.style(comments::CommentTool::Highlight);+ pdfcraft_engine::Edit::AddAnnotation(pdfcraft_engine::NewAnnotation {+ page,+ shape: pdfcraft_engine::Shape::TextMarkup { kind: pdfcraft_engine::Markup::Highlight, quads },+ style,+ contents: String::new(),+ author,+ })+ } else {+ app.redact_prefs.mark(page, quads, &author)+ });}-- #[test]- fn many_open_documents_share_one_raster_allowance_and_close_releases_handles() {- let ctx = egui::Context::default();- let mut app = PdfCraftApp::new();- let bytes = app.session.create_blank(612.0, 792.0, 1).unwrap();- let mut expected = Vec::new();- for index in 0..6 {- app.open_bytes(&format!("synthetic-{index}.pdf"), None, bytes.as_ref().clone()).unwrap();- let info = app.session.get(app.views.last().unwrap().id).unwrap().info.clone();- let view = app.views.last_mut().unwrap();- view.begin_render_frame();- view.need_thumbnail(0, true);- let request = view.thumbnail_requests(&info, ctx.pixels_per_point()).into_iter().next().unwrap();- let page = info.pages.get(request.page).unwrap();- let dimensions = (device_pixels(page.width, request.scale), device_pixels(page.height, request.scale));- view.last_queue = vec![request];- assert_eq!(- view.receive_result(&ctx, solid_result(request, dimensions.0, dimensions.1)),- rgba_bytes(dimensions.0 as usize, dimensions.1 as usize)- );- assert_eq!(view.thumbs.get(&0).unwrap().tag, request.tag);- assert_eq!(view.thumbs.get(&0).unwrap().tex.size(), [dimensions.0 as usize, dimensions.1 as usize]);-- view.begin_render_frame();- view.need_thumbnail(0, true);- let queue = view.prepare_render_queue(&info, ctx.pixels_per_point());- assert!(queue.is_empty(), "the synthetic thumbnail satisfies current demand");- view.last_queue = queue;- expected.push((request, dimensions));+ match image_action {+ Some(crate::edit_text_ui::ImageAction::Replace(page, index)) => app.replace_page_image_dialog(page, index),+ Some(crate::edit_text_ui::ImageAction::Save(page, index)) => app.save_page_image(page, index),+ Some(crate::edit_text_ui::ImageAction::Copy(page, index)) => {+ app.copy_page_image(page, index);}- assert_eq!(app.views.len(), 6, "all six documents were opened");- assert_eq!(app.active_ids().map(|(index, _)| index), Some(5));- assert!(app.views.iter().zip(&expected).all(|(view, (request, dimensions))| {- view.thumbs.len() == 1- && view- .thumbs- .get(&0)- .is_some_and(|thumb| thumb.tag == request.tag && thumb.tex.size() == [dimensions.0 as usize, dimensions.1 as usize])- }));-- app.finish_render_frame(&ctx);- let total: usize = app.views.iter().map(|v| v.thumbs.values().map(|p| texture_bytes(&p.tex)).sum::<usize>()).sum();- let (active_request, active_dimensions) = expected.last().unwrap();- let active_bytes = rgba_bytes(active_dimensions.0 as usize, active_dimensions.1 as usize);- assert_eq!(total, active_bytes, "only the active view retains a thumbnail");- assert!(total <= THUMB_BYTES, "retained thumbnails stay within the existing allowance");- assert!(app.views.iter().take(5).all(|v| v.thumbs.is_empty() && v.last_queue.is_empty()));- let active = app.views.last().unwrap();- assert_eq!(active.thumbs.len(), 1);- assert_eq!(active.thumbs.get(&0).unwrap().tag, active_request.tag);- assert!(active.last_queue.is_empty(), "the current thumbnail is already cached");- for view in &app.views {- let doc = app.session.get(view.id).unwrap();- assert_eq!(doc.renderer.stats().render_requests, 0, "the fixture must not launch a native render");+ Some(crate::edit_text_ui::ImageAction::CopyFile(page, index)) => app.copy_page_image_file(page, index),+ Some(crate::edit_text_ui::ImageAction::Cut(page, image)) => {+ app.views[index].image_selection = None;+ app.cut_page_image(page, image);}-- app.close_tab(5);- assert_eq!(app.views.len(), 5, "closing the active tab drops its owning view");- assert!(app.views.iter().all(|v| v.thumbs.is_empty()));- }-- #[test]- fn suspended_signature_preview_releases_layers_and_rebuilds_without_editing() {- let ctx = egui::Context::default();- let mut png = std::io::Cursor::new(Vec::new());- image::RgbaImage::from_pixel(12, 4, image::Rgba([20, 30, 40, 255])).write_to(&mut png, image::ImageFormat::Png).unwrap();- let image = pdfcraft_engine::SignatureImage::from_bytes(png.get_ref()).unwrap();- let mut session = pdfcraft_engine::Session::new();- let blank = session.create_blank(300.0, 400.0, 1).unwrap();- let id = session.open_new("signature-preview.pdf", blank).unwrap();- let info = session.get(id).unwrap().info.pages[0].clone();- session.apply(id, image.edit(0, &info, [20.0, 100.0], false, "Test").unwrap()).unwrap();- let doc = session.get(id).unwrap();- let bytes = doc.bytes.clone();- let generation = doc.edit_generation();- let mut v = DocView::new(id, &doc.info, ViewDefaults::default());- v.comments.selected = Some((0, 0));- v.signature_drag.prepare(&ctx, doc, v.comments.selected, 1.0);- assert!(v.signature_drag.contains(0, 0));-- v.suspend_rendering(&doc.renderer);- assert!(!v.signature_drag.contains(0, 0), "inactive tabs release the preview pool and textures");- assert_eq!(v.comments.selected, Some((0, 0)), "the user's selection survives suspension");- v.signature_drag.prepare(&ctx, doc, v.comments.selected, 1.0);- assert!(v.signature_drag.contains(0, 0), "reactivating the view rebuilds the selected image's preview");- assert!(Arc::ptr_eq(&bytes, &doc.bytes));- assert_eq!(doc.edit_generation(), generation);- assert_eq!(doc.can_undo(), Some("Add signature"));- assert!(doc.dirty);- }-- #[test]- fn suspending_a_view_releases_owned_raster_textures_and_queue_state() {- let ctx = egui::Context::default();- let mut view = view(2, PageLayout::Single, true);- let texture = |name| ctx.load_texture(name, egui::ColorImage::filled([1, 1], Color32::WHITE), TextureOptions::LINEAR);- let request = RenderRequest { page: 0, scale: 1.0, tag: 1, ..Default::default() };- view.pages.insert(0, PageTex { tag: request.tag, tex: texture("suspended-page") });- view.thumbs.insert(1, PageTex { tag: THUMB_TAG, tex: texture("suspended-thumbnail") });- view.tiles.insert((0, request.tag, 0, 0), texture("suspended-tile"));- view.grid_pages.insert(1, (1, texture("suspended-grid-page")));- view.print_pages.insert(1, (PRINT_TAG, texture("suspended-print-page")));- view.stale_thumbs.insert(1);- view.waiting_since.insert(0, 1.0);- view.last_queue = vec![request];- view.frame_queue = vec![request];- view.frame_visible.insert(0);- view.need_thumbnail(1, true);-- let pool = RenderPool::new_inline(Arc::new(Vec::new()), Default::default());- view.suspend_rendering(&pool);-- assert!(view.pages.is_empty(), "page handles are released");- assert!(view.thumbs.is_empty(), "thumbnail handles are released");- assert!(view.tiles.is_empty(), "tile handles are released");- assert!(view.grid_pages.is_empty(), "organize-grid handles are released");- assert!(view.print_pages.is_empty(), "print-preview handles are released");- assert!(view.stale_thumbs.is_empty(), "stale thumbnail bookkeeping is cleared");- assert!(view.waiting_since.is_empty(), "waiting bookkeeping is cleared");- assert!(view.last_queue.is_empty() && !view.render_pending(), "queued demand is retired");- assert!(view.frame_queue.is_empty() && view.frame_visible.is_empty() && view.thumb_demand.is_empty());- }-- /// Edit text & images keeps its boxes while page input is blocked (the window unfocused, a- /// dialog or the palette open): the page's paragraphs are still measured for the latest edit- /// and drawn, instead of vanishing until the pointer comes back.- #[test]- fn edit_text_boxes_stay_drawn_while_page_input_is_blocked() {- let mut h = egui_kittest::Harness::builder().with_size(vec2(1400.0, 900.0)).build_eframe(|_cc| {- let mut app = PdfCraftApp::new();- let bytes = app.session.create_blank(300.0, 400.0, 1).unwrap();- app.open_bytes("blank.pdf", None, bytes.as_ref().clone()).unwrap();- app.quick_tool = QuickTool::EditText;- app- });- h.run_steps(3);- // Block page input the way the window losing focus does.- h.state_mut().palette_open = true;- h.run_steps(2);- assert!(h.state_mut().apply_edit(Edit::RotatePages { pages: vec![0], degrees: 90 }));- h.run_steps(3);- let app = h.state();- let generation = app.session.get(app.views[0].id).unwrap().edit_generation();- assert_eq!(app.views[0].edit_lines.get(&0).map(|(g, _)| *g), Some(generation), "the boxes follow the edit while input is blocked");- }-- #[test]- fn virtualized_organizer_keeps_insert_gaps_at_document_positions() {- use egui_kittest::kittest::Queryable;-- let mut h = egui_kittest::Harness::builder().with_size(vec2(1400.0, 900.0)).build_eframe(|_cc| {- let mut app = PdfCraftApp::new();- let bytes = app.session.create_blank(300.0, 400.0, 100).unwrap();- app.open_bytes("organize-gaps.pdf", None, bytes.as_ref().clone()).unwrap();- app.views[0].organize = true;- app- });- h.run_steps(4);- assert!(h.state().views[0].thumb_demand.len() < 50);- assert_eq!(h.query_all_by_label("Insert a file at the end").count(), 0, "the last virtualized cell is not the final page");- let center = h.state().views[0].viewport_rect().center();- h.hover_at(center);- h.event(egui::Event::MouseWheel {- unit: egui::MouseWheelUnit::Point,- delta: vec2(0.0, -100_000.0),- phase: egui::TouchPhase::Move,- modifiers: egui::Modifiers::NONE,- });- // Well past egui's longest scroll animation (about 0.3 s).- h.run_steps(40);- h.get_by_label("Insert a file at the end");- let before_last = h.get_by_label("Insert a file before page 100").rect().center();- h.hover_at(before_last);- h.run_steps(2);- assert_eq!(h.state().views[0].grid_gap, Some(99), "external drops use the document index after virtualized scrolling");- assert!(h.state().views[0].thumb_demand.len() < 50);- }-- #[test]- fn real_shell_pages_organizer_and_print_only_collect_current_thumbnail_consumers() {- let mut h = egui_kittest::Harness::builder().with_size(vec2(1400.0, 900.0)).build_eframe(|_cc| {- let mut app = PdfCraftApp::new();- let bytes = app.session.create_blank(612.0, 792.0, 10_000).unwrap();- app.open_bytes("synthetic-ten-thousand.pdf", None, bytes.as_ref().clone()).unwrap();- app.right = Some(RightPanel::Pages);- app- });- h.run_steps(4);- assert!((1..20).contains(&h.state().views[0].thumb_demand.len()));- h.state_mut().right = None;- h.state_mut().views[0].organize = true;- h.run_steps(2);- assert!((1..50).contains(&h.state().views[0].thumb_demand.len()));- h.state_mut().views[0].organize = false;- h.state_mut().dialog = Some(crate::Dialog::Print);- h.state_mut().print_draft.sheet = 9999;- h.run_steps(2);- assert_eq!(h.state().views[0].thumb_demand.keys().copied().collect::<Vec<_>>(), vec![9999]);- h.state_mut().print_draft.handling = crate::PrintHandling::Booklet;- h.state_mut().print_draft.sheet = 0;- h.run_steps(2);- assert_eq!(h.state().views[0].thumb_demand.len(), 2, "booklet only needs its two placed pages");- h.state_mut().dialog = None;- h.run_steps(2);- assert!(h.state().views[0].thumb_demand.is_empty());- assert!(h.state().views[0].thumbs.is_empty());+ Some(crate::edit_text_ui::ImageAction::Redact(page, index)) => app.redact_page_image(page, index),+ Some(crate::edit_text_ui::ImageAction::Link(page, index)) => app.link_page_image(page, index),+ Some(crate::edit_text_ui::ImageAction::Recognize(page)) => app.recognize_text_on_page(page),+ None => {}}-- /// One mouse-wheel notch (a line) at `at` seconds.- fn notch(v: &mut DocView, dy: f32, at: f64) -> bool {- v.single_page_wheel(egui::MouseWheelUnit::Line, dy, egui::TouchPhase::Move, at, true)+ if let Some(why) = refused {+ app.notify_error(why);}-- #[test]- fn thumbnails_cover_the_panel_on_a_high_dpi_screen() {- // Pages panel slot is at most 150 logical points. At 2 px/pt a letter page's thumbnail- // must be at least that wide, so the panel samples it down instead of stretching it.- let info = thumbnail_info(1);- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- v.need_thumbnail(0, true);- let queue = v.prepare_render_queue(&info, 2.0);- let scale = queue.first().expect("one thumbnail").scale;- assert!(612.0 * scale >= 150.0 * 2.0, "{scale}");+ if open_signature || open_initials {+ app.signature_draft = crate::fill_sign::SigDraft::new(open_initials, &app.comment_prefs.author);+ app.dialog = Some(crate::Dialog::Signature);}-- #[test]- fn notches_turn_pages_and_stop_at_the_ends() {- let mut v = view(3, PageLayout::Single, false);- assert!(notch(&mut v, -1.0, 1.0) && notch(&mut v, -1.0, 1.05));- assert_eq!(v.current, 2);- assert!(!notch(&mut v, -1.0, 1.1), "nothing turns past the last page");- assert!(notch(&mut v, 1.0, 1.2));- assert_eq!(v.current, 1);+ if open_boxes {+ app.boxes_draft.range = crate::pageboxes::Range::Current;+ app.boxes_draft.seeded = None;+ app.dialog = Some(crate::Dialog::PageBoxes);}-- #[test]- fn notches_turn_two_page_spreads() {- // Two-page view, shown one spread at a time (not continuous): a notch turns a whole- // spread at once, not a single page (#752).- let mut v = view(4, PageLayout::TwoUp, false);- assert!(notch(&mut v, -1.0, 1.0));- assert_eq!(v.current, 2, "a notch turns from the first spread to the second");- assert!(notch(&mut v, 1.0, 1.1));- assert_eq!(v.current, 0, "a notch back turns to the previous spread");+ if let Some((page, rect)) = open_table {+ app.field_table_draft = Some(crate::field_table_ui::FieldTableDraft::new(app.views[index].id, page, rect, &form, generation));+ app.dialog = Some(crate::Dialog::FieldTable);+ // The window lasts while the form is prepared. Drawn with the tool picked but its panel+ // closed, the tool goes back to Select above, so the panel opens to keep it prepared.+ app.left = crate::LeftPanel::Tool("form");+ app.reveal_tools();}-- #[test]- fn continuous_views_ignore_the_wheel_for_paging() {- // Scrolling views let the ScrollArea handle the wheel; it never turns pages.- for layout in [PageLayout::Single, PageLayout::TwoUp] {- let mut v = view(3, layout, true);- assert!(!notch(&mut v, -1.0, 1.0), "{layout:?} continuous ignores the wheel");- assert_eq!(v.current, 0);+ if let Some(n) = form_notice {+ match n {+ crate::forms_ui::FormNotice::Security => app.notify_tr("The document's security settings don't allow filling in form fields"),+ crate::forms_ui::FormNotice::ReadOnly(name) => app.notify_fmt("{name} is read-only", &[("name", &name)]),+ crate::forms_ui::FormNotice::NoAction(name) => app.notify_fmt("{name} has no action", &[("name", &name)]),}}-- #[test]- fn navigation_drops_partial_wheel_motion() {- use egui::{MouseWheelUnit::Point, TouchPhase::Move, TouchPhase::Start};- let mut v = view(3, PageLayout::Single, false);- assert!(!v.single_page_wheel(Point, 0.0, Start, 1.0, true));- assert!(!v.single_page_wheel(Point, -30.0, Move, 1.02, true));- v.go_to_page(1);- // The same touch has to move a full notch's worth again before it turns.- assert!(!v.single_page_wheel(Point, -30.0, Move, 1.04, true));- assert!(v.single_page_wheel(Point, -30.0, Move, 1.06, true));- assert_eq!(v.current, 2);- }-- #[test]- fn reselecting_the_layout_does_not_scroll_to_top() {- let mut v = view(3, PageLayout::Single, true);- v.goto = None;- v.set_layout(PageLayout::Single);- assert!(v.goto.is_none(), "re-selecting the current layout is a no-op");- v.set_continuous(true);- assert!(v.goto.is_none(), "re-selecting the current continuity is a no-op");- v.set_layout(PageLayout::TwoUp);- assert_eq!(v.goto, Some((0, 0.0)), "switching the base layout aligns the current page");- v.goto = None;- v.set_continuous(false);- assert_eq!(v.goto, Some((0, 0.0)), "toggling continuous scrolling aligns the current page");- }-- #[test]- fn fit_page_and_height_hold_still_while_mixed_page_sizes_scroll_past() {- let page =- |width: f32, height: f32| pdfcraft_render::PageInfo { width, height, label: String::new(), crop: [0.0, 0.0, width, height], rotation: 0 };- let info = DocInfo { pages: vec![page(300.0, 400.0), page(600.0, 800.0)], ..Default::default() };- for fit in [Fit::Page, Fit::Height] {- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- (v.fit, v.viewport_w, v.viewport_h) = (fit, 1000.0, 800.0);- v.fit_zoom(&info);- let zoom = v.zoom;- v.current = 1;- v.fit_zoom(&info);- assert_eq!(v.zoom, zoom, "{fit:?}: scrolling onto a bigger page keeps the zoom");- // A single page shown on its own (not scrolling) fits each one.- (v.layout, v.continuous) = (PageLayout::Single, false);- v.fit_zoom(&info);- let big = v.zoom;- v.current = 0;- v.fit_zoom(&info);- assert!(v.zoom > big, "{fit:?}: single-page view fits the page it shows");- }+ if let Some((name, action)) = app.views[index].forms.button.take() {+ run_button(app, index, &name, action);}-- #[test]- fn fit_width_fits_the_shown_page_in_single_page_view_only() {- let page =- |width: f32, height: f32| pdfcraft_render::PageInfo { width, height, label: String::new(), crop: [0.0, 0.0, width, height], rotation: 0 };- let info = DocInfo { pages: vec![page(300.0, 400.0), page(600.0, 400.0)], ..Default::default() };- let mut v = DocView::new(DocId(1), &info, ViewDefaults::default());- (v.fit, v.viewport_w, v.viewport_h) = (Fit::Width, 1000.0, 800.0);- v.layout = PageLayout::Single;- v.continuous = false;- v.fit_zoom(&info);- let narrow = v.zoom;- // The shown page fills the width between the side gutters, not centred for the wide page.- let shown = v.layout(&info, v.content_width(&info, 1000.0))[0];- assert!((shown.left() - SIDE).abs() < 1e-2 && (shown.width() - 860.0).abs() < 1e-2, "{shown:?}");- v.current = 1;- v.fit_zoom(&info);- assert!((narrow / v.zoom - 2.0).abs() < 1e-3, "the narrow page gets twice the zoom of the wide one");- // Scrolling views keep one zoom for the whole document.- v.continuous = true;- v.fit_zoom(&info);- let wide = v.zoom;- v.current = 0;- v.fit_zoom(&info);- assert_eq!(v.zoom, wide, "continuous fit width holds still across page sizes");+ if copy_selected {+ app.execute("edit.copy");}-- #[test]- fn layouts_match_their_commands_and_names() {- for l in PageLayout::ORDER {- let spec = pdfcraft_engine::commands::command(l.command()).expect("registered");- assert_eq!((l.label(), l.icon()), (spec.label, spec.icon), "{l:?}");- assert_eq!(PageLayout::from_command(l.command()), Some(l));- assert_eq!(PageLayout::try_parse(l.as_str()), Some(l));- }- assert_eq!(PageLayout::try_parse(" Two-Up "), Some(PageLayout::TwoUp));- assert_eq!(PageLayout::try_parse("facing"), None);+ // Read mode hides the tools (#2646), and full screen is the page and nothing else (#1459);+ // the quick tools come back with the window.+ if app.mode != crate::Mode::Read && !app.full_screen {+ quick_bar(app, avail, ui);}-- #[test]- fn destinations_set_the_zoom_mode_and_the_point_to_show() {- let info = pdfcraft_render::DocInfo {- pages: (0..3)- .map(|_| pdfcraft_render::PageInfo { width: 300.0, height: 400.0, label: String::new(), crop: [0.0, 0.0, 300.0, 400.0], rotation: 0 })- .collect(),- ..Default::default()- };- let mut v = view(3, PageLayout::Single, true);- v.fit = Fit::Width;- // No position (or a malformed one): the top of the page, zoom as it was.- v.go_to_dest(1, DestView::Top, &info);- assert_eq!((v.current, v.goto, v.goto_point, v.fit), (1, Some((1, 0.0)), None, Fit::Width));- // /XYZ with a null zoom keeps the zoom mode; its point is a quarter down page 3.- v.go_to_dest(2, DestView::Xyz { left: None, top: Some(300.0), zoom: None }, &info);- assert_eq!((v.current, v.fit, v.goto_point), (2, Fit::Width, Some((2, None, Some(0.25), vec2(SIDE, 0.0)))));- v.go_to_dest(0, DestView::Xyz { left: Some(150.0), top: None, zoom: Some(2.5) }, &info);- assert_eq!((v.fit, v.zoom, v.goto_point), (Fit::None, 2.5, Some((0, Some(0.5), None, vec2(SIDE, 0.0)))));- // A zoom beyond the view's range is clamped to it.- v.go_to_dest(0, DestView::Xyz { left: None, top: None, zoom: Some(1e30) }, &info);- assert_eq!((v.zoom, v.goto_point), (64.0, None));- v.go_to_dest(0, DestView::Fit, &info);- assert_eq!((v.fit, v.goto_point), (Fit::Page, None));- v.go_to_dest(0, DestView::FitH { top: Some(100.0) }, &info);- assert_eq!((v.fit, v.goto_point), (Fit::Width, Some((0, None, Some(0.75), vec2(SIDE, 0.0)))));- v.go_to_dest(0, DestView::FitV { left: Some(75.0) }, &info);- assert_eq!((v.fit, v.goto_point), (Fit::Height, Some((0, Some(0.25), None, vec2(SIDE, 0.0)))));- // /FitR: the zoom that fits a 100×50 pt rectangle in an 800×600 window, centred.- (v.viewport_w, v.viewport_h) = (800.0, 600.0);- v.go_to_dest(0, DestView::FitR { rect: [0.0, 300.0, 100.0, 350.0] }, &info);- assert_eq!(v.fit, Fit::None);- assert!((v.zoom - 8.0 / PT).abs() < 1e-4, "{}", v.zoom);- let (page, fx, fy, rel) = v.goto_point.expect("a point to show");- assert_eq!((page, rel), (0, vec2(400.0, 300.0)));- assert!((fx.unwrap_or(-1.0) - 50.0 / 300.0).abs() < 1e-4 && (fy.unwrap_or(-1.0) - 75.0 / 400.0).abs() < 1e-4, "{fx:?} {fy:?}");- // A page past the end goes to the last page; a page the document info lacks, to its top.- v.go_to_dest(usize::MAX, DestView::FitH { top: Some(100.0) }, &info);- assert_eq!((v.current, v.goto_point.map(|g| g.0)), (2, Some(2)));- let empty = pdfcraft_render::DocInfo::default();- v.go_to_dest(1, DestView::FitH { top: Some(100.0) }, &empty);- assert_eq!((v.current, v.goto_point), (1, None));+ if let Some((source, file, destination)) = remote_open {+ app.open_remote_link(source, file, destination);}+ }- #[test]- fn page_text_failure_preserves_valid_search_match_without_jitter() {- let mut v = view(3, PageLayout::Single, true);- v.current = 1;- v.find = Some(Find {- query: "test".into(),- case_query: "test".into(),- matches: vec![(0, 0..4), (1, 5..9)],- current: Some(0),- ..Default::default()- });- let req = RenderRequest { page: 0, kind: RequestKind::Text, ..Default::default() };- v.last_queue = vec![req];- let ctx = egui::Context::default();- v.receive_result(- &ctx,- pdfcraft_render::RenderedPage {- request: req,- width: 0,- height: 0,- rgba: Default::default(),- error: Some("extraction failed".into()),- text: None,- warnings: Vec::new(),- millis: 0,- },- );- // Active match was on page 0 which failed: current should fall back to match on page 1 without jitter- assert_eq!(v.find.as_ref().unwrap().current, Some(0));- assert_eq!(v.find.as_ref().unwrap().matches, vec![(1, 5..9)]);- assert!(v.goto.is_none());- }+ /// The prepare-mode field menu's choices.+ enum FieldMenu {+ Properties,+ Duplicate(String),}++ #[cfg(test)]+ mod tests;diff --cc crates/ui-egui/src/canvas/organize.rsindex 000000000,7f333b3e4..48c7e82d8mode 000000,100644..100644--- a/crates/ui-egui/src/canvas/organize.rs+++ b/crates/ui-egui/src/canvas/organize.rs@@@ -1,0 -1,562 +1,579 @@@+ use super::cache::{GRID_TAG, thumbnail_density, thumbnail_rows, thumbnail_scale};+ use super::zoom::{GRID_ZOOM_RANGE, GRID_ZOOM_STEP};+ use super::{+ Align2, Color32, CornerRadius, DocInfo, DocView, Edit, Pos2, Rect, RenderRequest, RequestKind, Sense, Stroke, Tokens, Vec2, ViewAction,+ device_pixels, icons, pos2, theme, vec2, widgets,+ };++ /// How far a sharp grid render may be from the size drawn before it is redone: a pinch changes+ /// the size on every frame, and a slightly soft or slightly large image is fine meanwhile.+ const GRID_SHARP: std::ops::RangeInclusive<f32> = 0.9..=1.6;++ /// Whether an image `have` device pixels wide is good enough to draw `want` pixels wide.+ pub(super) fn sharp_enough(have: u32, want: f32) -> bool {+ want > 0.0 && GRID_SHARP.contains(&(have as f32 / want))+ }++ impl DocView {+ /// Open Organize Pages on the page being read (issue #1910). An empty selection means the+ /// current page, so a selection left from earlier that does not include it is dropped, and+ /// the grid scrolls its cell into view. Every way into the grid goes through here; closing+ /// it is a plain `organize = false`.+ pub fn open_organize(&mut self) {+ self.organize = true;+ if !self.selected.is_empty() && !self.selected.contains(&self.current) {+ self.clear_page_selection(Some(self.current));+ }+ self.grid_reveal = Some(self.current);+ }++ /// Pages an organize command acts on: the selection, or the current page.+ pub fn target_pages(&self) -> Vec<usize> {+ if self.selected.is_empty() { vec![self.current] } else { self.selected.iter().copied().collect() }+ }++ pub fn select_pages(&mut self, pages: &[usize]) {+ self.selected = pages.iter().copied().filter(|p| *p < self.page_count).collect();+ if let Some(first) = self.selected.first() {+ self.current = *first;+ }+ }++ /// A click on page `i`'s thumbnail, in the organize grid or the Pages panel. ⇧ selects the+ /// range from the anchor (or the current page); ⌘/Ctrl toggles the page; a plain click+ /// selects only it. `seed_current` is for the Pages panel, where an empty selection means+ /// the current page: the first ⌘-click on another page keeps the current one selected too.+ pub fn click_page(&mut self, i: usize, modifiers: egui::Modifiers, seed_current: bool) {+ if i >= self.page_count {+ return;+ }+ if modifiers.shift {+ let a = self.select_anchor.unwrap_or(self.current);+ self.selected = (a.min(i)..=a.max(i)).collect();+ } else if modifiers.command {+ if seed_current && self.selected.is_empty() && i != self.current {+ self.selected.insert(self.current);+ }+ if !self.selected.remove(&i) {+ self.selected.insert(i);+ }+ self.select_anchor = Some(i);+ } else {+ self.selected = [i].into();+ self.select_anchor = Some(i);+ }+ }++ /// Drop the page selection; a later ⇧-click ranges from `anchor`.+ pub fn clear_page_selection(&mut self, anchor: Option<usize>) {+ self.selected.clear();+ self.select_anchor = anchor.filter(|a| *a < self.page_count);+ }+ }++ /// Where a page of `page` size (points, as shown: after its rotation) is drawn in the grid cell+ /// `cell`: as large as the picture area allows and centred in it, so a landscape or rotated page+ /// fills the cell's width in its middle, as Acrobat draws it, instead of a small strip at the top.+ /// The picture area leaves room for the page number and actions below. Its sides narrow only when+ /// a picture that wide would reach the selection checkbox in the cell's corner.+ pub(crate) fn grid_page_rect(cell: Rect, page: Vec2) -> Rect {+ let area = Rect::from_min_max(pos2(cell.left(), cell.top() + 16.0), pos2(cell.right(), cell.bottom() - 72.0));+ // A page size from a damaged file can be zero, NaN or infinite; draw such a page square.+ let side = |v: f32| if v.is_finite() { v.max(1.0) } else { 1.0 };+ let (w, h) = (side(page.x), side(page.y));+ let fit = |margin: f32| {+ let s = ((area.width() - 2.0 * margin).max(1.0) / w).min(area.height().max(1.0) / h);+ Rect::from_center_size(area.center(), vec2(w * s, h * s))+ };+ let wide = fit(16.0);+ // The checkbox sits at (8, 8)-(28, 28) from the cell's corner; keep 4 px clear of it.+ let checkbox = Rect::from_min_size(cell.min + vec2(8.0, 8.0), Vec2::splat(20.0)).expand(4.0);+ if wide.intersects(checkbox) { fit(30.0) } else { wide }+ }++ /// The organize toolbar: page operations on the selection (Acrobat's Organize Pages bar).+ fn organize_toolbar(view: &mut DocView, info: &DocInfo, editable: bool, dirty: bool, unobstructed: bool, ui: &mut egui::Ui, t: &Tokens) {+ let targets = view.target_pages();+ let n = info.pages.len();+ let (first, last) = (targets.first().copied().unwrap_or(0), targets.last().copied().unwrap_or(0));+ egui::Frame::NONE.fill(t.chrome).inner_margin(egui::Margin::symmetric(16, 8)).show(ui, |ui| {+ ui.horizontal(|ui| {+ ui.spacing_mut().item_spacing.x = 4.0;+ let label = match view.selected.len() {+ 0 => crate::i18n::fmt(tl!("Page {p} of {n}"), &[("p", &(view.current + 1).to_string()), ("n", &n.to_string())]),+ 1 => tl!("1 page selected").to_string(),+ k => crate::i18n::fmt(tl!("{n} pages selected"), &[("n", &k.to_string())]),+ };+ // Fixed width so the buttons never shift as the selection text changes.+ ui.add_sized([150.0, 30.0], egui::Label::new(egui::RichText::new(label).font(theme::medium(13.0)).color(t.text_muted)).truncate());+ ui.add_enabled_ui(editable, |ui| {+ ui.add_space(8.0);+ if ui.add_enabled_ui(first > 0, |ui| icons::button(ui, "chevron-left", 30.0, false, tl!("Move earlier"))).inner.clicked() {+ view.pending_edit = Some(Edit::MovePages { pages: targets.clone(), to: first - 1 });+ }+ if ui.add_enabled_ui(last + 1 < n, |ui| icons::button(ui, "chevron-right", 30.0, false, tl!("Move later"))).inner.clicked() {+ view.pending_edit = Some(Edit::MovePages { pages: targets.clone(), to: first + 1 });+ }+ });+ ui.with_layout(egui::Layout::right_to_left(egui::Align::Center), |ui| {+ if widgets::ghost_button(ui, "x", tl!("Close")).on_hover_text(tl!("Back to the document")).clicked() {+ view.organize = false;+ }+ // What the grid shows is what is saved.+ let save = ui.add_enabled_ui(dirty, |ui| widgets::pill_button(ui, tl!("Save pages"), true)).inner;+ if save.on_hover_text(tl!("Save these pages as one PDF")).on_disabled_hover_text(tl!("No changes to save")).clicked() {+ view.pending_action = Some(ViewAction::Save);+ }+ ui.add_space(8.0);+ // Page size in the grid (right to left: in, the percentage, out).+ let zoom = view.grid_zoom;+ if ui+ .add_enabled_ui(zoom < *GRID_ZOOM_RANGE.end(), |ui| icons::button(ui, "zoom-in", 30.0, false, tl!("Larger pages")))+ .inner+ .clicked()+ {+ view.grid_zoom_request = Some(zoom * GRID_ZOOM_STEP);+ }+ let percent = egui::Button::new(egui::RichText::new(format!("{:.0}%", zoom * 100.0)).font(theme::medium(12.0)).color(t.text_muted))+ .frame(false);+ let percent = ui.add_sized([44.0, 30.0], percent);+ percent.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, true, tl!("Reset page size")));+ if percent.on_hover_text(tl!("Reset page size")).clicked() {+ view.grid_zoom_request = Some(1.0);+ }+ if ui+ .add_enabled_ui(zoom > *GRID_ZOOM_RANGE.start(), |ui| icons::button(ui, "zoom-out", 30.0, false, tl!("Smaller pages")))+ .inner+ .clicked()+ {+ view.grid_zoom_request = Some(zoom / GRID_ZOOM_STEP);+ }+ });+ });+ });+ // Keys act on the selection unless a text field or a dialog has them (Delete under+ // Preferences deleted the selected pages).+ if editable && unobstructed && !ui.ctx().egui_wants_keyboard_input() {+ use egui::{Key, Modifiers};+ let (del, esc) = ui.input_mut(|i| {+ (+ i.consume_key(Modifiers::NONE, Key::Delete) || i.consume_key(Modifiers::NONE, Key::Backspace),+ i.consume_key(Modifiers::NONE, Key::Escape),+ )+ });+ // ⌘C / ⌘X / ⌘V copy, cut and paste pages (egui delivers them as clipboard events).+ let (copy, cut, paste) = ui.input(|i| {+ let any = |f: &dyn Fn(&egui::Event) -> bool| i.events.iter().any(f);+ (any(&|e| matches!(e, egui::Event::Copy)), any(&|e| matches!(e, egui::Event::Cut)), any(&|e| matches!(e, egui::Event::Paste(_))))+ });+ if copy || cut {+ view.pending_action = Some(ViewAction::CopyPages { cut });+ }+ if paste {+ view.pending_action = Some(ViewAction::PastePages);+ }+ if del && targets.len() < n {+ view.pending_edit = Some(Edit::DeletePages { pages: targets });+ }+ if esc {+ view.selected.clear();+ }+ }+ }++ /// Organize pages: a thumbnail grid (Acrobat's Organize Pages view). Click selects, ⌘-click+ /// toggles, ⇧-click extends; double-click opens the page.+ /// The gap (0 = before the first page, n = after the last) the pointer points at in the grid.+ pub(crate) fn drop_gap(cells: &[(usize, Rect)], p: Pos2) -> Option<usize> {+ let (i, r) = cells.iter().min_by(|(_, a), (_, b)| a.distance_sq_to_pos(p).total_cmp(&b.distance_sq_to_pos(p)))?;+ Some(if p.x < r.center().x { *i } else { i + 1 })+ }++ /// Ctrl (Option on macOS) held when a page drag drops copies the dragged pages into the gap+ /// instead of moving them, as Acrobat's Organize Pages does.+ ///+ /// The OS comes from the context, not `cfg!`: the wasm build runs on macOS too, where+ /// `cfg!(target_os = "macos")` is false, so Option has to copy there as well (#3092 review).+ fn copy_modifier(ctx: &egui::Context, m: &egui::Modifiers) -> bool {+ if crate::commands::mac_shortcuts(ctx) { m.alt } else { m.ctrl }+ }++ /// A "+" on a gap of the page grid: insert files there. Returns whether it was clicked.+ fn gap_button(ui: &mut egui::Ui, gap: usize, at: Pos2, height: f32, label: String, t: &Tokens) -> bool {+ let resp = ui.interact(Rect::from_center_size(at, Vec2::splat(22.0)), ui.scope_id().with(("org-gap", gap)), Sense::click());+ resp.widget_info(|| egui::WidgetInfo::labeled(egui::Role::Button, true, label.clone()));+ let hot = resp.hovered();+ if hot {+ ui.painter().line_segment([pos2(at.x, at.y - height / 2.0), pos2(at.x, at.y + height / 2.0)], Stroke::new(3.0, t.accent));+ }+ ui.painter().circle(at, 9.0, if hot { t.accent } else { t.chrome }, Stroke::new(1.0, if hot { t.accent } else { t.border }));+ let ink = Stroke::new(1.5, if hot { Color32::WHITE } else { t.text_muted });+ ui.painter().line_segment([at - vec2(4.0, 0.0), at + vec2(4.0, 0.0)], ink);+ ui.painter().line_segment([at - vec2(0.0, 4.0), at + vec2(0.0, 4.0)], ink);+ resp.on_hover_text(label).clicked()+ }++ /// Middle-button auto-scroll: its delta scrolls the grid, and the page controls under it are+ /// disabled (but not dimmed) while the gesture lasts.+ fn apply_auto_scroll(ui: &mut egui::Ui, middle_gesture: bool, auto_delta: Vec2) {+ if middle_gesture {+ let opacity = ui.opacity();+ ui.disable();+ ui.set_opacity(opacity);+ }+ if auto_delta != Vec2::ZERO {+ ui.scroll_with_delta_animation(auto_delta, egui::style::ScrollAnimation::none());+ }+ }++ /// Drag pages to move them (the selection, or the page grabbed); `drop` is set when the drag ends.+ fn drag_pages(view: &mut DocView, resp: &egui::Response, page: usize, drop: &mut bool) {+ if resp.drag_started() {+ if !view.selected.contains(&page) {+ view.selected = [page].into();+ view.select_anchor = Some(page);+ }+ let mut pages: Vec<usize> = view.selected.iter().copied().collect();+ pages.sort_unstable();+ view.org_drag = Some(pages);+ }+ if resp.drag_stopped() {+ *drop = true;+ }+ }++ /// A page drawn larger than its thumbnail gets a render at the size drawn, while it is in view;+ /// until that arrives the thumbnail stands in.+ fn request_sharper(+ view: &DocView,+ page: usize,+ want: f32,+ page_width: f32,+ drawn_width: Option<u32>,+ in_view: &mut Vec<(usize, f32)>,+ sharper: &mut Vec<RenderRequest>,+ ) {+ in_view.push((page, want));+ if !drawn_width.is_some_and(|w| sharp_enough(w, want)) && !view.errors.contains_key(&page) {+ sharper.push(RenderRequest {+ page,+ kind: RequestKind::Pixels,+ tile: None,+ scale: want / page_width.max(1.0),+ tag: GRID_TAG,+ // Grid cells are previews: tiny images are skipped for them.+ preview: true,+ });+ }+ }+-pub(super) fn organize_grid(view: &mut DocView, info: &DocInfo, editable: bool, dirty: bool, unobstructed: bool, ui: &mut egui::Ui, t: &Tokens) {++pub(super) fn organize_grid(++ view: &mut DocView,++ doc: &pdfcraft_engine::Document,++ unobstructed: bool,++ show_page_edge_shadows: bool,++ ui: &mut egui::Ui,++ t: &Tokens,++) {++ let info = &doc.info;++ let editable = doc.allows_assembly();++ let dirty = doc.dirty;+ let ppp = ui.ctx().pixels_per_point();+ // The page image scales with the zoom; the padding and the page number don't.+ let cell = vec2(146.0 * view.grid_zoom + 44.0, 194.0 * view.grid_zoom + 88.0);+ let anchor = view.grid_anchor.take();+ let reveal = view.grid_reveal.take();+ let mut open_page = None;+ organize_toolbar(view, info, editable, dirty, unobstructed, ui, t);+ let viewport = ui.available_rect_before_wrap();+ view.viewport_screen = viewport;+ let auto_delta = if unobstructed {+ view.auto_scroll.update(ui, viewport, true)+ } else {+ view.auto_scroll.cancel();+ Vec2::ZERO+ };+ let middle_gesture = view.auto_scroll.blocks_input();+ let mut cells: Vec<(usize, Rect)> = Vec::new();+ // The pages in view that are drawn larger than their thumbnails, and those of them that+ // need a sharper render than they have. The width is the size drawn, in device pixels.+ let (mut in_view, mut sharper): (Vec<(usize, f32)>, Vec<RenderRequest>) = (Vec::new(), Vec::new());+ // The source cell can scroll out of the virtualized rows during a drag.+ let mut drop = view.org_drag.is_some() && ui.input(|i| i.pointer.primary_released());++ let fade_strength = ui.spacing().scroll.fade.strength;++ if !show_page_edge_shadows {++ ui.spacing_mut().scroll.fade.strength = 0.0;++ }+ egui::ScrollArea::vertical().auto_shrink([false, false]).show_viewport(ui, |ui, clip| {+ apply_auto_scroll(ui, middle_gesture, auto_delta);+ ui.add_space(20.0);+ let cols = ((ui.available_width() - 40.0) / cell.x).floor().max(1.0) as usize;+ let rows = info.pages.len().div_ceil(cols);+ let left = (ui.available_width() - cols as f32 * cell.x) / 2.0;+ let (grid, _) = ui.allocate_exact_size(vec2(ui.available_width(), rows as f32 * cell.y), Sense::hover());+ // The page Organize opened on may lie in a row the virtualized grid has not laid out,+ // so its cell is computed rather than found.+ if let Some(page) = reveal.filter(|p| *p < info.pages.len()) {+ let row = page / cols;+ let col = page % cols;+ let c = Rect::from_min_size(pos2(grid.left() + left + col as f32 * cell.x, grid.top() + row as f32 * cell.y), cell);+ ui.scroll_to_rect_animation(c, Some(egui::Align::Center), egui::style::ScrollAnimation::none());+ }+ for row in thumbnail_rows(clip.top() - 20.0, clip.bottom() - 20.0, cell.y, rows) {+ let row_rect = Rect::from_min_size(grid.min + vec2(0.0, row as f32 * cell.y), vec2(grid.width(), cell.y));+ for col in 0..cols {+ let i = row * cols + col;+ let Some(p) = info.pages.get(i) else { break };+ let c = Rect::from_min_size(pos2(row_rect.left() + left + col as f32 * cell.x, row_rect.top()), cell);+ view.need_thumbnail(i, c.intersects(ui.clip_rect()));+ let resp = ui.interact(c, ui.scope_id().with(("org", i)), if editable { Sense::click_and_drag() } else { Sense::click() });+ cells.push((i, c));+ if let Some((_, above)) = anchor.filter(|(page, _)| *page == i) {+ ui.scroll_to_rect_animation(c.translate(vec2(0.0, -above)), Some(egui::Align::Min), egui::style::ScrollAnimation::none());+ }+ drag_pages(view, &resp, i, &mut drop);+ let page_label = crate::i18n::fmt(tl!("Page {label}"), &[("label", &p.label)]);+ resp.widget_info(|| egui::WidgetInfo::selected(egui::Role::CheckBox, true, view.selected.contains(&i), page_label.clone()));+ let pr = grid_page_rect(c, vec2(p.width, p.height));+ let size = pr.size();+ let selected = view.selected.contains(&i) || (view.selected.is_empty() && i == view.current);+ if selected || resp.hovered() {+ ui.painter().rect_filled(c.shrink(6.0), CornerRadius::same(8), if selected { t.accent_soft } else { t.hover });+ }+ if view.selected.contains(&i) {+ ui.painter().rect_stroke(c.shrink(6.0), CornerRadius::same(8), Stroke::new(1.5, t.accent), egui::StrokeKind::Inside);+ }- ui.painter().rect_filled(pr.translate(vec2(0.0, 1.5)), CornerRadius::same(1), t.page_shadow);++ if show_page_edge_shadows {++ ui.painter().rect_filled(pr.translate(vec2(0.0, 1.5)), CornerRadius::same(1), t.page_shadow);++ }+ ui.painter().rect_filled(pr, CornerRadius::ZERO, Color32::WHITE);+ // A page drawn larger than its thumbnail gets a render at the size drawn, while+ // it is in view; until that arrives the thumbnail stands in.+ let want = size.x * ppp;+ let thumb = view.thumbs.get(&i).map(|t| &t.tex);+ let thumb_ok = thumb.is_some_and(|t| t.size()[0] as f32 >= want * GRID_SHARP.start());+ let sharp = view.grid_pages.get(&i).filter(|_| !thumb_ok);+ if !thumb_ok && ui.is_rect_visible(c) {+ request_sharper(view, i, want, p.width, sharp.map(|(w, _)| *w), &mut in_view, &mut sharper);+ }+ if let Some(tex) = sharp.map(|(_, t)| t).or(thumb) {+ ui.painter().image(tex.id(), pr, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);+ }+ ui.painter().rect_stroke(pr, CornerRadius::ZERO, Stroke::new(1.0, t.border), egui::StrokeKind::Outside);+ let label_font = theme::medium(12.0);+ let label_w = (c.width() - 12.0).max(0.0);+ let page_label = crate::widgets::fit_line(&p.label, label_w, |s| crate::widgets::text_width(ui, s, &label_font));+ let label_pos = pos2(c.center().x, c.bottom() - 48.0);+ ui.painter().with_clip_rect(Rect::from_center_size(label_pos, vec2(label_w, 18.0))).text(+ label_pos,+ Align2::CENTER_CENTER,+ page_label,+ label_font,+ t.text_muted,+ );+ // The checkbox toggles just this page without requiring a modifier. Keep it+ // outside the page image, including on very tall or wide pages.+ let mut checked = view.selected.contains(&i);+ let check_rect = Rect::from_min_size(c.min + vec2(8.0, 8.0), Vec2::splat(20.0));+ let check = ui.push_id(("org-check", i), |ui| ui.put(check_rect, widgets::checkbox_without_text(&mut checked))).inner;+ let label = crate::i18n::fmt(tl!("Select page {label}"), &[("label", &p.label)]);+ check.widget_info(|| egui::WidgetInfo::selected(egui::Role::CheckBox, true, checked, label.clone()));+ if check.on_hover_text(label).changed() {+ view.click_page(i, egui::Modifiers::COMMAND, false);+ // The document shows the page picked here when the grid closes, as after a+ // Pages-panel click, so reopening the grid keeps the pick (issue #1910).+ view.go_to_page(i);+ }+ // Local actions always target the labelled page. The toolbar above the grid+ // remains the place for actions on the whole selection.+ if selected || resp.contains_pointer() || resp.has_focus() {+ let actions = Rect::from_center_size(pos2(c.center().x, c.bottom() - 24.0), vec2(84.0, 26.0));+ ui.scope_builder(+ egui::UiBuilder::new().id_salt(("org-actions", i)).max_rect(actions).layout(egui::Layout::left_to_right(egui::Align::Center)),+ |ui| {+ ui.spacing_mut().item_spacing.x = 3.0;+ ui.add_enabled_ui(editable, |ui| {+ for (icon, degrees, key) in+ [("rotate-ccw", -90, "Rotate page {label} counterclockwise"), ("rotate-cw", 90, "Rotate page {label} clockwise")]+ {+ let label = crate::i18n::fmt(tl!(key), &[("label", &p.label)]);+ if icons::button(ui, icon, 26.0, false, &label).clicked() {+ view.pending_edit = Some(Edit::RotatePages { pages: vec![i], degrees });+ }+ }+ let label = crate::i18n::fmt(tl!("Delete page {label}"), &[("label", &p.label)]);+ if ui.add_enabled_ui(info.pages.len() > 1, |ui| icons::button(ui, "trash-2", 26.0, false, &label)).inner.clicked() {+ view.pending_edit = Some(Edit::DeletePages { pages: vec![i] });+ }+ });+ },+ );+ }+ if resp.clicked() {+ let m = ui.input(|i| i.modifiers);+ view.click_page(i, m, false);+ view.go_to_page(i);+ }+ if resp.double_clicked() {+ open_page = Some(i);+ }+ // Right-click: Extract, Replace, Cut, Copy, Paste (on the selection, or this page).+ resp.context_menu(|ui| {+ if !view.selected.contains(&i) {+ view.selected = [i].into();+ view.go_to_page(i);+ }+ if ui.button(tl!("Extract pages")).clicked() {+ view.pending_action = Some(ViewAction::Extract);+ ui.close();+ }+ if ui.button(tl!("Split document…")).clicked() {+ view.pending_action = Some(ViewAction::SplitBeforeSelected);+ ui.close();+ }+ if ui.add_enabled(editable, egui::Button::new(tl!("Replace pages…"))).clicked() {+ view.pending_action = Some(ViewAction::ReplacePages);+ ui.close();+ }+ ui.separator();+ if ui.add_enabled(editable, egui::Button::new(tl!("Cut"))).clicked() {+ view.pending_action = Some(ViewAction::CopyPages { cut: true });+ ui.close();+ }+ if ui.button(tl!("Copy")).clicked() {+ view.pending_action = Some(ViewAction::CopyPages { cut: false });+ ui.close();+ }+ if ui.add_enabled(editable, egui::Button::new(tl!("Paste after"))).clicked() {+ view.pending_action = Some(ViewAction::PastePages);+ ui.close();+ }+ });+ }+ }+ // Between pages (and at both ends): insert files right there.+ if editable && !middle_gesture && view.org_drag.is_none() {+ let mid = |r: &Rect| r.top() + 16.0 + (cell.y - 88.0) / 2.0;+ for (i, c) in &cells {+ let label = info+ .pages+ .get(*i)+ .map(|p| crate::i18n::fmt(tl!("Insert a file before page {label}"), &[("label", &p.label)]))+ .unwrap_or_default();+ if gap_button(ui, *i, pos2(c.left(), mid(c)), cell.y - 88.0, label, t) {+ view.pending_action = Some(ViewAction::InsertFromFileAt(*i));+ }+ }+ if let Some((i, c)) = cells.last()+ && i + 1 == info.pages.len()+ && gap_button(ui, i + 1, pos2(c.right(), mid(c)), cell.y - 88.0, tl!("Insert a file at the end").to_string(), t)+ {+ view.pending_action = Some(ViewAction::InsertFromFileAt(i + 1));+ }+ }+ // While dragging: the gap the pages would go to, drawn as a bar.+ if let (Some(pages), Some(p)) = (view.org_drag.clone(), ui.input(|i| i.pointer.hover_pos())) {+ // Ctrl (Option on macOS) held over the drop copies the pages; see #2997.+ let copying = copy_modifier(ui.ctx(), &ui.input(|i| i.modifiers));+ if let Some(gap) = drop_gap(&cells, p) {+ let x = match cells.iter().find(|(i, _)| *i == gap) {+ Some((_, r)) => r.left() + 3.0,+ None => cells.last().map_or(0.0, |(_, r)| r.right() - 3.0),+ };+ let row = cells.iter().find(|(i, _)| *i == gap).or(cells.last()).map(|(_, r)| r.y_range()).unwrap_or(egui::Rangef::new(0.0, 0.0));+ ui.painter().line_segment([pos2(x, row.min + 10.0), pos2(x, row.max - 10.0)], Stroke::new(3.0, t.accent));+ let mut text_at = p + vec2(14.0, 14.0);+ if copying {+ // A "+" by the pointer: this drop copies the pages, it doesn't move them.+ let badge = p + vec2(12.0, 12.0);+ ui.painter().circle(badge, 9.0, t.accent, Stroke::new(1.0, t.accent));+ let ink = Stroke::new(1.5, Color32::WHITE);+ ui.painter().line_segment([badge - vec2(4.0, 0.0), badge + vec2(4.0, 0.0)], ink);+ ui.painter().line_segment([badge - vec2(0.0, 4.0), badge + vec2(0.0, 4.0)], ink);+ text_at.x += 18.0;+ }+ ui.painter().text(+ text_at,+ Align2::LEFT_TOP,+ if pages.len() == 1 { tl!("1 page").to_string() } else { crate::i18n::fmt(tl!("{n} pages"), &[("n", &pages.len().to_string())]) },+ theme::medium(12.0),+ t.accent_text,+ );+ }+ if drop {+ view.org_drag = None;+ if let Some(gap) = drop_gap(&cells, p) {+ if copying {+ // The copies land at the gap as it is: nothing leaves its place.+ view.pending_edit = Some(Edit::DuplicatePages { pages: pages.clone(), at: Some(gap) });+ view.selected = (gap..gap + pages.len()).collect();+ } else {+ // `to` counts positions without the moving pages.+ let to = gap - pages.iter().filter(|x| **x < gap).count();+ let first = pages[0];+ let contiguous = pages.windows(2).all(|w| w[1] == w[0] + 1);+ if !(contiguous && to == first) {+ view.pending_edit = Some(Edit::MovePages { pages: pages.clone(), to });+ view.selected = (to..to + pages.len()).collect();+ }+ }+ }+ }+ } else if drop {+ view.org_drag = None;+ }+ });++ ui.spacing_mut().scroll.fade.strength = fade_strength;+ // Files dragged in from outside go to the gap under the pointer. Some platforms don't say+ // where the pointer is until the files are dropped; then the whole grid is the target.+ let pointer = ui.input(|i| i.pointer.hover_pos()).filter(|p| viewport.contains(*p));+ view.grid_gap = pointer.filter(|_| editable && view.org_drag.is_none()).and_then(|p| drop_gap(&cells, p));+ if editable && ui.input(|i| !i.raw.hovered_files.is_empty()) {+ let painter = ui.painter().with_clip_rect(viewport);+ painter.rect_stroke(viewport.shrink(2.0), CornerRadius::same(6), Stroke::new(2.0, t.accent), egui::StrokeKind::Inside);+ if let Some(gap) = view.grid_gap {+ let at = cells.iter().find(|(i, _)| *i == gap).map(|(_, r)| (r.left() + 3.0, r.y_range()));+ if let Some((x, row)) = at.or(cells.last().map(|(_, r)| (r.right() - 3.0, r.y_range()))) {+ painter.line_segment([pos2(x, row.min + 10.0), pos2(x, row.max - 10.0)], Stroke::new(3.0, t.accent));+ }+ }+ // A "+" that follows the pointer.+ if let Some(p) = pointer {+ let at = p + vec2(16.0, 16.0);+ painter.circle_filled(at, 9.0, t.accent);+ painter.line_segment([at - vec2(4.0, 0.0), at + vec2(4.0, 0.0)], Stroke::new(1.5, Color32::WHITE));+ painter.line_segment([at - vec2(0.0, 4.0), at + vec2(0.0, 4.0)], Stroke::new(1.5, Color32::WHITE));+ }+ }+ view.auto_scroll.paint(ui, viewport);+ // Pinch, or Ctrl/⌘ with the wheel, zooms the grid about the page under the pointer.+ let pinch = crate::motion::zoom_delta(ui.ctx());+ if (pinch - 1.0).abs() > 0.001 && pointer.is_some() && !middle_gesture {+ view.grid_zoom_request = Some(view.grid_zoom * pinch);+ }+ if let Some(zoom) = view.grid_zoom_request.take() {+ let before = view.grid_zoom;+ view.set_grid_zoom(zoom);+ if view.grid_zoom != before {+ // Keep the page under the pointer (or else the first one in view) where it is.+ let under = pointer.and_then(|p| cells.iter().find(|(_, r)| r.contains(p)));+ let anchor = under.or_else(|| cells.iter().find(|(_, r)| r.bottom() > viewport.top()));+ view.grid_anchor = anchor.map(|(i, r)| (*i, r.top() - viewport.top()));+ ui.ctx().request_repaint();+ }+ }+ // When this frame's thumbnail will cover the cell, drop the sharp render without waiting+ // for that texture to arrive.+ let density = thumbnail_density(view.thumb_demand.len(), ppp);+ in_view.retain(|&(page, want)| {+ info.pages.get(page).is_none_or(|p| (device_pixels(p.width, thumbnail_scale(p.width, p.height, density)) as f32) < want * GRID_SHARP.start())+ });+ sharper.retain(|req| in_view.iter().any(|(page, _)| *page == req.page));+ view.grid_pages.retain(|page, _| in_view.iter().any(|(kept, _)| kept == page));+ // Sharp renders of the pages in view join this frame's demand ahead of the thumbnails.+ view.frame_queue.extend(sharper);+ if let Some(p) = open_page {+ view.organize = false;+ view.go_to_page(p);+ }+ }diff --cc crates/ui-egui/src/control/host.rsindex 000000000,1166c0e7e..64b10b69fmode 000000,100644..100644--- a/crates/ui-egui/src/control/host.rs+++ b/crates/ui-egui/src/control/host.rs@@@ -1,0 -1,188 +1,189 @@@+ use super::{Host, Reply, Value, json};++ impl Host for crate::PdfCraftApp {+ /// Cancel any in-progress pointer gesture in every open view.+ fn cancel_pointer_gestures(&mut self) {+ for view in &mut self.views {+ view.cancel_pointer_gestures();+ }+ }++ /// The input target: active document, open dialog/prompt, palette and find state.+ ///+ /// Synthetic input admitted for one generation is never replayed into another document or+ /// dialog. Only these identities are hashed, never text or document content.+ fn input_epoch(&self) -> u64 {+ use std::hash::{Hash as _, Hasher as _};+ let mut hasher = std::collections::hash_map::DefaultHasher::new();+ self.capture_epoch().hash(&mut hasher);+ // The focused widget is part of the input target: keys typed for one field must not land+ // in another after focus moves. Only the id value is hashed, never text.+ let focused = self.ctx.as_ref().and_then(|ctx| ctx.memory(|m| m.focused())).map(|id| id.value());+ focused.hash(&mut hasher);+ hasher.finish()+ }++ /// The captured content: active document and open dialog/prompt, never keyboard focus.+ fn capture_epoch(&self) -> u64 {+ use std::hash::{Hash as _, Hasher as _};+ let mut hasher = std::collections::hash_map::DefaultHasher::new();+ let doc = self.active.and_then(|i| self.views.get(i)).map(|v| v.id.0);+ doc.hash(&mut hasher);+ format!(+ "{:?}/{:?}/{:?}/{:?}/{:?}",+ self.dialog,+ self.password_prompt.is_some(),+ self.palette_open,+ self.close_request.is_some(),+ self.active.and_then(|i| self.views.get(i)).and_then(|v| v.find.as_ref().map(|_| true)),+ )+ .hash(&mut hasher);+ hasher.finish()+ }++ /// Control requests wait for the first UI pass that installs fonts; a font-gated early+ /// return cannot consume injected input or issue a screenshot.+ fn accepts_input(&self) -> bool {+ self.fonts_ready+ }++ fn panel(&mut self, reset: bool, params: &Value) -> Reply {+ crate::side_panels::command(self, reset, params)+ }++ fn quit(&mut self, ctx: &egui::Context) -> bool {+ self.request_quit(ctx)+ }++ fn state(&self) -> Value {+ let active = self.active.and_then(|i| self.views.get(i));+ let docs: Vec<Value> = self+ .views+ .iter()+ .enumerate()+ .filter_map(|(i, v)| {+ let d = self.session.get(v.id)?;+ Some(json!({ "tab": i, "doc": v.id.0, "name": d.name, "path": d.path, "pages": d.info.pages.len(), "dirty": d.dirty, "active": self.active == Some(i) }))+ })+ .collect();+ #[cfg(not(target_arch = "wasm32"))]+ let pending_opens: Vec<Value> =+ self.pending_opens.iter().map(|pending| json!({ "token": pending.token, "name": pending.name, "path": pending.path })).collect();+ #[cfg(target_arch = "wasm32")]+ let pending_opens: Vec<Value> = Vec::new();+ json!({+ "side_panels": crate::side_panels::state(self),+ "documents": docs,+ "pending_opens": pending_opens,+ "active": active.map(|v| json!({+ "doc": v.id.0,+ "page": v.current + 1,+ "zoom_percent": (v.zoom * 100.0).round(),+ "fit": format!("{:?}", v.fit),+ "layout": format!("{:?}", v.layout),+ "continuous": v.continuous(),+ "page_gaps": v.show_page_gaps,+ "organize": v.organize,+ "grid_zoom": v.grid_zoom(),+ "thumbnail_zoom": v.thumbnail_zoom(),+ // Pages picked in the organize grid or the Pages panel (empty: the current page).+ "selected_pages": v.selected.iter().map(|p| p + 1).collect::<Vec<_>>(),+ "auto_scrolling": v.auto_scrolling(),+ "raster_memory": v.raster_memory(),+ "viewport": [v.viewport_rect().min.x, v.viewport_rect().min.y, v.viewport_rect().max.x, v.viewport_rect().max.y],+ "find_open": v.find.is_some(),+ "page_errors": v.page_errors().iter().map(|(p, e)| json!({ "page": p + 1, "error": e })).collect::<Vec<_>>(),+ // Where pages are on screen (points), to aim ui.click / ui.drag at page content.+ "pages_on_screen": v.visible_page_rects().iter().map(|(p, r)| json!({ "page": p + 1, "rect": [r.min.x, r.min.y, r.max.x, r.max.y] })).collect::<Vec<_>>(),+ "selected_comment": v.comments.selected.map(|(p, i)| json!({ "page": p + 1, "index": i + 1 })),+ "comment_composer_open": v.comments.composer.is_some(),+ })),+ // The Combine files tab: how its files show, and each grid thumbnail's state.+ "combine": {+ "showing": self.combine_showing(),+ "view": self.combine_view.as_str(),+ "zoom": self.combine_zoom,+ "files": self.combine_draft.iter().map(|f| f.name.clone()).collect::<Vec<_>>(),+ "selected": self.combine_selection(),+ "thumbnails": self.combine_thumbnails().iter().map(|t| format!("{t:?}")).collect::<Vec<_>>(),+ "expanded": self.combine_expanded().iter().filter_map(|i| self.combine_draft.get(*i).map(|f| f.name.clone())).collect::<Vec<_>>(),+ "preview": self.combine_preview().map(|(file, page, render)| json!({ "file": file, "page": page + 1, "render": format!("{render:?}") })),+ },+ "quick_tool": match self.quick_tool {+ crate::QuickTool::Measure(t) => format!("measure-{}", t.name()),+ crate::QuickTool::Select => "select".to_string(),+ crate::QuickTool::Hand => "hand".to_string(),+ crate::QuickTool::Crop => "crop".to_string(),+ crate::QuickTool::EnhanceCamera => "enhance-camera".to_string(),+ crate::QuickTool::Redact => "redact".to_string(),+ crate::QuickTool::AddText => "add-text".to_string(),+ crate::QuickTool::EditText => "edit-text".to_string(),+ crate::QuickTool::Link => "link".to_string(),+ crate::QuickTool::SignArea { certify: false } => "sign".to_string(),+ crate::QuickTool::SignArea { certify: true } => "certify".to_string(),+ crate::QuickTool::MarqueeZoom => "marquee-zoom".to_string(),+ crate::QuickTool::Snapshot => "snapshot".to_string(),+ crate::QuickTool::ColumnSelect => "column-select".to_string(),+ crate::QuickTool::Stamp(k) => format!("stamp-{}", k.name().trim_start_matches("PC").to_ascii_lowercase()),+ crate::QuickTool::CustomStamp(i) => format!("custom-stamp-{i}"),+ crate::QuickTool::Fill(f) => format!("fill-{}", f.command().trim_start_matches("sign.fill.")),+ crate::QuickTool::Field(f) => format!("field-{}", f.command().trim_start_matches("form.add.")),+ crate::QuickTool::Comment(t) => t.command().trim_start_matches("comment.").to_string(),+ },+ "home": self.active.is_none(),+ "mode": format!("{:?}", self.mode),+ "default_mode": self.default_mode,+ "comment_tool_pinned": self.comment_prefs.pinned,+ "left_panel": if self.left_open { json!(format!("{:?}", self.left)) } else { Value::Null },+ "tools_side": if self.side_panels.tools_on_right() { "right" } else { "left" },+ "right_panel": self.right.map(|r| format!("{r:?}")),+ "dialog": self.dialog.map(|d| format!("{d:?}")),+ "palette_open": self.palette_open,+ "theme": format!("{:?}", self.theme),+ "theme_preference": self.theme_preference,++ "show_page_edge_shadows": self.show_page_edge_shadows,+ "language": self.language,+ "notice": self.toast.as_ref().map(|t| t.0.clone()),+ "progress": self.progress_notice.as_ref().map(|p| json!({ "label": p.label, "fraction": p.fraction })),+ "password_prompt": self.password_prompt.is_some(),+ "close_prompt": self.close_request.is_some(),+ })+ }++ fn command(&mut self, id: &str) -> Reply {+ let spec = pdfcraft_engine::commands::command(id).ok_or_else(|| format!("unknown command {id:?} (see ui.commands)"))?;+ if !self.command_enabled(spec) {+ return Err(format!("{id} is disabled right now"));+ }+ self.execute(id);+ Ok(json!({ "ran": id }))+ }++ fn commands(&self) -> Value {+ let mut list: Vec<Value> = pdfcraft_engine::commands::COMMANDS+ .iter()+ .map(|c| json!({ "id": c.id, "label": c.label, "menu": c.menu, "enabled": self.command_enabled(c), "shortcut": c.shortcut.map(|s| s.label(cfg!(target_os = "macos"))) }))+ .collect();+ list.push(json!({"id": "ui.panel", "label": "Side panel", "enabled": true, "params": "panel: tools or side; open: boolean; width: number (clamped to the panel's limits)"}));+ json!({ "commands": list })+ }++ fn set(&mut self, key: &str, value: &str) -> Reply {+ self.set_option(key, value).map(|()| json!({ "set": key, "value": value }))+ }++ #[cfg(not(target_arch = "wasm32"))]+ fn open(&mut self, path: &str) -> Reply {+ match self.open_path(path) {+ crate::OpenOutcome::Opened => Ok(json!({ "opened": path, "password_prompt": self.password_prompt.is_some() })),+ crate::OpenOutcome::Focused => Ok(json!({ "opened": path, "focused": true })),+ crate::OpenOutcome::Pending => Ok(json!({ "accepted": path, "pending": true })),+ crate::OpenOutcome::Failed => Err(self.toast.as_ref().map(|t| t.0.clone()).unwrap_or_else(|| format!("couldn't open {path}"))),+ }+ }++ #[cfg(target_arch = "wasm32")]+ fn open(&mut self, _path: &str) -> Reply {+ Err("ui.open needs a file system; on the web, drop the file on the page".into())+ }+ }diff --cc crates/ui-egui/src/i18n/ar.tsvindex 993fba470,56f62b773..6e06c424d--- a/crates/ui-egui/src/i18n/ar.tsv+++ b/crates/ui-egui/src/i18n/ar.tsv@@@ -2711,4 -2792,65 +2792,66 @@@ certificate Version الإصدا�Make properties default جعل الخصائص افتراضيةPages selected الصفحات المحددةPage properties خصائص الصفحة+ Create & Edit الإنشاء والتحرير+ Review & Compare المراجعة والمقارنة+ Forms & Signatures النماذج والتوقيعات+ Protect & Standardize الحماية والتوحيد القياسي+ Customize & Automate التخصيص والأتمتة+ No tools match your search. لا توجد أدوات تطابق بحثك.+ Expand all tools توسيع كل الأدوات+ Collapse all tools طي كل الأدوات+ Attach a file… إرفاق ملف…+ Delete attachment حذف المرفق+ Attaching files is not available on the web yet إرفاق الملفات غير متاح على الويب بعد+ Attach {name} إرفاق {name}+ Delete attachment {key} حذف المرفق {key}+ Bulleted list قائمة نقطية+ Numbered list قائمة مرقمة+ Alignment المحاذاة+ Superscript نص مرتفع+ Subscript نص منخفض+ Paragraph spacing تباعد الفقرات+ Less أقل+ Other options خيارات أخرى+ Thumbnail size حجم الصور المصغرة+ Smaller thumbnails تصغير الصور المصغرة+ Larger thumbnails تكبير الصور المصغرة+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment إعادة تشكيل التعليق++ # Prepare a form ▸ Text field table+ Add text field table إضافة جدول حقول نصية+ Text field table جدول حقول نصية+ Text Field Table جدول حقول نصية+ Columns الأعمدة+ Row spacing المسافة بين الصفوف+ Column spacing المسافة بين الأعمدة+ First row number رقم الصف الأول+ Column widths عروض الأعمدة+ Distribute evenly توزيع بالتساوي+ Field names أسماء الحقول+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N أو {row} هو رقم الصف، و{col} رقم العمود، و{seq} رقم الخلية. إذا لم يوجد أي منها، يُضاف رقم الصف في النهاية.+ Column {n} العمود {n}+ Add fields إضافة الحقول+ the rows are too short: make the area taller, or use fewer rows or less row spacing الصفوف قصيرة جدًا: اجعل المنطقة أطول، أو استخدم صفوفًا أقل أو مسافة أقل بين الصفوف+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing أحد الأعمدة ضيق جدًا: اجعل المنطقة أعرض، أو امنح العمود عرضًا أكبر، أو استخدم أعمدة أقل أو مسافة أقل بين الأعمدة+ field names can't contain a period: {name} لا يمكن أن تحتوي أسماء الحقول على نقطة: {name}+ two cells would both be named {name} ستحمل خليتان الاسم نفسه {name}+ a field named {name} already exists يوجد حقل باسم {name} بالفعل++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today اليوم+ @plural {n} reply|{n} replies {n} رد|{n} رد|{n} ردّان|{n} ردود|{n} ردًا|{n} رد++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools أدوات الصفحات+ Insert pages from a file after the selection… إدراج صفحات من ملف بعد التحديد…+ Rotate the selected pages counterclockwise تدوير الصفحات المحددة عكس اتجاه عقارب الساعة+ Rotate the selected pages clockwise تدوير الصفحات المحددة باتجاه عقارب الساعة+ Extract the selected pages… استخراج الصفحات المحددة…+ Delete the selected pages حذف الصفحات المحددة++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply خيارات هذا الرد+ Export value قيمة التصدير+ Show Page Edge Shadows إظهار ظلال حواف الصفحاتdiff --cc crates/ui-egui/src/i18n/bg.tsvindex 1d67e340c,ceccdf958..8fe56514d--- a/crates/ui-egui/src/i18n/bg.tsv+++ b/crates/ui-egui/src/i18n/bg.tsv@@@ -2397,4 -2478,66 +2478,67 @@@ animation effects Off Изключен�Make properties default Задаване като свойства по подразбиранеPages selected Избрани странициPage properties Свойства на страницата+ Create & Edit Създаване и редактиране+ Review & Compare Преглед и сравнение+ Forms & Signatures Формуляри и подписи+ Protect & Standardize Защита и стандартизация+ Customize & Automate Персонализиране и автоматизация+ No tools match your search. Няма инструменти, отговарящи на търсенето.+ Expand all tools Разгъване на всички инструменти+ Collapse all tools Свиване на всички инструменти+ Attach a file… Прикачване на файл…+ Delete attachment Изтриване на прикачения файл+ Attaching files is not available on the web yet Прикачването на файлове още не е налично в уеб версията+ Attach {name} Прикачване на {name}+ Delete attachment {key} Изтриване на прикачения файл {key}+ Font Шрифт+ Bulleted list Списък с водещи символи+ Numbered list Номериран списък+ Alignment Подравняване+ Superscript Горен индекс+ Subscript Долен индекс+ Paragraph spacing Разстояние между абзаците+ Less По-малко+ Other options Други опции+ Thumbnail size Размер на миниатюрите+ Smaller thumbnails По-малки миниатюри+ Larger thumbnails По-големи миниатюри+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Промяна на формата на коментара++ # Prepare a form ▸ Text field table+ Add text field table Добави таблица от текстови полета+ Text field table Таблица от текстови полета+ Text Field Table Таблица от текстови полета+ Columns Колони+ Row spacing Разстояние между редовете+ Column spacing Разстояние между колоните+ First row number Номер на първия ред+ Column widths Ширини на колоните+ Distribute evenly Разпредели равномерно+ Field names Имена на полетата+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N или {row} е номерът на реда, {col} – на колоната, {seq} – на клетката. Без тях номерът на реда се добавя накрая.+ Column {n} Колона {n}+ Add fields Добави полета+ the rows are too short: make the area taller, or use fewer rows or less row spacing редовете са твърде ниски: направете областта по-висока или използвайте по-малко редове или по-малко разстояние между тях+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing колона е твърде тясна: направете областта по-широка, дайте ѝ повече място или използвайте по-малко колони или по-малко разстояние между тях+ field names can't contain a period: {name} имената на полетата не може да съдържат точка: {name}+ two cells would both be named {name} две клетки биха имали едно и също име {name}+ a field named {name} already exists вече съществува поле с име {name}++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Днес+ @plural {n} reply|{n} replies {n} отговор|{n} отговора++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Инструменти за страници+ Insert pages from a file after the selection… Вмъкване на страници от файл след избраното…+ Rotate the selected pages counterclockwise Завъртане на избраните страници обратно на часовниковата стрелка+ Rotate the selected pages clockwise Завъртане на избраните страници по часовниковата стрелка+ Extract the selected pages… Извличане на избраните страници…+ Delete the selected pages Изтриване на избраните страници++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Опции за този отговор+ Export value Стойност за експортиране+ Show Page Edge Shadows Показване на сенки по краищата на страницитеdiff --cc crates/ui-egui/src/i18n/cs.tsvindex ce2eeaa49,8bfde72a8..8ecd80d30--- a/crates/ui-egui/src/i18n/cs.tsv+++ b/crates/ui-egui/src/i18n/cs.tsv@@@ -2508,4 -2589,299 +2589,300 @@@ animation effects Off VypnutMake properties default Nastavit vlastnosti jako výchozíPages selected Vybrané stránkyPage properties Vlastnosti stránky+ Create & Edit Vytváření a úpravy+ Review & Compare Revize a porovnání+ Forms & Signatures Formuláře a podpisy+ Protect & Standardize Ochrana a standardizace+ Customize & Automate Přizpůsobení a automatizace+ No tools match your search. Hledání neodpovídá žádný nástroj.+ Expand all tools Rozbalit všechny nástroje+ Collapse all tools Sbalit všechny nástroje+ Attach a file… Připojit soubor…+ Delete attachment Odstranit přílohu+ Attaching files is not available on the web yet Připojování souborů zatím na webu není k dispozici+ Attach {name} Připojit {name}+ Delete attachment {key} Odstranit přílohu {key}+ Font Písmo+ Bulleted list Odrážkový seznam+ Numbered list Číslovaný seznam+ Alignment Zarovnání+ Superscript Horní index+ Subscript Dolní index+ Paragraph spacing Mezera mezi odstavci+ Less Méně+ Other options Další možnosti+ Thumbnail size Velikost miniatur+ Smaller thumbnails Menší miniatury+ Larger thumbnails Větší miniatury+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Změnit tvar komentáře++ # What the layers below word for themselves (engine `WORDINGS` lists): accessibility findings and+ # the saved report, PDF/A problems, signature details and the changes they name, pages to print,+ # history labels. Terms: timestamp = "časové razítko", timestamp authority = "autorita časových+ # razítek", signer = "podepisující osoba", byte range = "rozsah bajtů".+ A font isn't embedded Písmo není vložené+ A {} action isn't allowed Akce {} není povolena+ A {} annotation has additional actions Anotace {} má další akce+ A {} annotation has no appearance stream Anotace {} nemá datový proud vzhledu+ A {} annotation isn't set to print, or is hidden Anotace {} není nastavena k tisku nebo je skrytá+ Accessibility Report Zpráva o přístupnosti+ Change Author Změnit: Autor+ Change Keywords Změnit: Klíčová slova+ Change Subject Změnit: Předmět+ Change Title Změnit: Název+ Create links Vytvořit odkazy+ Detailed Report Podrobná zpráva+ DeviceCMYK is used, but the PDF/A output intent isn't a CMYK profile Je použit DeviceCMYK, ale výstupní záměr PDF/A není profil CMYK+ DeviceRGB is used, but the PDF/A output intent isn't an RGB profile Je použit DeviceRGB, ale výstupní záměr PDF/A není profil RGB+ Field "{}" on page {p} has no description (tooltip) Pole „{}“ na stránce {p} nemá popis (popisek nástroje)+ Filename Název souboru+ Flatten Fill & Sign Sloučit Vyplnit a podepsat se stránkou+ Font (unnamed) on page {p} doesn't map its characters to Unicode Písmo (bez názvu) na stránce {p} nemapuje své znaky na Unicode+ Font {} on page {p} doesn't map its characters to Unicode Písmo {} na stránce {p} nemapuje své znaky na Unicode+ Form field on page {p} isn't tagged Formulářové pole na stránce {p} není označkované+ H{n} follows an H{d}; headings should not skip levels H{n} následuje po H{d}; nadpisy by neměly přeskakovat úrovně+ No document language is set Není nastaven jazyk dokumentu+ No page has text: the document appears to be images of pages Žádná stránka nemá text: dokument se zdá být tvořen obrázky stránek+ Page {p} doesn't tab in structure order Stránka {p} nepřechází tabulátorem v pořadí struktury+ Page {p}: {n} untagged content item Stránka {p}: neoznačkované položky obsahu: {n}+ Page {p}: {n} untagged content items Stránka {p}: neoznačkované položky obsahu: {n}+ Page {} has additional actions Stránka {} má další akce+ PdfCraft can't check this signature yet: {}. PdfCraft zatím nedokáže tento podpis ověřit: {}.+ Report created Zpráva vytvořena+ Rule Name Název pravidla+ Save as {level} Uložit jako {level}+ Signature is invalid Podpis je neplatný+ Signature is valid Podpis je platný+ Signature validity is unknown Platnost podpisu je neznámá+ Signing time is from the clock on the signer's computer. Čas podpisu pochází z hodin v počítači podepisující osoby.+ The ECDSA signature is not in canonical DER (trailing bytes, padding or a missing sign byte); it was read anyway. Podpis ECDSA není v kanonickém DER (přebytečné bajty, výplň nebo chybějící bajt znaménka); přesto byl načten.+ The ECDSA signature is the raw r and s values instead of a DER sequence; it was read anyway. Podpis ECDSA tvoří holé hodnoty r a s místo sekvence DER; přesto byl načten.+ The RSA signature value does not have the length of the key's modulus (leading zero bytes dropped or added); it was read anyway. Hodnota podpisu RSA nemá délku modulu klíče (úvodní nulové bajty chybí nebo přebývají); přesto byla načtena.+ The RSA signature's DigestInfo has no NULL parameter (older signers write it so); it was read anyway. DigestInfo podpisu RSA nemá parametr NULL (starší podepisovací programy jej tak zapisují); přesto byl načten.+ The certificate of {} does not allow this many CA certificates below it (path length), so it is not used to vouch for {}. Certifikát {} nepovoluje pod sebou tolik certifikátů CA (délka cesty), proto se nepoužije k ručení za {}.+ The certificate of {} is not a CA certificate that may issue certificates, so it is not used to vouch for {}. Certifikát {} není certifikát CA, který smí vydávat certifikáty, proto se nepoužije k ručení za {}.+ The certificate of {} has critical extensions PdfCraft does not recognize, so it is not used to vouch for {}. Certifikát {} má kritická rozšíření, která PdfCraft nezná, proto se nepoužije k ručení za {}.+ The certificate of {} was not valid at the time of signing, so it is not used to vouch for {}. Certifikát {} nebyl v době podpisu platný, proto se nepoužije k ručení za {}.+ The checker found problems which may prevent the document from being fully accessible. Kontrola našla problémy, které mohou bránit plné přístupnosti dokumentu.+ The document has been altered or corrupted since the signature was applied. Dokument byl od připojení podpisu změněn nebo poškozen.+ The document has been altered or corrupted since the timestamp was applied. Dokument byl od připojení časového razítka změněn nebo poškozen.+ The document has been altered since this signature was applied in ways it does not permit ({}). Dokument byl od připojení tohoto podpisu změněn způsobem, který podpis nepovoluje ({}).+ The document has been altered since this timestamp was applied in ways it does not permit ({}). Dokument byl od připojení tohoto časového razítka změněn způsobem, který razítko nepovoluje ({}).+ The document has been modified since this signature was applied, but the changes are permitted ({}). Dokument byl od připojení tohoto podpisu upraven, ale změny jsou povolené ({}).+ The document has been modified since this timestamp was applied, but the changes are permitted ({}). Dokument byl od připojení tohoto časového razítka upraven, ale změny jsou povolené ({}).+ The document has no tags (structure tree) Dokument nemá tagy (strom struktury)+ The document has no title Dokument nemá název+ The document isn't marked as tagged (MarkInfo Marked) Dokument není označen jako označkovaný (MarkInfo Marked)+ The document isn't tagged, so none of its content is Dokument není označkovaný, a tak není označkovaný ani žádný jeho obsah+ The document's embedded revocation information shows that the signer's certificate has not been revoked. Informace o odvolání vložené v dokumentu ukazují, že certifikát podepisující osoby nebyl odvolán.+ The embedded timestamp token is valid and its authority is trusted; trusted time is {}. Vložené časové razítko je platné a jeho autorita je důvěryhodná; důvěryhodný čas je {}.+ The font {} isn't embedded Písmo {} není vložené+ The metadata doesn't identify the file as {} Metadata neoznačují soubor jako {}+ The security settings don't allow screen readers to read the text Nastavení zabezpečení nedovoluje čtečkám obrazovky číst text+ The signature algorithm and the SignerInfo's digest algorithm name different hashes; the signature was made with the SignerInfo's. Algoritmus podpisu a algoritmus otisku v SignerInfo uvádějí různé hashe; podpis byl vytvořen tím ze SignerInfo.+ The signature carries an unverified timestamp ({}): the timestamp authority is not in your list of trusted certificates, so the signing time claimed by the signer is used instead. Podpis nese neověřené časové razítko ({}): autorita časových razítek není ve vašem seznamu důvěryhodných certifikátů, proto se místo něj použije čas podpisu uvedený podepisující osobou.+ The signature contents are not hexadecimal. Obsah podpisu není šestnáctkový.+ The signature could not be checked ({}). Podpis nebylo možné zkontrolovat ({}).+ The signature could not be read ({}). Podpis nebylo možné načíst ({}).+ The signature could not be verified ({}). Podpis nebylo možné ověřit ({}).+ The signature has no valid byte range. Podpis nemá platný rozsah bajtů.+ The signature includes an embedded timestamp. Podpis obsahuje vložené časové razítko.+ The signature is BER-encoded (indefinite lengths) rather than DER; it was read leniently. Podpis je kódován v BER (neurčité délky) místo DER; byl načten benevolentně.+ The signature uses the legacy adbe.x509.rsa_sha1 format. Podpis používá zastaralý formát adbe.x509.rsa_sha1.+ The signature value does not match the signer's certificate: the signature is corrupt. Hodnota podpisu neodpovídá certifikátu podepisující osoby: podpis je poškozený.+ The signature's byte range does not exclude exactly its contents. Rozsah bajtů podpisu nevynechává přesně jeho obsah.+ The signature's byte range does not match the file. Rozsah bajtů podpisu neodpovídá souboru.+ The signature's timestamp token could not be verified ({}). Časové razítko podpisu nebylo možné ověřit ({}).+ The signature's timestamp token does not cover the signature value. Časové razítko podpisu nepokrývá hodnotu podpisu.+ The signed content is a constructed (segmented) OCTET STRING, as BER allows; it was read anyway. Podepsaný obsah je složený (segmentovaný) OCTET STRING, jak BER dovoluje; přesto byl načten.+ The signer's certificate does not allow digital signatures (its key usage has neither digital signature nor non-repudiation). Certifikát podepisující osoby nepovoluje digitální podpisy (jeho použití klíče nezahrnuje digitální podpis ani nepopiratelnost).+ The signer's certificate has been revoked ({}). Certifikát podepisující osoby byl odvolán ({}).+ The signer's certificate has critical extensions PdfCraft does not recognize ({}). Certifikát podepisující osoby má kritická rozšíření, která PdfCraft nezná ({}).+ The signer's certificate is not in the signature. Certifikát podepisující osoby není v podpisu.+ The signer's certificate is not issued for signing documents (its extended key usage has no document-signing purpose). Certifikát podepisující osoby není vydán k podepisování dokumentů (jeho rozšířené použití klíče nezahrnuje podepisování dokumentů).+ The signer's certificate was not valid at the time of signing. Certifikát podepisující osoby nebyl v době podpisu platný.+ The signer's identity is unknown because it has not been included in your list of trusted certificates and none of its parent certificates are trusted certificates. Identita podepisující osoby je neznámá, protože není ve vašem seznamu důvěryhodných certifikátů a žádný z jejích nadřazených certifikátů není důvěryhodný.+ The signer's identity is valid. Identita podepisující osoby je platná.+ The timestamp authority's certificate was not valid at the time of timestamping. Certifikát autority časových razítek nebyl v době vystavení razítka platný.+ The timestamp authority's certificate is not issued for time stamping. Certifikát autority časových razítek není vystaven pro vydávání časových razítek.+ The timestamp contents are not hexadecimal. Obsah časového razítka není šestnáctkový.+ The timestamp has no valid byte range. Časové razítko nemá platný rozsah bajtů.+ The timestamp token could not be read ({}). Časové razítko nebylo možné načíst ({}).+ The timestamp token is valid and its authority is trusted. Časové razítko je platné a jeho autorita je důvěryhodná.+ The timestamp token is valid, but the timestamp authority is not in your list of trusted certificates. Časové razítko je platné, ale autorita časových razítek není ve vašem seznamu důvěryhodných certifikátů.+ The timestamp's byte range does not exclude exactly its contents. Rozsah bajtů časového razítka nevynechává přesně jeho obsah.+ The timestamp's byte range does not match the file. Rozsah bajtů časového razítka neodpovídá souboru.+ The window shows the file name, not the title (Initial View > Show) Okno zobrazuje název souboru, ne název dokumentu (Počáteční zobrazení > Zobrazit)+ This document has not been modified since this signature was applied. Tento dokument nebyl od připojení tohoto podpisu upraven.+ This document has not been modified since this timestamp was applied. Tento dokument nebyl od připojení tohoto časového razítka upraven.+ This signature uses RIPEMD-160, a legacy 160-bit hash algorithm that is no longer recommended for signatures. It still validates, but it should not be relied on. Tento podpis používá RIPEMD-160, zastaralý 160bitový hashovací algoritmus, který se už pro podpisy nedoporučuje. Podpis se stále ověří, ale nelze na něj spoléhat.+ This signature uses SHA-1, a weak hash algorithm: collisions in it have been demonstrated. It still validates because many documents signed years ago use it, but it should not be relied on. Tento podpis používá SHA-1, slabý hashovací algoritmus, u kterého byly prokázány kolize. Stále se ověří, protože jej používá mnoho dokumentů podepsaných před lety, ale nelze na něj spoléhat.+ Unsigned signature field Nepodepsané podpisové pole+ alternate text hides an annotation inside it alternativní text skrývá anotaci uvnitř+ alternate text on an element with no page content alternativní text u prvku bez obsahu stránky+ comments komentáře+ document security store úložiště zabezpečení dokumentu+ document structure struktura dokumentu+ form fill vyplnění formuláře+ its alternate text is inside another element's and will never be read jeho alternativní text je uvnitř alternativního textu jiného prvku a nikdy nebude přečten+ links odkazy+ metadata metadata+ no alternate text chybí alternativní text+ no header cells (TH) chybí buňky záhlaví (TH)+ no summary chybí souhrn+ not in a TR není v TR+ not in a Table, THead, TBody or TFoot není v Table, THead, TBody ani TFoot+ not in an L (list) není v L (seznam)+ not in an LI (list item) není v LI (položka seznamu)+ other changes jiné změny+ page content obsah stránek+ page {n} is out of range (1–{count}) stránka {n} je mimo rozsah (1–{count})+ pages added or removed přidané nebo odebrané stránky+ rows have between {min} and {max} columns řádky mají {min} až {max} sloupců+ the first heading is an H{n}; headings should not skip levels první nadpis je H{n}; nadpisy by neměly přeskakovat úrovně+ the signed version could not be read podepsanou verzi nebylo možné načíst+ {n} pages and no bookmarks Počet stránek: {n}, žádné záložky+ {page} is not a page number or label {page} není číslo ani označení stránky+ {ty} element on page {p}: {what} Prvek {ty} na stránce {p}: {what}+ {ty} element: {what} Prvek {ty}: {what}+ {} annotation on page {p} isn't tagged Anotace {} na stránce {p} není označkovaná+ {} annotations aren't allowed Anotace {} nejsou povoleny+ … and {n} more … a další ({n})++ # Labels other catalogs carry (shared buttons, tooltips with key caps, the folder picker).+ on page {label} na stránce {label}+ of z+ Add the PDFs to combine Přidejte soubory PDF ke sloučení+ Added the first {n} PDFs in {folder} Přidány první soubory PDF ze složky {folder} (počet: {n})+ Always Vždy+ Automatically Automaticky+ Choose a file… Vybrat soubor…+ Choose a folder… Vybrat složku…+ Choose… Vybrat…+ Color Barva+ Comment Komentář+ Comment and review Komentovat a revidovat+ Copied to clipboard Zkopírováno do schránky+ Copy to clipboard Kopírovat do schránky+ Create folder Vytvořit složku+ Disabled Vypnuto+ Document properties (⌘D) Vlastnosti dokumentu (⌘D)+ Drop PDFs or folders here, or choose them. Přetáhněte sem soubory PDF nebo složky, nebo je vyberte.+ Duplicate Duplikovat+ Enabled Zapnuto+ Error Chyba+ Every PDF in the folder Všechny soubory PDF ve složce+ Every PDF in the folder and the folders inside it Všechny soubory PDF ve složce a jejích podsložkách+ Folder Složka+ Help… Nápověda…+ Import Importovat+ Information Informace+ Loading… Načítání…+ Mouse wheel scroll speed Rychlost posouvání kolečkem myši+ Move Přesunout+ Never Nikdy+ New bookmark (⌘B) Nová záložka (⌘B)+ Next Další+ Next (⌘G) Další (⌘G)+ No PDFs found in {folder} Ve složce {folder} nebyly nalezeny žádné soubory PDF+ No results Žádné výsledky+ On Zapnuto+ Open a PDF (⌘O) Otevřít PDF (⌘O)+ Open folder Otevřít složku+ Organize Uspořádat+ Page {n} Stránka {n}+ Page {n} of {total} Stránka {n} z {total}+ Paste Vložit+ Previous Předchozí+ Previous (⇧⌘G) Předchozí (⇧⌘G)+ Print (⌘P) Tisk (⌘P)+ Refresh Obnovit+ Rotate view clockwise (⇧⌘+) Otočit zobrazení po směru hodinových ručiček (⇧⌘+)+ Save changes? Uložit změny?+ Save file Uložit soubor+ Search results Výsledky hledání+ Select all Vybrat vše+ Success Hotovo+ System Podle systému+ The password must have at least 6 characters. Heslo musí mít alespoň 6 znaků.+ The standard fonts can't draw “{c}” ({code}). Only Western European characters can be added as text for now. Standardní písma nedokážou vykreslit „{c}“ ({code}). Jako text lze zatím přidat jen západoevropské znaky.+ This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Tento soubor se na disku změnil. Načtěte ho znovu, abyste viděli novou verzi; neuložené změny budou ztraceny.+ Theme Motiv+ Warning Upozornění+ Zoom in (⌘+) Přiblížit (⌘+)+ Zoom in / out (also pinch or ⌘-scroll) Přiblížit / oddálit (také sevřením prstů nebo posouváním s ⌘)+ Zoom out (⌘−) Oddálit (⌘−)+ @plural {n} comment|{n} comments {n} komentář|{n} komentáře|{n} komentářů+ @plural {n} file|{n} files {n} soubor|{n} soubory|{n} souborů+ @plural {n} result|{n} results {n} výsledek|{n} výsledky|{n} výsledků+ theme Appearance Vzhled++ # The date picker's weekday heads.+ calendar weekday Su Ne+ calendar weekday Mo Po+ calendar weekday Tu Út+ calendar weekday We St+ calendar weekday Th Čt+ calendar weekday Fr Pá+ calendar weekday Sa So++ # A certificate's fields in the certificate viewer.+ certificate Issued to Vydáno pro+ certificate Issued by Vydal+ certificate Valid from Platný od+ certificate Valid to Platný do+ certificate Intended usage Zamýšlené použití+ certificate Serial number Sériové číslo+ certificate Issuer Vydavatel+ certificate Validity starts Začátek platnosti+ certificate Validity ends Konec platnosti+ certificate Public key Veřejný klíč+ certificate Basic constraints Základní omezení+ certificate Key usage Použití klíče+ certificate Self-signed Samopodepsaný+ certificate SHA-1 digest Otisk SHA-1+ certificate SHA-256 digest Otisk SHA-256+ certificate Version Verze+ The signature's signed attributes have no content type, which CMS requires; it was read anyway. Podepsané atributy podpisu neobsahují typ obsahu, který CMS vyžaduje; přesto byl podpis načten.+ This signature uses an RSA key shorter than 2048 bits, which is no longer considered strong enough for signatures. It still validates, but it should not be relied on. Tento podpis používá klíč RSA kratší než 2048 bitů, který už se pro podpisy nepovažuje za dostatečně silný. Ověření stále projde, ale nelze se na něj spoléhat.+ The signature's signed attributes have no message digest, so the signature does not cover the document. Podepsané atributy podpisu neobsahují otisk zprávy, takže se podpis na dokument nevztahuje.+ The signature's signed attributes name a content type other than data, so it is not a signature of the document. Podepsané atributy podpisu uvádějí jiný typ obsahu než data, takže nejde o podpis dokumentu.+ Remove {standard} identification Odebrat identifikaci {standard}++ # Prepare a form ▸ Text field table+ Add text field table Přidat tabulku textových polí+ Text field table Tabulka textových polí+ Text Field Table Tabulka textových polí+ Columns Sloupce+ Row spacing Mezera mezi řádky+ Column spacing Mezera mezi sloupci+ First row number Číslo prvního řádku+ Column widths Šířky sloupců+ Distribute evenly Rozložit rovnoměrně+ Field names Názvy polí+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N nebo {row} je číslo řádku, {col} číslo sloupce a {seq} číslo buňky. Bez nich se číslo řádku přidá na konec.+ Column {n} Sloupec {n}+ Add fields Přidat pole+ the rows are too short: make the area taller, or use fewer rows or less row spacing řádky jsou příliš nízké: zvětšete výšku oblasti nebo použijte méně řádků či menší mezeru mezi řádky+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing sloupec je příliš úzký: rozšiřte oblast, dejte sloupci více místa nebo použijte méně sloupců či menší mezeru mezi sloupci+ field names can't contain a period: {name} názvy polí nesmějí obsahovat tečku: {name}+ two cells would both be named {name} dvě buňky by se jmenovaly {name}+ a field named {name} already exists pole s názvem {name} už existuje++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Dnes+ @plural {n} reply|{n} replies {n} odpověď|{n} odpovědi|{n} odpovědí++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Nástroje stránek+ Insert pages from a file after the selection… Vložit stránky ze souboru za výběr…+ Rotate the selected pages counterclockwise Otočit vybrané stránky proti směru hodinových ručiček+ Rotate the selected pages clockwise Otočit vybrané stránky po směru hodinových ručiček+ Extract the selected pages… Extrahovat vybrané stránky…+ Delete the selected pages Odstranit vybrané stránky++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Možnosti této odpovědi+ Export value Exportní hodnota+ Show Page Edge Shadows Zobrazovat stíny okrajů stránekdiff --cc crates/ui-egui/src/i18n/de.tsvindex 0dd047f1a,83684c08e..2d6afea2c--- a/crates/ui-egui/src/i18n/de.tsv+++ b/crates/ui-egui/src/i18n/de.tsv@@@ -2435,4 -2516,66 +2516,67 @@@ animation effects Off AuMake properties default Eigenschaften als Standard festlegenPages selected Ausgewählte SeitenPage properties Seiteneigenschaften+ Create & Edit Erstellen & Bearbeiten+ Review & Compare Prüfen & Vergleichen+ Forms & Signatures Formulare & Signaturen+ Protect & Standardize Schützen & Standardisieren+ Customize & Automate Anpassen & Automatisieren+ No tools match your search. Keine Werkzeuge entsprechen Ihrer Suche.+ Expand all tools Alle Werkzeuge ausklappen+ Collapse all tools Alle Werkzeuge einklappen+ Attach a file… Datei anhängen…+ Delete attachment Anhang löschen+ Attaching files is not available on the web yet Dateien anhängen ist im Web noch nicht verfügbar+ Attach {name} {name} anhängen+ Delete attachment {key} Anhang {key} löschen+ Font Schrift+ Bulleted list Aufzählung+ Numbered list Nummerierte Liste+ Alignment Ausrichtung+ Superscript Hochgestellt+ Subscript Tiefgestellt+ Paragraph spacing Absatzabstand+ Less Weniger+ Other options Weitere Optionen+ Thumbnail size Miniaturgröße+ Smaller thumbnails Kleinere Miniaturen+ Larger thumbnails Größere Miniaturen+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Kommentar umformen++ # Prepare a form ▸ Text field table+ Add text field table Textfeldtabelle hinzufügen+ Text field table Textfeldtabelle+ Text Field Table Textfeldtabelle+ Columns Spalten+ Row spacing Zeilenabstand+ Column spacing Spaltenabstand+ First row number Erste Zeilennummer+ Column widths Spaltenbreiten+ Distribute evenly Gleichmäßig verteilen+ Field names Feldnamen+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N oder {row} ist die Zeilennummer, {col} die Spaltennummer, {seq} die Zellennummer. Ohne eines davon steht die Zeilennummer am Ende.+ Column {n} Spalte {n}+ Add fields Felder hinzufügen+ the rows are too short: make the area taller, or use fewer rows or less row spacing die Zeilen sind zu niedrig: Mach den Bereich höher oder verwende weniger Zeilen oder weniger Zeilenabstand+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing eine Spalte ist zu schmal: Mach den Bereich breiter, gib der Spalte mehr Breite oder verwende weniger Spalten oder weniger Spaltenabstand+ field names can't contain a period: {name} Feldnamen dürfen keinen Punkt enthalten: {name}+ two cells would both be named {name} zwei Zellen hätten beide den Namen {name}+ a field named {name} already exists ein Feld namens {name} ist bereits vorhanden++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Heute+ @plural {n} reply|{n} replies {n} Antwort|{n} Antworten++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Seitenwerkzeuge+ Insert pages from a file after the selection… Seiten aus einer Datei nach der Auswahl einfügen…+ Rotate the selected pages counterclockwise Ausgewählte Seiten gegen den Uhrzeigersinn drehen+ Rotate the selected pages clockwise Ausgewählte Seiten im Uhrzeigersinn drehen+ Extract the selected pages… Ausgewählte Seiten extrahieren…+ Delete the selected pages Ausgewählte Seiten löschen++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Optionen für diese Antwort+ Export value Exportwert+ Show Page Edge Shadows Schatten an Seitenrändern anzeigendiff --cc crates/ui-egui/src/i18n/el.tsvindex 562e92ac3,576cdfcd6..3c2f2e205--- a/crates/ui-egui/src/i18n/el.tsv+++ b/crates/ui-egui/src/i18n/el.tsv@@@ -2440,4 -2521,66 +2521,67 @@@ animation effects Off Ανενεργ�Make properties default Ορισμός ιδιοτήτων ως προεπιλογήPages selected Επιλεγμένες σελίδεςPage properties Ιδιότητες σελίδας+ Create & Edit Δημιουργία και επεξεργασία+ Review & Compare Αναθεώρηση και σύγκριση+ Forms & Signatures Φόρμες και υπογραφές+ Protect & Standardize Προστασία και τυποποίηση+ Customize & Automate Προσαρμογή και αυτοματοποίηση+ No tools match your search. Κανένα εργαλείο δεν ταιριάζει με την αναζήτησή σας.+ Expand all tools Ανάπτυξη όλων των εργαλείων+ Collapse all tools Σύμπτυξη όλων των εργαλείων+ Attach a file… Επισύναψη αρχείου…+ Delete attachment Διαγραφή συνημμένου+ Attaching files is not available on the web yet Η επισύναψη αρχείων δεν είναι ακόμη διαθέσιμη στον ιστό+ Attach {name} Επισύναψη {name}+ Delete attachment {key} Διαγραφή συνημμένου {key}+ Font Γραμματοσειρά+ Bulleted list Λίστα με κουκκίδες+ Numbered list Αριθμημένη λίστα+ Alignment Στοίχιση+ Superscript Εκθέτης+ Subscript Δείκτης+ Paragraph spacing Απόσταση παραγράφων+ Less Λιγότερα+ Other options Άλλες επιλογές+ Thumbnail size Μέγεθος μικρογραφιών+ Smaller thumbnails Μικρότερες μικρογραφίες+ Larger thumbnails Μεγαλύτερες μικρογραφίες+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Αλλαγή σχήματος σχολίου++ # Prepare a form ▸ Text field table+ Add text field table Προσθήκη πίνακα πεδίων κειμένου+ Text field table Πίνακας πεδίων κειμένου+ Text Field Table Πίνακας πεδίων κειμένου+ Columns Στήλες+ Row spacing Απόσταση γραμμών+ Column spacing Απόσταση στηλών+ First row number Αριθμός πρώτης γραμμής+ Column widths Πλάτη στηλών+ Distribute evenly Ομοιόμορφη κατανομή+ Field names Ονόματα πεδίων+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. Το N ή το {row} είναι ο αριθμός γραμμής, το {col} ο αριθμός στήλης και το {seq} ο αριθμός κελιού. Χωρίς κανένα από αυτά, ο αριθμός γραμμής μπαίνει στο τέλος.+ Column {n} Στήλη {n}+ Add fields Προσθήκη πεδίων+ the rows are too short: make the area taller, or use fewer rows or less row spacing οι γραμμές είναι πολύ χαμηλές: κάντε την περιοχή ψηλότερη ή χρησιμοποιήστε λιγότερες γραμμές ή μικρότερη απόσταση γραμμών+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing μια στήλη είναι πολύ στενή: κάντε την περιοχή φαρδύτερη, δώστε στη στήλη περισσότερο πλάτος ή χρησιμοποιήστε λιγότερες στήλες ή μικρότερη απόσταση στηλών+ field names can't contain a period: {name} τα ονόματα πεδίων δεν μπορούν να περιέχουν τελεία: {name}+ two cells would both be named {name} δύο κελιά θα είχαν το ίδιο όνομα {name}+ a field named {name} already exists υπάρχει ήδη πεδίο με όνομα {name}++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Σήμερα+ @plural {n} reply|{n} replies {n} απάντηση|{n} απαντήσεις++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Εργαλεία σελίδων+ Insert pages from a file after the selection… Εισαγωγή σελίδων από αρχείο μετά την επιλογή…+ Rotate the selected pages counterclockwise Περιστροφή των επιλεγμένων σελίδων αριστερόστροφα+ Rotate the selected pages clockwise Περιστροφή των επιλεγμένων σελίδων δεξιόστροφα+ Extract the selected pages… Εξαγωγή των επιλεγμένων σελίδων…+ Delete the selected pages Διαγραφή των επιλεγμένων σελίδων++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Επιλογές για αυτήν την απάντηση+ Export value Τιμή εξαγωγής+ Show Page Edge Shadows Εμφάνιση σκιών στα άκρα των σελίδωνdiff --cc crates/ui-egui/src/i18n/es.tsvindex 5293ca0c9,3216e4e44..f5f1b4b6f--- a/crates/ui-egui/src/i18n/es.tsv+++ b/crates/ui-egui/src/i18n/es.tsv@@@ -2574,4 -2679,225 +2679,226 @@@ animation effects Off Desactivado# Historical snapshot notice bar (View signed version / View revision).You are viewing the signed version of “{from}” (revision {rev}). It is a snapshot: changes here won't affect the original. Estás viendo la versión firmada de «{from}» (revisión {rev}). Es una instantánea: los cambios aquí no afectarán al original.You are viewing revision {rev} of “{from}”. It is a snapshot: changes here won't affect the original. Estás viendo la revisión {rev} de «{from}». Es una instantánea: los cambios aquí no afectarán al original.+ Attach a file… Adjuntar un archivo…+ Delete attachment Eliminar adjunto+ Attaching files is not available on the web yet Adjuntar archivos aún no está disponible en la web+ Attach {name} Adjuntar {name}+ Delete attachment {key} Eliminar adjunto {key}+ Thumbnail size Tamaño de las miniaturas+ Smaller thumbnails Miniaturas más pequeñas+ Larger thumbnails Miniaturas más grandes+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Cambiar la forma del comentario++ #+ # Keys the other catalogs carry that this one was missing, so Spanish covers the bundled key union+ # the way Lithuanian and Vietnamese do (`lithuanian_covers_bundled_catalog_keys_including_dynamic_dialog_labels`).+ # Same clean-room rule as the header: written from the plain meaning of the English label, reusing+ # the vocabulary already in this file (ID digital, marcador, Acercar / alejar, Portapapeles).+ #+ # The date picker.+ calendar date January enero+ calendar date February febrero+ calendar date March marzo+ calendar date April abril+ calendar date May mayo+ calendar date June junio+ calendar date July julio+ calendar date August agosto+ calendar date September septiembre+ calendar date October octubre+ calendar date November noviembre+ calendar date December diciembre+ calendar weekday Mo Lu+ calendar weekday Tu Ma+ calendar weekday We Mi+ calendar weekday Th Ju+ calendar weekday Fr Vi+ calendar weekday Sa Sá+ calendar weekday Su Do+ #+ # Certificate details, in their own context beside the plain labels.+ certificate Issued to Emitido a+ certificate Issued by Emitido por+ certificate Issuer Emisor+ certificate Serial number Número de serie+ certificate Version Versión+ certificate Public key Clave pública+ certificate Key usage Uso de la clave+ certificate Intended usage Uso previsto+ certificate Basic constraints Restricciones básicas+ certificate Self-signed Autofirmado+ certificate Valid from Válido desde+ certificate Valid to Válido hasta+ certificate Validity starts La validez empieza+ certificate Validity ends La validez termina+ certificate SHA-1 digest Huella SHA-1+ certificate SHA-256 digest Huella SHA-256+ #+ # What a certificate's key may be used for (X.509 key usage), as the details list them.+ Digital Signature Firma digital+ Non-Repudiation No repudio+ Key Encipherment Cifrado de claves+ Data Encipherment Cifrado de datos+ Key Agreement Acuerdo de claves+ Certificate Signing Firma de certificados+ CRL Signing Firma de CRL+ Encipher Only Solo cifrado+ Decipher Only Solo descifrado+ #+ # Signatures, revisions and digital IDs.+ {who}, certificate issued by {issuer}. {who}, certificado emitido por {issuer}.+ {who}, certificate issued by an unknown issuer. {who}, certificado emitido por un emisor desconocido.+ Rev. {rev}: Signed by {name} Rev. {rev}: Firmado por {name}+ Rev. {rev}: Signed by an unknown signer Rev. {rev}: Firmado por un firmante desconocido+ Rev. {rev}: Certified by {name} Rev. {rev}: Certificado por {name}+ Rev. {rev}: Certified by an unknown signer Rev. {rev}: Certificado por un firmante desconocido+ Unsigned signature field: {name} Campo de firma sin firmar: {name}+ Choose a digital ID. Elige un ID digital.+ There is no folder to save the digital ID in. No hay ninguna carpeta donde guardar el ID digital.+ #+ # Passwords.+ The password is incorrect. La contraseña es incorrecta.+ The password must have at least 6 characters. La contraseña debe tener al menos 6 caracteres.+ The password must have at least 8 characters. La contraseña debe tener al menos 8 caracteres.+ The passwords do not match. Las contraseñas no coinciden.+ Only the document's owner can change its security (open it with the permissions password) Solo el propietario del documento puede cambiar su seguridad (ábrelo con la contraseña de permisos)+ #+ # Counts.+ @plural {n} byte|{n} bytes {n} byte|{n} bytes+ @plural {n} pixel|{n} pixels {n} píxel|{n} píxeles+ @plural {n} file|{n} files {n} archivo|{n} archivos+ @plural {n} comment|{n} comments {n} comentario|{n} comentarios+ @plural {n} result|{n} results {n} resultado|{n} resultados+ @plural {n} image optimized|{n} images optimized {n} imagen optimizada|{n} imágenes optimizadas+ @plural {n} item discarded|{n} items discarded {n} elemento descartado|{n} elementos descartados+ @plural Delete {n} field|Delete {n} fields Eliminar {n} campo|Eliminar {n} campos+ #+ # Combining PDFs from a folder.+ Add the PDFs to combine Añade los PDF que vas a combinar+ Drop PDFs or folders here, or choose them. Suelta aquí PDF o carpetas, o elígelos.+ Every PDF in the folder Todos los PDF de la carpeta+ Every PDF in the folder and the folders inside it Todos los PDF de la carpeta y de las carpetas que contiene+ Added the first {n} PDFs in {folder} Se han añadido los primeros {n} PDF de {folder}+ No PDFs found in {folder} No se ha encontrado ningún PDF en {folder}+ #+ # Panels, rendering and notices.+ Panel layout could not be restored: {error} No se ha podido restaurar la disposición de los paneles: {error}+ Panel move was not applied: {error} No se ha aplicado el movimiento del panel: {error}+ Rendering… Renderizando…+ Still rendering — this page is unusually complex… Sigue renderizando: esta página es excepcionalmente compleja…+ Loading… Cargando…+ This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Este archivo cambió en el disco. Recárgalo para ver la versión nueva; se perderán los cambios sin guardar.+ Text recognition isn't installed: its models are missing (run `cargo xtask models`, or set PDFCRAFT_MODELS). El reconocimiento de texto no está instalado: faltan sus modelos (ejecuta `cargo xtask models` o define PDFCRAFT_MODELS).+ Cut and stack needs Two-sided: Off. Print single-sided sheets. Cortar y apilar necesita «A doble cara: Desactivado». Imprime hojas a una cara.+ Error Error+ Warning Advertencia+ Information Información+ Success Correcto+ #+ # Asking for something, and choosing it.+ Enter a name. Introduce un nombre.+ Enter a page number Introduce un número de página+ Enter a URL Introduce una URL+ Enter the field names Introduce los nombres de los campos+ Choose… Elegir…+ Choose a file… Elegir un archivo…+ Choose a folder… Elegir una carpeta…+ Create folder Crear carpeta+ Open folder Abrir carpeta+ Save file Guardar archivo+ Save changes? ¿Guardar los cambios?+ #+ # Settings and their values.+ Theme Tema+ theme Appearance Aspecto+ System Sistema+ English Inglés+ Always Siempre+ Never Nunca+ Automatically Automáticamente+ On Activado+ Enabled Activado+ Disabled Desactivado+ Mouse wheel scroll speed Velocidad de desplazamiento de la rueda del ratón+ Margins (in) Márgenes (pulg.)+ #+ # Labels and commands the catalogs name on their own.+ Color Color+ Folder Carpeta+ Comment Comentario+ Comment and review Comentar y revisar+ Creator Creador+ Producer Productor+ Organize Organizar+ Import Importar+ Move Mover+ Duplicate Duplicar+ Paste Pegar+ Select all Seleccionar todo+ Refresh Actualizar+ Next Siguiente+ Previous Anterior+ of de+ No results Sin resultados+ Search results Resultados de la búsqueda+ Copy to clipboard Copiar al portapapeles+ Copied to clipboard Copiado al portapapeles+ Help… Ayuda…+ on page {label} en la página {label}+ Page {n} Página {n}+ Page {n} of {total} Página {n} de {total}+ #+ # Tooltips that spell their shortcut out.+ Open a PDF (⌘O) Abrir un PDF (⌘O)+ Print (⌘P) Imprimir (⌘P)+ Document properties (⌘D) Propiedades del documento (⌘D)+ New bookmark (⌘B) Nuevo marcador (⌘B)+ Next (⌘G) Siguiente (⌘G)+ Previous (⇧⌘G) Anterior (⇧⌘G)+ Zoom in (⌘+) Acercar (⌘+)+ Zoom out (⌘−) Alejar (⌘−)+ Zoom in / out (also pinch or ⌘-scroll) Acercar / alejar (también con pellizco o ⌘ + desplazamiento)+ Rotate view clockwise (⇧⌘+) Girar la vista a la derecha (⇧⌘+)+ Save (M4) Guardar (M4)++ # Prepare a form ▸ Text field table+ Add text field table Añadir tabla de campos de texto+ Text field table Tabla de campos de texto+ Text Field Table Tabla de campos de texto+ Columns Columnas+ Row spacing Espacio entre filas+ Column spacing Espacio entre columnas+ First row number Número de la primera fila+ Column widths Anchos de columna+ Distribute evenly Repartir por igual+ Field names Nombres de los campos+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N o {row} es el número de fila, {col} el de columna y {seq} el de celda. Si no hay ninguno, el número de fila va al final.+ Column {n} Columna {n}+ Add fields Añadir campos+ a table has 1 to {max} rows una tabla tiene de 1 a {max} filas+ a table has 1 to {max} columns una tabla tiene de 1 a {max} columnas+ the first row number can be at most {max} el número de la primera fila puede ser como mucho {max}+ the area, the spacing and the column widths must be numbers, the spacing 0 or more and each width more than 0 el área, el espaciado y los anchos de columna deben ser números, el espaciado 0 o más y cada ancho mayor que 0+ the rows are too short: make the area taller, or use fewer rows or less row spacing las filas son demasiado bajas: haz el área más alta o usa menos filas o menos espacio entre filas+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing una columna es demasiado estrecha: haz el área más ancha, dale más anchura a la columna o usa menos columnas o menos espacio entre columnas+ field names can't contain a period: {name} los nombres de campo no pueden contener un punto: {name}+ two cells would both be named {name} dos celdas se llamarían {name}+ a field named {name} already exists ya existe un campo llamado {name}++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Hoy+ @plural {n} reply|{n} replies {n} respuesta|{n} respuestas++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Herramientas de página+ Insert pages from a file after the selection… Insertar páginas de un archivo después de la selección…+ Rotate the selected pages counterclockwise Girar las páginas seleccionadas en sentido antihorario+ Rotate the selected pages clockwise Girar las páginas seleccionadas en sentido horario+ Extract the selected pages… Extraer las páginas seleccionadas…+ Delete the selected pages Eliminar las páginas seleccionadas++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Opciones de esta respuesta+ Export value Valor de exportación+ Show Page Edge Shadows Mostrar sombras en los bordes de las páginasdiff --cc crates/ui-egui/src/i18n/fr.tsvindex 188d236c4,6092231df..f31b3741b--- a/crates/ui-egui/src/i18n/fr.tsv+++ b/crates/ui-egui/src/i18n/fr.tsv@@@ -2434,4 -2515,332 +2515,333 @@@ animation effects Off DésactivéMake properties default Définir comme propriétés par défautPages selected Pages sélectionnéesPage properties Propriétés de la page+ Create & Edit Créer et modifier+ Review & Compare Réviser et comparer+ Forms & Signatures Formulaires et signatures+ Protect & Standardize Protéger et normaliser+ Customize & Automate Personnaliser et automatiser+ No tools match your search. Aucun outil ne correspond à votre recherche.+ Expand all tools Développer tous les outils+ Collapse all tools Réduire tous les outils+ Attach a file… Joindre un fichier…+ Delete attachment Supprimer la pièce jointe+ Attaching files is not available on the web yet Joindre des fichiers n'est pas encore disponible sur le web+ Attach {name} Joindre {name}+ Delete attachment {key} Supprimer la pièce jointe {key}+ Font Police+ Bulleted list Liste à puces+ Numbered list Liste numérotée+ Alignment Alignement+ Superscript Exposant+ Subscript Indice+ Paragraph spacing Espacement des paragraphes+ Less Moins+ Other options Autres options+ Thumbnail size Taille des vignettes+ Smaller thumbnails Réduire les vignettes+ Larger thumbnails Agrandir les vignettes+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Modifier la forme du commentaire+ on page {label} à la page {label}+ A font isn't embedded Une police n'est pas incorporée+ A {} action isn't allowed Une action {} n'est pas autorisée+ A {} annotation has additional actions Une annotation {} contient des actions supplémentaires+ A {} annotation has no appearance stream Une annotation {} n'a pas de flux d'apparence+ A {} annotation isn't set to print, or is hidden Une annotation {} n'est pas réglée pour l'impression, ou est masquée+ Accessibility Report Rapport d'accessibilité+ Add the PDFs to combine Ajoutez les PDF à combiner+ Added the first {n} PDFs in {folder} Les {n} premiers PDF de {folder} ont été ajoutés+ Always Toujours+ Automatically Automatiquement+ CRL Signing Signature de LCR+ Certificate Signing Signature de certificats+ Certificate authority Autorité de certification+ Change Author Modifier l'auteur+ Change Keywords Modifier les mots-clés+ Change Subject Modifier le sujet+ Change Title Modifier le titre+ Choose a digital ID. Choisissez un ID numérique.+ Choose a file… Choisir un fichier…+ Choose a folder… Choisir un dossier…+ Choose… Choisir…+ Color Couleur+ Comment Commentaire+ Comment and review Commenter et réviser+ Copied to clipboard Copié dans le presse-papiers+ Copy to clipboard Copier dans le presse-papiers+ Create folder Créer un dossier+ Create links Créer des liens+ Creator Application+ Cut and stack needs Two-sided: Off. Print single-sided sheets. Couper et empiler exige Recto verso : Désactivé. Imprimez des feuilles en recto seul.+ Data Encipherment Chiffrement des données+ Decipher Only Déchiffrement seul+ Detailed Report Rapport détaillé+ DeviceCMYK is used, but the PDF/A output intent isn't a CMYK profile DeviceCMYK est utilisé, mais l'intention de sortie PDF/A n'est pas un profil CMJN+ DeviceRGB is used, but the PDF/A output intent isn't an RGB profile DeviceRGB est utilisé, mais l'intention de sortie PDF/A n'est pas un profil RVB+ Digital Signature Signature numérique+ Disabled Désactivé+ Document properties (⌘D) Propriétés du document (⌘D)+ Drop PDFs or folders here, or choose them. Déposez des PDF ou des dossiers ici, ou choisissez-les.+ Duplicate Dupliquer+ Enabled Activé+ Encipher Only Chiffrement seul+ End entity Entité finale+ English Anglais+ Enter a URL Saisissez une URL+ Enter a name. Saisissez un nom.+ Enter a page number Saisissez un numéro de page+ Enter the field names Saisissez les noms des champs+ Error Erreur+ Every PDF in the folder Tous les PDF du dossier+ Every PDF in the folder and the folders inside it Tous les PDF du dossier et de ses sous-dossiers+ Field "{}" on page {p} has no description (tooltip) Le champ « {} » de la page {p} n'a pas de description (info-bulle)+ Filename Nom du fichier+ Flatten Fill & Sign Aplatir Remplir et signer+ Folder Dossier+ Font (unnamed) on page {p} doesn't map its characters to Unicode La police (sans nom) de la page {p} n'associe pas ses caractères à Unicode+ Font {} on page {p} doesn't map its characters to Unicode La police {} de la page {p} n'associe pas ses caractères à Unicode+ Form field on page {p} isn't tagged Un champ de formulaire de la page {p} n'est pas balisé+ Help… Aide…+ H{n} follows an H{d}; headings should not skip levels H{n} suit H{d} ; les niveaux de titre ne doivent pas être sautés+ Import Importer+ Information Information+ Key Agreement Accord de clé+ Key Encipherment Chiffrement de clé+ Loading… Chargement…+ Margins (in) Marges (pouces)+ Move Déplacer+ Never Jamais+ New bookmark (⌘B) Nouveau signet (⌘B)+ Next Suivant+ Next (⌘G) Suivant (⌘G)+ No PDFs found in {folder} Aucun PDF trouvé dans {folder}+ No document language is set Aucune langue de document n'est définie+ No page has text: the document appears to be images of pages Aucune page ne contient de texte : le document semble être constitué d'images de pages+ No results Aucun résultat+ Non-Repudiation Non-répudiation+ On Activé+ Only the document's owner can change its security (open it with the permissions password) Seul le propriétaire du document peut modifier sa protection (ouvrez-le avec le mot de passe d'autorisations)+ Open a PDF (⌘O) Ouvrir un PDF (⌘O)+ Open folder Ouvrir le dossier+ Organize Organiser+ Page {n} Page {n}+ Page {n} of {total} Page {n} sur {total}+ Page {p} doesn't tab in structure order La page {p} ne se parcourt pas dans l'ordre de la structure+ Page {p}: {n} untagged content item Page {p} : {n} élément de contenu non balisé+ Page {p}: {n} untagged content items Page {p} : {n} éléments de contenu non balisés+ Page {} has additional actions La page {} contient des actions supplémentaires+ Panel layout could not be restored: {error} Impossible de restaurer la disposition des panneaux : {error}+ Panel move was not applied: {error} Le déplacement du panneau n'a pas été appliqué : {error}+ Paste Coller+ PdfCraft can't check this signature yet: {}. PdfCraft ne peut pas encore contrôler cette signature : {}.+ Previous Précédent+ Previous (⇧⌘G) Précédent (⇧⌘G)+ Print (⌘P) Imprimer (⌘P)+ Producer Producteur du PDF+ Refresh Actualiser+ Rendering… Rendu en cours…+ Report created Rapport créé+ Rev. {rev}: Certified by an unknown signer Rév. {rev} : certifié par un signataire inconnu+ Rev. {rev}: Certified by {name} Rév. {rev} : certifié par {name}+ Rev. {rev}: Signed by an unknown signer Rév. {rev} : signé par un signataire inconnu+ Rev. {rev}: Signed by {name} Rév. {rev} : signé par {name}+ Rotate view clockwise (⇧⌘+) Pivoter l'affichage vers la droite (⇧⌘+)+ Rule Name Nom de la règle+ Save (M4) Enregistrer (M4)+ Save as {level} Enregistrer comme {level}+ Save changes? Enregistrer les modifications ?+ Save file Enregistrer le fichier+ Search results Résultats de la recherche+ Select all Tout sélectionner+ Signature is invalid La signature n'est pas valide+ Signature is valid La signature est valide+ Signature validity is unknown La validité de la signature est inconnue+ Signing time is from the clock on the signer's computer. L'heure de signature provient de l'horloge de l'ordinateur du signataire.+ Still rendering — this page is unusually complex… Rendu toujours en cours : cette page est exceptionnellement complexe…+ Success Succès+ System Système+ Text recognition isn't installed: its models are missing (run `cargo xtask models`, or set PDFCRAFT_MODELS). La reconnaissance de texte n'est pas installée : ses modèles sont absents (exécutez `cargo xtask models`, ou définissez PDFCRAFT_MODELS).+ The ECDSA signature is not in canonical DER (trailing bytes, padding or a missing sign byte); it was read anyway. La signature ECDSA n'est pas en DER canonique (octets en trop, bourrage ou octet de signe manquant) ; elle a tout de même été lue.+ The ECDSA signature is the raw r and s values instead of a DER sequence; it was read anyway. La signature ECDSA est constituée des valeurs brutes r et s au lieu d'une séquence DER ; elle a tout de même été lue.+ The RSA signature value does not have the length of the key's modulus (leading zero bytes dropped or added); it was read anyway. La valeur de la signature RSA n'a pas la longueur du module de la clé (octets nuls de tête supprimés ou ajoutés) ; elle a tout de même été lue.+ The RSA signature's DigestInfo has no NULL parameter (older signers write it so); it was read anyway. Le DigestInfo de la signature RSA n'a pas de paramètre NULL (d'anciens outils de signature l'écrivent ainsi) ; il a tout de même été lu.+ The certificate of {} does not allow this many CA certificates below it (path length), so it is not used to vouch for {}. Le certificat de {} n'autorise pas autant de certificats d'AC en dessous de lui (longueur du chemin) : il n'est donc pas utilisé pour se porter garant de {}.+ The certificate of {} is not a CA certificate that may issue certificates, so it is not used to vouch for {}. Le certificat de {} n'est pas un certificat d'AC autorisé à émettre des certificats : il n'est donc pas utilisé pour se porter garant de {}.+ The certificate of {} was not valid at the time of signing, so it is not used to vouch for {}. Le certificat de {} n'était pas valide au moment de la signature : il n'est donc pas utilisé pour se porter garant de {}.+ The checker found problems which may prevent the document from being fully accessible. Le vérificateur a trouvé des problèmes qui peuvent empêcher le document d'être entièrement accessible.+ The document has been altered or corrupted since the signature was applied. Le document a été modifié ou corrompu depuis l'application de la signature.+ The document has been altered or corrupted since the timestamp was applied. Le document a été modifié ou corrompu depuis l'application de l'horodatage.+ The document has been altered since this signature was applied in ways it does not permit ({}). Le document a été modifié depuis l'application de cette signature d'une manière qu'elle n'autorise pas ({}).+ The document has been altered since this timestamp was applied in ways it does not permit ({}). Le document a été modifié depuis l'application de cet horodatage d'une manière qu'il n'autorise pas ({}).+ The document has been modified since this signature was applied, but the changes are permitted ({}). Le document a été modifié depuis l'application de cette signature, mais les modifications sont autorisées ({}).+ The document has been modified since this timestamp was applied, but the changes are permitted ({}). Le document a été modifié depuis l'application de cet horodatage, mais les modifications sont autorisées ({}).+ The document has no tags (structure tree) Le document n'a aucune balise (arbre de structure)+ The document has no title Le document n'a pas de titre+ The document isn't marked as tagged (MarkInfo Marked) Le document n'est pas indiqué comme balisé (MarkInfo Marked)+ The document isn't tagged, so none of its content is Le document n'est pas balisé, son contenu non plus+ The document's embedded revocation information shows that the signer's certificate has not been revoked. Les informations de révocation incorporées au document montrent que le certificat du signataire n'a pas été révoqué.+ The embedded timestamp token is valid and its authority is trusted; trusted time is {}. Le jeton d'horodatage incorporé est valide et son autorité est approuvée ; l'heure de confiance est {}.+ The font {} isn't embedded La police {} n'est pas incorporée+ The metadata doesn't identify the file as {} Les métadonnées n'identifient pas le fichier comme {}+ The password is incorrect. Le mot de passe est incorrect.+ The password must have at least 6 characters. Le mot de passe doit comporter au moins 6 caractères.+ The passwords do not match. Les mots de passe ne correspondent pas.+ The security settings don't allow screen readers to read the text Les paramètres de protection ne permettent pas aux lecteurs d'écran de lire le texte+ The signature algorithm and the SignerInfo's digest algorithm name different hashes; the signature was made with the SignerInfo's. L'algorithme de signature et l'algorithme d'empreinte du SignerInfo désignent des hachages différents ; la signature a été faite avec celui du SignerInfo.+ The signature carries an unverified timestamp ({}): the timestamp authority is not in your list of trusted certificates, so the signing time claimed by the signer is used instead. La signature comporte un horodatage non vérifié ({}) : l'autorité d'horodatage ne figure pas dans votre liste de certificats approuvés ; c'est donc l'heure de signature déclarée par le signataire qui est utilisée.+ The signature contents are not hexadecimal. Le contenu de la signature n'est pas hexadécimal.+ The signature could not be checked ({}). La signature n'a pas pu être contrôlée ({}).+ The signature could not be read ({}). La signature n'a pas pu être lue ({}).+ The signature could not be verified ({}). La signature n'a pas pu être vérifiée ({}).+ The signature has no valid byte range. La signature n'a pas de plage d'octets valide.+ The signature includes an embedded timestamp. La signature comprend un horodatage incorporé.+ The signature is BER-encoded (indefinite lengths) rather than DER; it was read leniently. La signature est codée en BER (longueurs indéfinies) plutôt qu'en DER ; elle a été lue avec tolérance.+ The signature uses the legacy adbe.x509.rsa_sha1 format. La signature utilise l'ancien format adbe.x509.rsa_sha1.+ The signature value does not match the signer's certificate: the signature is corrupt. La valeur de la signature ne correspond pas au certificat du signataire : la signature est corrompue.+ The signature's byte range does not exclude exactly its contents. La plage d'octets de la signature n'exclut pas exactement son contenu.+ The signature's byte range does not match the file. La plage d'octets de la signature ne correspond pas au fichier.+ The signature's timestamp token could not be verified ({}). Le jeton d'horodatage de la signature n'a pas pu être vérifié ({}).+ The signature's timestamp token does not cover the signature value. Le jeton d'horodatage de la signature ne couvre pas la valeur de la signature.+ The signed content is a constructed (segmented) OCTET STRING, as BER allows; it was read anyway. Le contenu signé est une OCTET STRING construite (segmentée), comme le BER l'autorise ; il a tout de même été lu.+ The signer's certificate does not allow digital signatures (its key usage has neither digital signature nor non-repudiation). Le certificat du signataire n'autorise pas les signatures numériques (son usage de la clé ne comprend ni la signature numérique ni la non-répudiation).+ The signer's certificate has been revoked ({}). Le certificat du signataire a été révoqué ({}).+ The signer's certificate has critical extensions PdfCraft does not recognize ({}). Le certificat du signataire comporte des extensions critiques que PdfCraft ne reconnaît pas ({}).+ The signer's certificate is not in the signature. Le certificat du signataire ne figure pas dans la signature.+ The signer's certificate is not issued for signing documents (its extended key usage has no document-signing purpose). Le certificat du signataire n'est pas émis pour signer des documents (son usage étendu de la clé n'inclut pas la signature de documents).+ The signer's certificate was not valid at the time of signing. Le certificat du signataire n'était pas valide au moment de la signature.+ The signer's identity is unknown because it has not been included in your list of trusted certificates and none of its parent certificates are trusted certificates. L'identité du signataire est inconnue car elle n'a pas été incluse dans votre liste de certificats approuvés et aucun de ses certificats parents n'est un certificat approuvé.+ The signer's identity is valid. L'identité du signataire est valide.+ The timestamp authority's certificate was not valid at the time of timestamping. Le certificat de l'autorité d'horodatage n'était pas valide au moment de l'horodatage.+ The timestamp contents are not hexadecimal. Le contenu de l'horodatage n'est pas hexadécimal.+ The timestamp has no valid byte range. L'horodatage n'a pas de plage d'octets valide.+ The timestamp token could not be read ({}). Le jeton d'horodatage n'a pas pu être lu ({}).+ The timestamp token is valid and its authority is trusted. Le jeton d'horodatage est valide et son autorité est approuvée.+ The timestamp token is valid, but the timestamp authority is not in your list of trusted certificates. Le jeton d'horodatage est valide, mais l'autorité d'horodatage ne figure pas dans votre liste de certificats approuvés.+ The timestamp's byte range does not exclude exactly its contents. La plage d'octets de l'horodatage n'exclut pas exactement son contenu.+ The timestamp's byte range does not match the file. La plage d'octets de l'horodatage ne correspond pas au fichier.+ The window shows the file name, not the title (Initial View > Show) La fenêtre affiche le nom du fichier et non le titre (Affichage initial > Afficher)+ Theme Thème+ There is no folder to save the digital ID in. Il n'y a aucun dossier où enregistrer l'ID numérique.+ This document has not been modified since this signature was applied. Ce document n'a pas été modifié depuis l'application de cette signature.+ This document has not been modified since this timestamp was applied. Ce document n'a pas été modifié depuis l'application de cet horodatage.+ This signature uses RIPEMD-160, a legacy 160-bit hash algorithm that is no longer recommended for signatures. It still validates, but it should not be relied on. Cette signature utilise RIPEMD-160, un ancien algorithme de hachage de 160 bits qui n'est plus recommandé pour les signatures. Elle reste valide, mais il ne faut pas s'y fier.+ This signature uses SHA-1, a weak hash algorithm: collisions in it have been demonstrated. It still validates because many documents signed years ago use it, but it should not be relied on. Cette signature utilise SHA-1, un algorithme de hachage faible : des collisions ont été démontrées. Elle reste valide car de nombreux documents signés il y a des années l'utilisent, mais il ne faut pas s'y fier.+ Unsigned signature field Champ de signature non signé+ Unsigned signature field: {name} Champ de signature non signé : {name}+ Warning Avertissement+ Zoom in (⌘+) Zoom avant (⌘+)+ Zoom in / out (also pinch or ⌘-scroll) Zoom avant / arrière (aussi pincer ou ⌘-défilement)+ Zoom out (⌘−) Zoom arrière (⌘−)+ alternate text hides an annotation inside it le texte de remplacement masque une annotation qu'il contient+ alternate text on an element with no page content texte de remplacement sur un élément sans contenu de page+ comments commentaires+ document security store magasin de sécurité du document+ document structure structure du document+ form fill remplissage de formulaire+ its alternate text is inside another element's and will never be read son texte de remplacement est contenu dans celui d'un autre élément et ne sera jamais lu+ links liens+ metadata métadonnées+ no alternate text pas de texte de remplacement+ no header cells (TH) pas de cellules d'en-tête (TH)+ no summary pas de résumé+ not in a TR pas dans un TR+ not in a Table, THead, TBody or TFoot pas dans un Table, THead, TBody ou TFoot+ not in an L (list) pas dans un L (liste)+ not in an LI (list item) pas dans un LI (élément de liste)+ of sur+ other changes autres modifications+ page content contenu de la page+ page {n} is out of range (1–{count}) la page {n} est hors de l'intervalle (1–{count})+ pages added or removed pages ajoutées ou supprimées+ rows have between {min} and {max} columns les lignes comptent entre {min} et {max} colonnes+ the first heading is an H{n}; headings should not skip levels le premier titre est un H{n} ; les niveaux de titre ne doivent pas être sautés+ the signed version could not be read la version signée n'a pas pu être lue+ {n} pages and no bookmarks {n} pages et aucun signet+ {page} is not a page number or label {page} n'est ni un numéro de page ni une étiquette de page+ {ty} element on page {p}: {what} Élément {ty} de la page {p} : {what}+ {ty} element: {what} Élément {ty} : {what}+ {who}, certificate issued by an unknown issuer. {who}, certificat émis par un émetteur inconnu.+ {who}, certificate issued by {issuer}. {who}, certificat émis par {issuer}.+ {} annotation on page {p} isn't tagged Une annotation {} de la page {p} n'est pas balisée+ {} annotations aren't allowed Les annotations {} ne sont pas autorisées+ … and {n} more … et {n} autres+ @plural Delete {n} field|Delete {n} fields Supprimer {n} champ|Supprimer {n} champs+ @plural {n} byte|{n} bytes {n} octet|{n} octets+ @plural {n} comment|{n} comments {n} commentaire|{n} commentaires+ @plural {n} file|{n} files {n} fichier|{n} fichiers+ @plural {n} image optimized|{n} images optimized {n} image optimisée|{n} images optimisées+ @plural {n} item discarded|{n} items discarded {n} élément ignoré|{n} éléments ignorés+ @plural {n} pixel|{n} pixels {n} pixel|{n} pixels+ @plural {n} result|{n} results {n} résultat|{n} résultats+ calendar date April avril+ calendar date August août+ calendar date December décembre+ calendar date February février+ calendar date January janvier+ calendar date July juillet+ calendar date June juin+ calendar date March mars+ calendar date May mai+ calendar date November novembre+ calendar date October octobre+ calendar date September septembre+ calendar weekday Fr Ve+ calendar weekday Mo Lu+ calendar weekday Sa Sa+ calendar weekday Su Di+ calendar weekday Th Je+ calendar weekday Tu Ma+ calendar weekday We Me+ certificate Basic constraints Contraintes de base+ certificate Intended usage Usage prévu+ certificate Issued by Émis par+ certificate Issued to Émis pour+ certificate Issuer Émetteur+ certificate Key usage Usage de la clé+ certificate Public key Clé publique+ certificate SHA-1 digest Empreinte SHA-1+ certificate SHA-256 digest Empreinte SHA-256+ certificate Self-signed Auto-signé+ certificate Serial number Numéro de série+ certificate Valid from Valide à partir du+ certificate Valid to Valide jusqu'au+ certificate Validity ends Fin de validité+ certificate Validity starts Début de validité+ certificate Version Version++ # Prepare a form ▸ Text field table+ Add text field table Ajouter un tableau de champs de texte+ Text field table Tableau de champs de texte+ Text Field Table Tableau de champs de texte+ Columns Colonnes+ Row spacing Espacement des lignes+ Column spacing Espacement des colonnes+ First row number Numéro de la première ligne+ Column widths Largeurs des colonnes+ Distribute evenly Répartir uniformément+ Field names Noms des champs+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N ou {row} est le numéro de ligne, {col} le numéro de colonne, {seq} le numéro de cellule. Sans aucun d'eux, le numéro de ligne est ajouté à la fin.+ Column {n} Colonne {n}+ Add fields Ajouter les champs+ the rows are too short: make the area taller, or use fewer rows or less row spacing les lignes sont trop basses : agrandissez la zone en hauteur, ou utilisez moins de lignes ou un espacement des lignes plus petit+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing une colonne est trop étroite : élargissez la zone, donnez-lui plus de largeur, ou utilisez moins de colonnes ou un espacement des colonnes plus petit+ field names can't contain a period: {name} les noms de champ ne peuvent pas contenir de point : {name}+ two cells would both be named {name} deux cellules porteraient le nom {name}+ a field named {name} already exists un champ nommé {name} existe déjà++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Aujourd'hui+ @plural {n} reply|{n} replies {n} réponse|{n} réponses++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Outils de page+ Insert pages from a file after the selection… Insérer des pages d'un fichier après la sélection…+ Rotate the selected pages counterclockwise Faire pivoter les pages sélectionnées dans le sens antihoraire+ Rotate the selected pages clockwise Faire pivoter les pages sélectionnées dans le sens horaire+ Extract the selected pages… Extraire les pages sélectionnées…+ Delete the selected pages Supprimer les pages sélectionnées++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Options de cette réponse+ Export value Valeur d’exportation+ Show Page Edge Shadows Afficher les ombres des bords des pagesdiff --cc crates/ui-egui/src/i18n/hu.tsvindex cb91e1c2c,53b81062b..e74944e33--- a/crates/ui-egui/src/i18n/hu.tsv+++ b/crates/ui-egui/src/i18n/hu.tsv@@@ -2433,4 -2514,66 +2514,67 @@@ animation effects Off KMake properties default Tulajdonságok beállítása alapértelmezettkéntPages selected Kijelölt oldalakPage properties Oldaltulajdonságok+ Create & Edit Létrehozás és szerkesztés+ Review & Compare Áttekintés és összehasonlítás+ Forms & Signatures Űrlapok és aláírások+ Protect & Standardize Védelem és szabványosítás+ Customize & Automate Testreszabás és automatizálás+ No tools match your search. Egy eszköz sem felel meg a keresésnek.+ Expand all tools Az összes eszköz kibontása+ Collapse all tools Az összes eszköz összecsukása+ Attach a file… Fájl csatolása…+ Delete attachment Melléklet törlése+ Attaching files is not available on the web yet Fájlok csatolása a weben még nem érhető el+ Attach {name} {name} csatolása+ Delete attachment {key} {key} melléklet törlése+ Font Betűtípus+ Bulleted list Felsorolás+ Numbered list Számozott lista+ Alignment Igazítás+ Superscript Felső index+ Subscript Alsó index+ Paragraph spacing Bekezdéstávolság+ Less Kevesebb+ Other options Egyéb beállítások+ Thumbnail size Bélyegképek mérete+ Smaller thumbnails Kisebb bélyegképek+ Larger thumbnails Nagyobb bélyegképek+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Megjegyzés alakjának módosítása++ # Prepare a form ▸ Text field table+ Add text field table Szövegmező-táblázat hozzáadása+ Text field table Szövegmező-táblázat+ Text Field Table Szövegmező-táblázat+ Columns Oszlopok+ Row spacing Sorköz+ Column spacing Oszlopköz+ First row number Első sor száma+ Column widths Oszlopszélességek+ Distribute evenly Egyenletes elosztás+ Field names Mezőnevek+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. Az N vagy a {row} a sor száma, a {col} az oszlopé, a {seq} a cellaé. Ha egyik sincs, a sor száma a végére kerül.+ Column {n} {n}. oszlop+ Add fields Mezők hozzáadása+ the rows are too short: make the area taller, or use fewer rows or less row spacing a sorok túl alacsonyak: növeld a terület magasságát, vagy használj kevesebb sort vagy kisebb sorközt+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing egy oszlop túl keskeny: szélesítsd a területet, adj több helyet az oszlopnak, vagy használj kevesebb oszlopot vagy kisebb oszlopközt+ field names can't contain a period: {name} a mezőnevek nem tartalmazhatnak pontot: {name}+ two cells would both be named {name} két cella neve is {name} lenne+ a field named {name} already exists már van {name} nevű mező++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Ma+ @plural {n} reply|{n} replies {n} válasz|{n} válasz++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Oldaleszközök+ Insert pages from a file after the selection… Oldalak beszúrása fájlból a kijelölés után…+ Rotate the selected pages counterclockwise A kijelölt oldalak forgatása az óramutató járásával ellentétesen+ Rotate the selected pages clockwise A kijelölt oldalak forgatása az óramutató járásával megegyezően+ Extract the selected pages… A kijelölt oldalak kibontása…+ Delete the selected pages A kijelölt oldalak törlése++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply A válasz beállításai+ Export value Exportérték+ Show Page Edge Shadows Oldalszéli árnyékok megjelenítésediff --cc crates/ui-egui/src/i18n/it.tsvindex bdcb18ba6,a3dc999d6..82973756f--- a/crates/ui-egui/src/i18n/it.tsv+++ b/crates/ui-egui/src/i18n/it.tsv@@@ -2646,4 -2727,86 +2727,87 @@@ certificate Key usage Utilizzo chiavcertificate Self-signed Autofirmatocertificate SHA-1 digest Impronta SHA-1certificate SHA-256 digest Impronta SHA-256+ Create & Edit Crea e modifica+ Review & Compare Revisione e confronto+ Forms & Signatures Moduli e firme+ Protect & Standardize Proteggi e standardizza+ Customize & Automate Personalizza e automatizza+ No tools match your search. Nessuno strumento corrisponde alla ricerca.+ Expand all tools Espandi tutti gli strumenti+ Collapse all tools Comprimi tutti gli strumenti+ Attach a file… Allega un file…+ Delete attachment Elimina allegato+ Attaching files is not available on the web yet Allegare file non è ancora disponibile sul web+ Attach {name} Allega {name}+ Delete attachment {key} Elimina allegato {key}+ Font Carattere+ Bulleted list Elenco puntato+ Numbered list Elenco numerato+ Alignment Allineamento+ Superscript Apice+ Subscript Pedice+ Paragraph spacing Spaziatura paragrafi+ Less Meno+ Other options Altre opzioni+ Thumbnail size Dimensione miniature+ Smaller thumbnails Miniature più piccole+ Larger thumbnails Miniature più grandi+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Modifica la forma del commento++ # Entries the other catalogs had and Italian lacked (2026-10-21)+ The password must have at least 8 characters. La password deve contenere almeno 8 caratteri.++ # Entries from #1523 that the catalog lacked.+ Color Colore+ Comment Commento+ Error Errore+ Next Avanti+ On Attivo+ Rotate view clockwise (⇧⌘+) Ruota la vista in senso orario (⇧⌘+)+ Save (M4) Salva (M4)+ Save changes? Salvare le modifiche?+ System Sistema+ Zoom in / out (also pinch or ⌘-scroll) Ingrandisci / riduci (anche con il pizzico o ⌘+scorrimento)+ of di++ # Prepare a form ▸ Text field table+ Add text field table Aggiungi tabella di campi di testo+ Text field table Tabella di campi di testo+ Text Field Table Tabella di campi di testo+ Columns Colonne+ Row spacing Spaziatura tra le righe+ Column spacing Spaziatura tra le colonne+ First row number Numero della prima riga+ Column widths Larghezze delle colonne+ Distribute evenly Distribuisci uniformemente+ Field names Nomi dei campi+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N o {row} è il numero di riga, {col} quello di colonna, {seq} quello di cella. Senza nessuno di essi, il numero di riga va alla fine.+ Column {n} Colonna {n}+ Add fields Aggiungi campi+ a table has 1 to {max} rows una tabella ha da 1 a {max} righe+ a table has 1 to {max} columns una tabella ha da 1 a {max} colonne+ the first row number can be at most {max} il numero della prima riga può essere al massimo {max}+ the area, the spacing and the column widths must be numbers, the spacing 0 or more and each width more than 0 l'area, la spaziatura e le larghezze delle colonne devono essere numeri, la spaziatura 0 o più e ogni larghezza maggiore di 0+ the rows are too short: make the area taller, or use fewer rows or less row spacing le righe sono troppo basse: rendi l'area più alta oppure usa meno righe o meno spaziatura tra le righe+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing una colonna è troppo stretta: rendi l'area più larga, dai più spazio alla colonna oppure usa meno colonne o meno spaziatura tra le colonne+ field names can't contain a period: {name} i nomi dei campi non possono contenere un punto: {name}+ two cells would both be named {name} due celle si chiamerebbero entrambe {name}+ a field named {name} already exists esiste già un campo chiamato {name}++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Oggi+ @plural {n} reply|{n} replies {n} risposta|{n} risposte++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Strumenti pagina+ Insert pages from a file after the selection… Inserisci pagine da un file dopo la selezione…+ Rotate the selected pages counterclockwise Ruota le pagine selezionate in senso antiorario+ Rotate the selected pages clockwise Ruota le pagine selezionate in senso orario+ Extract the selected pages… Estrai le pagine selezionate…+ Delete the selected pages Elimina le pagine selezionate++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Opzioni per questa risposta+ Export value Valore di esportazione+ Show Page Edge Shadows Mostra le ombre ai bordi delle paginediff --cc crates/ui-egui/src/i18n/ja.tsvindex b795e79de,5e64a1a8c..ef055d436--- a/crates/ui-egui/src/i18n/ja.tsv+++ b/crates/ui-egui/src/i18n/ja.tsv@@@ -2434,4 -2515,66 +2515,67 @@@ animation effects Off オ�Make properties default プロパティをデフォルトに設定Pages selected 選択したページPage properties ページのプロパティ+ Create & Edit 作成と編集+ Review & Compare レビューと比較+ Forms & Signatures フォームと署名+ Protect & Standardize 保護と標準化+ Customize & Automate カスタマイズと自動化+ No tools match your search. 検索に一致するツールはありません。+ Expand all tools すべてのツールを展開+ Collapse all tools すべてのツールを折りたたむ+ Attach a file… ファイルを添付…+ Delete attachment 添付ファイルを削除+ Attaching files is not available on the web yet Web 版ではまだファイルを添付できません+ Attach {name} {name} を添付+ Delete attachment {key} 添付ファイル {key} を削除+ Font フォント+ Bulleted list 箇条書き+ Numbered list 番号付きリスト+ Alignment 配置+ Superscript 上付き+ Subscript 下付き+ Paragraph spacing 段落間隔+ Less 折りたたむ+ Other options その他のオプション+ Thumbnail size サムネイルのサイズ+ Smaller thumbnails サムネイルを小さく+ Larger thumbnails サムネイルを大きく+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment コメントの形状を変更++ # Prepare a form ▸ Text field table+ Add text field table テキストフィールドの表を追加+ Text field table テキストフィールドの表+ Text Field Table テキストフィールドの表+ Columns 列+ Row spacing 行の間隔+ Column spacing 列の間隔+ First row number 最初の行番号+ Column widths 列の幅+ Distribute evenly 均等に配分+ Field names フィールド名+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N または {row} は行番号、{col} は列番号、{seq} はセル番号です。どれもない場合は、行番号が末尾に付きます。+ Column {n} 列 {n}+ Add fields フィールドを追加+ the rows are too short: make the area taller, or use fewer rows or less row spacing 行の高さが足りません: 範囲を高くするか、行数または行の間隔を減らしてください+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing 列の幅が足りません: 範囲を広げるか、その列の幅を増やすか、列数または列の間隔を減らしてください+ field names can't contain a period: {name} フィールド名にピリオドは使えません: {name}+ two cells would both be named {name} 2 つのセルが同じ名前 {name} になります+ a field named {name} already exists {name} という名前のフィールドは既にあります++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today 今日+ @plural {n} reply|{n} replies {n} 件の返信++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools ページツール+ Insert pages from a file after the selection… 選択範囲の後にファイルからページを挿入…+ Rotate the selected pages counterclockwise 選択したページを反時計回りに回転+ Rotate the selected pages clockwise 選択したページを時計回りに回転+ Extract the selected pages… 選択したページを抽出…+ Delete the selected pages 選択したページを削除++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply この返信のオプション+ Export value 書き出し値+ Show Page Edge Shadows ページ端の影を表示diff --cc crates/ui-egui/src/i18n/kk.tsvindex a33385ae6,5c8e59475..47061d3a2--- a/crates/ui-egui/src/i18n/kk.tsv+++ b/crates/ui-egui/src/i18n/kk.tsv@@@ -2432,4 -2513,66 +2513,67 @@@ animation effects Off Өшірул�Make properties default Қасиеттерді әдепкі етуPages selected Таңдалған беттерPage properties Бет қасиеттері+ Create & Edit Жасау және өңдеу+ Review & Compare Шолу және салыстыру+ Forms & Signatures Пішіндер және қолтаңбалар+ Protect & Standardize Қорғау және стандарттау+ Customize & Automate Баптау және автоматтандыру+ No tools match your search. Іздеуге сәйкес құралдар жоқ.+ Expand all tools Барлық құралдарды жаю+ Collapse all tools Барлық құралдарды жию+ Attach a file… Файл тіркеу…+ Delete attachment Тіркемені жою+ Attaching files is not available on the web yet Вебте файл тіркеу әзірге қолжетімсіз+ Attach {name} {name} тіркеу+ Delete attachment {key} {key} тіркемесін жою+ Font Қаріп+ Bulleted list Таңбалауыш тізім+ Numbered list Нөмірленген тізім+ Alignment Туралау+ Superscript Жоғарғы индекс+ Subscript Төменгі индекс+ Paragraph spacing Абзац аралығы+ Less Азырақ+ Other options Басқа параметрлер+ Thumbnail size Нобай өлшемі+ Smaller thumbnails Кішірек нобайлар+ Larger thumbnails Үлкенірек нобайлар+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Пікір пішінін өзгерту++ # Prepare a form ▸ Text field table+ Add text field table Мәтін өрістерінің кестесін қосу+ Text field table Мәтін өрістерінің кестесі+ Text Field Table Мәтін өрістерінің кестесі+ Columns Бағандар+ Row spacing Жолдар аралығы+ Column spacing Бағандар аралығы+ First row number Бірінші жол нөмірі+ Column widths Баған ендері+ Distribute evenly Біркелкі бөлу+ Field names Өріс атаулары+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N немесе {row} — жол нөмірі, {col} — баған нөмірі, {seq} — ұяшық нөмірі. Олардың ешқайсысы болмаса, жол нөмірі соңына қосылады.+ Column {n} {n}-баған+ Add fields Өрістерді қосу+ the rows are too short: make the area taller, or use fewer rows or less row spacing жолдар тым аласа: аймақты биіктетіңіз немесе жолдар санын не жолдар аралығын азайтыңыз+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing баған тым тар: аймақты кеңейтіңіз, бағанға көбірек ен беріңіз немесе бағандар санын не бағандар аралығын азайтыңыз+ field names can't contain a period: {name} өріс атауларында нүкте болмауы керек: {name}+ two cells would both be named {name} екі ұяшықтың да атауы {name} болар еді+ a field named {name} already exists {name} атты өріс бар++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Бүгін+ @plural {n} reply|{n} replies {n} жауап|{n} жауап++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Бет құралдары+ Insert pages from a file after the selection… Таңдаудан кейін файлдан беттер кірістіру…+ Rotate the selected pages counterclockwise Таңдалған беттерді сағат тіліне қарсы бұру+ Rotate the selected pages clockwise Таңдалған беттерді сағат тілімен бұру+ Extract the selected pages… Таңдалған беттерді шығарып алу…+ Delete the selected pages Таңдалған беттерді жою++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Осы жауаптың параметрлері+ Export value Экспорт мәні+ Show Page Edge Shadows Бет жиектерінің көлеңкелерін көрсетуdiff --cc crates/ui-egui/src/i18n/lt.tsvindex 69c9f3f9d,61fd9dc9a..9385c2790--- a/crates/ui-egui/src/i18n/lt.tsv+++ b/crates/ui-egui/src/i18n/lt.tsv@@@ -2685,4 -2781,61 +2781,62 @@@ key Space TarpaThe password must have at least 6 characters. Slaptažodį turi sudaryti bent 6 simboliai.This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Šis failas diske pasikeitė. Įkelkite jį iš naujo, kad pamatytumėte naują versiją; neįrašyti pakeitimai bus prarasti.theme Appearance Išvaizda+ Attach a file… Pridėti failą…+ Delete attachment Ištrinti priedą+ Attaching files is not available on the web yet Failų pridėjimas žiniatinklyje dar negalimas+ Attach {name} Pridėti {name}+ Delete attachment {key} Ištrinti priedą {key}+ Bulleted list Sąrašas su ženkleliais+ Numbered list Numeruotas sąrašas+ Alignment Lygiuotė+ Superscript Viršutinis indeksas+ Subscript Apatinis indeksas+ Paragraph spacing Tarpas tarp pastraipų+ Less Mažiau+ Other options Kitos parinktys+ Thumbnail size Miniatiūrų dydis+ Smaller thumbnails Mažesnės miniatiūros+ Larger thumbnails Didesnės miniatiūros+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Keisti komentaro formą++ # Prepare a form ▸ Text field table+ Add text field table Pridėti teksto laukų lentelę+ Text field table Teksto laukų lentelė+ Text Field Table Teksto laukų lentelė+ Columns Stulpeliai+ Row spacing Tarpas tarp eilučių+ Column spacing Tarpas tarp stulpelių+ First row number Pirmosios eilutės numeris+ Column widths Stulpelių pločiai+ Distribute evenly Paskirstyti tolygiai+ Field names Laukų pavadinimai+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N arba {row} – eilutės numeris, {col} – stulpelio numeris, {seq} – langelio numeris. Jei nė vieno nėra, eilutės numeris pridedamas gale.+ Column {n} Stulpelis {n}+ Add fields Pridėti laukus+ the rows are too short: make the area taller, or use fewer rows or less row spacing eilutės per žemos: padidinkite srities aukštį arba naudokite mažiau eilučių ar mažesnį tarpą tarp jų+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing stulpelis per siauras: praplatinkite sritį, skirkite stulpeliui daugiau pločio arba naudokite mažiau stulpelių ar mažesnį tarpą tarp jų+ field names can't contain a period: {name} laukų pavadinimuose negali būti taško: {name}+ two cells would both be named {name} du langeliai būtų pavadinti {name}+ a field named {name} already exists laukas pavadinimu {name} jau yra+ a table has 1 to {max} rows lentelėje gali būti nuo 1 iki {max} eilučių+ a table has 1 to {max} columns lentelėje gali būti nuo 1 iki {max} stulpelių+ the first row number can be at most {max} pirmosios eilutės numeris gali būti ne didesnis nei {max}+ the area, the spacing and the column widths must be numbers, the spacing 0 or more and each width more than 0 sritis, tarpai ir stulpelių pločiai turi būti skaičiai, tarpai – 0 arba daugiau, o kiekvienas plotis – daugiau nei 0++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Šiandien+ @plural {n} reply|{n} replies {n} atsakymas|{n} atsakymai|{n} atsakymų++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Puslapių įrankiai+ Insert pages from a file after the selection… Įterpti puslapius iš failo po pasirinkimo…+ Rotate the selected pages counterclockwise Pasukti pasirinktus puslapius prieš laikrodžio rodyklę+ Rotate the selected pages clockwise Pasukti pasirinktus puslapius pagal laikrodžio rodyklę+ Extract the selected pages… Išskleisti pasirinktus puslapius…+ Delete the selected pages Ištrinti pasirinktus puslapius++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Šio atsakymo parinktys+ Export value Eksporto reikšmė+ Show Page Edge Shadows Rodyti puslapių kraštų šešėliusdiff --cc crates/ui-egui/src/i18n/pl.tsvindex dc97e85c4,203cad58d..e333b1075--- a/crates/ui-egui/src/i18n/pl.tsv+++ b/crates/ui-egui/src/i18n/pl.tsv@@@ -2410,4 -2491,186 +2491,187 @@@ animation effects Off WyłączonMake properties default Ustaw właściwości jako domyślnePages selected Zaznaczone stronyPage properties Właściwości strony+ Create & Edit Tworzenie i edycja+ Review & Compare Recenzja i porównanie+ Forms & Signatures Formularze i podpisy+ Protect & Standardize Ochrona i standaryzacja+ Customize & Automate Dostosowanie i automatyzacja+ No tools match your search. Żadne narzędzie nie pasuje do wyszukiwania.+ Expand all tools Rozwiń wszystkie narzędzia+ Collapse all tools Zwiń wszystkie narzędzia+ Attach a file… Dołącz plik…+ Delete attachment Usuń załącznik+ Attaching files is not available on the web yet Dołączanie plików nie jest jeszcze dostępne w wersji webowej+ Attach {name} Dołącz {name}+ Delete attachment {key} Usuń załącznik {key}+ Font Czcionka+ Bulleted list Lista punktowana+ Numbered list Lista numerowana+ Alignment Wyrównanie+ Superscript Indeks górny+ Subscript Indeks dolny+ Paragraph spacing Odstęp między akapitami+ Less Mniej+ Other options Inne opcje+ Thumbnail size Rozmiar miniatur+ Smaller thumbnails Mniejsze miniatury+ Larger thumbnails Większe miniatury+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Zmień kształt komentarza++ # Signature validation: what a signature's details say and the changes after signing they name+ # (pdfcraft_engine::sign::pdf::WORDINGS and kind::ALL).+ The signature has no valid byte range. Podpis nie ma prawidłowego zakresu bajtów.+ The signature's byte range does not match the file. Zakres bajtów podpisu nie odpowiada plikowi.+ The signature's byte range does not exclude exactly its contents. Zakres bajtów podpisu nie pomija dokładnie jego zawartości.+ The signature contents are not hexadecimal. Zawartość podpisu nie jest zapisana szesnastkowo.+ The signature could not be read ({}). Nie udało się odczytać podpisu ({}).+ PdfCraft can't check this signature yet: {}. PdfCraft nie potrafi jeszcze sprawdzić tego podpisu: {}.+ The signature uses the legacy adbe.x509.rsa_sha1 format. Podpis używa przestarzałego formatu adbe.x509.rsa_sha1.+ The signature is BER-encoded (indefinite lengths) rather than DER; it was read leniently. Podpis jest zakodowany w BER (długości nieokreślone), a nie w DER; odczytano go z tolerancją.+ The signed content is a constructed (segmented) OCTET STRING, as BER allows; it was read anyway. Podpisana treść jest złożonym (segmentowanym) OCTET STRING, na co pozwala BER; mimo to ją odczytano.+ The RSA signature value does not have the length of the key's modulus (leading zero bytes dropped or added); it was read anyway. Wartość podpisu RSA nie ma długości modułu klucza (pominięte lub dodane początkowe bajty zerowe); mimo to ją odczytano.+ The RSA signature's DigestInfo has no NULL parameter (older signers write it so); it was read anyway. DigestInfo podpisu RSA nie ma parametru NULL (tak zapisują go starsze programy); mimo to go odczytano.+ The ECDSA signature is not in canonical DER (trailing bytes, padding or a missing sign byte); it was read anyway. Podpis ECDSA nie jest w kanonicznym DER (nadmiarowe bajty końcowe, dopełnienie lub brak bajtu znaku); mimo to go odczytano.+ The ECDSA signature is the raw r and s values instead of a DER sequence; it was read anyway. Podpis ECDSA zawiera surowe wartości r i s zamiast sekwencji DER; mimo to go odczytano.+ The signature algorithm and the SignerInfo's digest algorithm name different hashes; the signature was made with the SignerInfo's. Algorytm podpisu i algorytm skrótu w SignerInfo wskazują różne funkcje skrótu; podpis złożono funkcją wskazaną w SignerInfo.+ This signature uses SHA-1, a weak hash algorithm: collisions in it have been demonstrated. It still validates because many documents signed years ago use it, but it should not be relied on. Ten podpis używa SHA-1, słabej funkcji skrótu, dla której wykazano kolizje. Podpis nadal przechodzi weryfikację, bo używa jej wiele dokumentów podpisanych przed laty, ale nie należy na nim polegać.+ This signature uses RIPEMD-160, a legacy 160-bit hash algorithm that is no longer recommended for signatures. It still validates, but it should not be relied on. Ten podpis używa RIPEMD-160, przestarzałej 160-bitowej funkcji skrótu, której nie zaleca się już do podpisów. Podpis nadal przechodzi weryfikację, ale nie należy na nim polegać.+ The document has been altered or corrupted since the signature was applied. Dokument został zmieniony lub uszkodzony po złożeniu podpisu.+ The signer's certificate is not in the signature. Podpis nie zawiera certyfikatu podpisującego.+ The signature value does not match the signer's certificate: the signature is corrupt. Wartość podpisu nie pasuje do certyfikatu podpisującego: podpis jest uszkodzony.+ The signature could not be checked ({}). Nie udało się sprawdzić podpisu ({}).+ The signature could not be verified ({}). Nie udało się zweryfikować podpisu ({}).+ This document has not been modified since this signature was applied. Dokument nie był modyfikowany od złożenia tego podpisu.+ The document has been modified since this signature was applied, but the changes are permitted ({}). Dokument zmodyfikowano po złożeniu tego podpisu, ale zmiany są dozwolone ({}).+ The document has been altered since this signature was applied in ways it does not permit ({}). Dokument zmieniono po złożeniu tego podpisu w sposób, na który podpis nie pozwala ({}).+ The signer's certificate was not valid at the time of signing. Certyfikat podpisującego nie był ważny w chwili podpisania.+ The signer's certificate does not allow digital signatures (its key usage has neither digital signature nor non-repudiation). Certyfikat podpisującego nie pozwala na podpisy cyfrowe (jego użycie klucza nie obejmuje ani podpisu cyfrowego, ani niezaprzeczalności).+ The signer's certificate is not issued for signing documents (its extended key usage has no document-signing purpose). Certyfikat podpisującego nie jest wystawiony do podpisywania dokumentów (jego rozszerzone użycie klucza nie obejmuje podpisywania dokumentów).+ The signer's certificate has critical extensions PdfCraft does not recognize ({}). Certyfikat podpisującego ma rozszerzenia krytyczne, których PdfCraft nie rozpoznaje ({}).+ The certificate of {} is not a CA certificate that may issue certificates, so it is not used to vouch for {}. Certyfikat podmiotu {} nie jest certyfikatem urzędu certyfikacji, który może wystawiać certyfikaty, dlatego nie poświadcza certyfikatu {}.+ The certificate of {} has critical extensions PdfCraft does not recognize, so it is not used to vouch for {}. Certyfikat podmiotu {} ma rozszerzenia krytyczne, których PdfCraft nie rozpoznaje, dlatego nie poświadcza certyfikatu {}.+ The certificate of {} does not allow this many CA certificates below it (path length), so it is not used to vouch for {}. Certyfikat podmiotu {} nie dopuszcza tylu certyfikatów urzędów certyfikacji poniżej siebie (długość ścieżki), dlatego nie poświadcza certyfikatu {}.+ The certificate of {} was not valid at the time of signing, so it is not used to vouch for {}. Certyfikat podmiotu {} nie był ważny w chwili podpisania, dlatego nie poświadcza certyfikatu {}.+ The signer's identity is unknown because it has not been included in your list of trusted certificates and none of its parent certificates are trusted certificates. Tożsamość podpisującego jest nieznana, ponieważ jego certyfikatu nie ma na liście zaufanych certyfikatów i żaden z certyfikatów nadrzędnych nie jest zaufany.+ The signer's identity is valid. Tożsamość podpisującego jest prawidłowa.+ The signature includes an embedded timestamp. Podpis zawiera osadzony znacznik czasu.+ Signing time is from the clock on the signer's computer. Czas podpisania pochodzi z zegara komputera podpisującego.+ The signature's timestamp token does not cover the signature value. Token znacznika czasu nie obejmuje wartości podpisu.+ The signature's timestamp token could not be verified ({}). Nie udało się zweryfikować tokenu znacznika czasu podpisu ({}).+ The embedded timestamp token is valid and its authority is trusted; trusted time is {}. Osadzony token znacznika czasu jest prawidłowy, a jego urząd jest zaufany; zaufany czas to {}.+ The signature carries an unverified timestamp ({}): the timestamp authority is not in your list of trusted certificates, so the signing time claimed by the signer is used instead. Podpis zawiera niezweryfikowany znacznik czasu ({}): urzędu znacznika czasu nie ma na liście zaufanych certyfikatów, dlatego użyto czasu podpisania podanego przez podpisującego.+ The signer's certificate has been revoked ({}). Certyfikat podpisującego został unieważniony ({}).+ The document's embedded revocation information shows that the signer's certificate has not been revoked. Osadzone w dokumencie informacje o unieważnieniach potwierdzają, że certyfikat podpisującego nie został unieważniony.+ The timestamp has no valid byte range. Znacznik czasu nie ma prawidłowego zakresu bajtów.+ The timestamp's byte range does not match the file. Zakres bajtów znacznika czasu nie odpowiada plikowi.+ The timestamp's byte range does not exclude exactly its contents. Zakres bajtów znacznika czasu nie pomija dokładnie jego zawartości.+ The timestamp contents are not hexadecimal. Zawartość znacznika czasu nie jest zapisana szesnastkowo.+ The timestamp token could not be read ({}). Nie udało się odczytać tokenu znacznika czasu ({}).+ The document has been altered or corrupted since the timestamp was applied. Dokument został zmieniony lub uszkodzony po dodaniu znacznika czasu.+ The timestamp authority's certificate was not valid at the time of timestamping. Certyfikat urzędu znacznika czasu nie był ważny w chwili oznaczania czasem.+ The timestamp authority's certificate is not issued for time stamping. Certyfikat urzędu znakowania czasem nie jest wystawiony do znakowania czasem.+ This document has not been modified since this timestamp was applied. Dokument nie był modyfikowany od dodania tego znacznika czasu.+ The document has been modified since this timestamp was applied, but the changes are permitted ({}). Dokument zmodyfikowano po dodaniu tego znacznika czasu, ale zmiany są dozwolone ({}).+ The document has been altered since this timestamp was applied in ways it does not permit ({}). Dokument zmieniono po dodaniu tego znacznika czasu w sposób, na który znacznik nie pozwala ({}).+ The timestamp token is valid and its authority is trusted. Token znacznika czasu jest prawidłowy, a jego urząd jest zaufany.+ The timestamp token is valid, but the timestamp authority is not in your list of trusted certificates. Token znacznika czasu jest prawidłowy, ale urzędu znacznika czasu nie ma na liście zaufanych certyfikatów.+ Unsigned signature field Niepodpisane pole podpisu+ Signature is valid Podpis jest prawidłowy+ Signature validity is unknown Ważność podpisu jest nieznana+ Signature is invalid Podpis jest nieprawidłowy+ page content zawartość stron+ form fill wypełnianie formularzy+ comments komentarze+ document security store magazyn zabezpieczeń dokumentu+ metadata metadane+ links łącza+ document structure struktura dokumentu+ pages added or removed dodane lub usunięte strony+ other changes inne zmiany+ the signed version could not be read nie udało się odczytać podpisanej wersji++ # The rest of the interface the Polish catalog lacked.+ Auto ({percent}%) Automatycznie ({percent}%)+ Auto follows the system's text size. Pages always render at the display's full resolution. Tryb automatyczny dopasowuje się do rozmiaru tekstu w systemie. Strony są zawsze renderowane w pełnej rozdzielczości ekranu.+ Check the pages Sprawdź strony+ Collapse all Zwiń wszystko+ Discard this text (Esc) Odrzuć ten tekst (Esc)+ Done adding text Zakończ dodawanie tekstu+ Drawing scale changes. Use Actual size for full-scale plans. Skala rysunku się zmieni. Do planów w pełnej skali użyj opcji Rzeczywisty rozmiar.+ Expand all Rozwiń wszystko+ Files are combined in the order shown. Drag them to change it. Pliki są łączone w pokazanej kolejności. Przeciągnij je, aby ją zmienić.+ Fill colour Kolor wypełnienia+ Fill colour: none Kolor wypełnienia: brak+ For page sizes and margins. Dotyczy rozmiarów stron i marginesów.+ Grid view Widok siatki+ Import list… Importuj listę…+ Interface size Rozmiar interfejsu+ List view Widok listy+ Margins Marginesy+ Match page at 100% Dopasuj stronę w skali 100%+ Multiple words or phrases Wiele słów lub fraz+ New bookmarks from structure Nowe zakładki ze struktury+ No fill Bez wypełnienia+ Offset from centre Przesunięcie od środka+ One word or phrase per line Jedno słowo lub fraza w wierszu+ PDF page: {size} Strona PDF: {size}+ PDF scale: {scale}% Skala PDF: {scale}%+ Pages: {k} of {n} Strony: {k} z {n}+ Preview unavailable: {e} Podgląd niedostępny: {e}+ Printer paper and scaling may differ. Check driver settings. Papier i skalowanie w drukarce mogą się różnić. Sprawdź ustawienia sterownika.+ Remove page Usuń stronę+ Remove {n} pages Usuń strony ({n})+ Some bookmarks are not shown here: the panel lists a limited number, nested a limited depth. Niektóre zakładki nie są tu widoczne: panel pokazuje ograniczoną ich liczbę i ograniczoną głębokość zagnieżdżenia.+ Switch to List view to change the pages it takes. Przełącz na widok listy, aby zmienić strony, które obejmuje.+ The document's security settings don't allow copying text and images Ustawienia zabezpieczeń dokumentu nie pozwalają kopiować tekstu i obrazów+ {n} word(s) or phrase(s) Słowa lub frazy: {n}+ You are viewing revision {rev} of “{from}”. It is a snapshot: changes here won't affect the original. Wyświetlasz rewizję {rev} dokumentu „{from}”. To migawka: zmiany wprowadzone tutaj nie wpłyną na oryginał.+ You are viewing the signed version of “{from}” (revision {rev}). It is a snapshot: changes here won't affect the original. Wyświetlasz podpisaną wersję dokumentu „{from}” (rewizja {rev}). To migawka: zmiany wprowadzone tutaj nie wpłyną na oryginał.+ # Untranslated: English text until a translator fills these in.+ Float panel Float panel+ Move to group Move to group+ Panels Panels+ Resize panel window Resize panel window+ Resize panels Resize panels+ The signature's signed attributes have no content type, which CMS requires; it was read anyway. The signature's signed attributes have no content type, which CMS requires; it was read anyway.+ The signature's signed attributes have no message digest, so the signature does not cover the document. The signature's signed attributes have no message digest, so the signature does not cover the document.+ The signature's signed attributes name a content type other than data, so it is not a signature of the document. The signature's signed attributes name a content type other than data, so it is not a signature of the document.+ This signature uses an RSA key shorter than 2048 bits, which is no longer considered strong enough for signatures. It still validates, but it should not be relied on. This signature uses an RSA key shorter than 2048 bits, which is no longer considered strong enough for signatures. It still validates, but it should not be relied on.++ # Prepare a form ▸ Text field table+ Add text field table Dodaj tabelę pól tekstowych+ Text field table Tabela pól tekstowych+ Text Field Table Tabela pól tekstowych+ Columns Kolumny+ Row spacing Odstęp między wierszami+ Column spacing Odstęp między kolumnami+ First row number Numer pierwszego wiersza+ Column widths Szerokości kolumn+ Distribute evenly Rozłóż równomiernie+ Field names Nazwy pól+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N lub {row} to numer wiersza, {col} numer kolumny, a {seq} numer komórki. Bez żadnego z nich numer wiersza trafia na koniec.+ Column {n} Kolumna {n}+ Add fields Dodaj pola+ the rows are too short: make the area taller, or use fewer rows or less row spacing wiersze są za niskie: powiększ obszar w pionie albo użyj mniej wierszy lub mniejszego odstępu między wierszami+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing kolumna jest za wąska: poszerz obszar, daj kolumnie więcej miejsca albo użyj mniej kolumn lub mniejszego odstępu między kolumnami+ field names can't contain a period: {name} nazwy pól nie mogą zawierać kropki: {name}+ two cells would both be named {name} dwie komórki miałyby nazwę {name}+ a field named {name} already exists pole o nazwie {name} już istnieje++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Dzisiaj+ @plural {n} reply|{n} replies {n} odpowiedź|{n} odpowiedzi|{n} odpowiedzi++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Narzędzia stron+ Insert pages from a file after the selection… Wstaw strony z pliku po zaznaczeniu…+ Rotate the selected pages counterclockwise Obróć zaznaczone strony w lewo+ Rotate the selected pages clockwise Obróć zaznaczone strony w prawo+ Extract the selected pages… Wyodrębnij zaznaczone strony…+ Delete the selected pages Usuń zaznaczone strony++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Opcje tej odpowiedzi+ Export value Wartość eksportowa+ Show Page Edge Shadows Pokaż cienie krawędzi strondiff --cc crates/ui-egui/src/i18n/pt-br.tsvindex 5466579f7,45f827171..cd6d8f3e2--- a/crates/ui-egui/src/i18n/pt-br.tsv+++ b/crates/ui-egui/src/i18n/pt-br.tsv@@@ -2448,4 -2529,337 +2529,338 @@@ animation effects Off DesativadoMake properties default Tornar propriedades padrãoPages selected Páginas selecionadasPage properties Propriedades da página+ Create & Edit Criar e editar+ Review & Compare Revisar e comparar+ Forms & Signatures Formulários e assinaturas+ Protect & Standardize Proteger e padronizar+ Customize & Automate Personalizar e automatizar+ No tools match your search. Nenhuma ferramenta corresponde à pesquisa.+ Expand all tools Expandir todas as ferramentas+ Collapse all tools Recolher todas as ferramentas+ Attach a file… Anexar um arquivo…+ Delete attachment Excluir anexo+ Attaching files is not available on the web yet Anexar arquivos ainda não está disponível na web+ Attach {name} Anexar {name}+ Delete attachment {key} Excluir anexo {key}++ # Remaining keys from the current catalog union, translated from their English meaning (2026-10-21).+ on page {label} na página {label}+ A font isn't embedded Uma fonte não está incorporada+ A {} action isn't allowed A ação {} não é permitida+ A {} annotation has additional actions A anotação {} tem ações adicionais+ A {} annotation has no appearance stream A anotação {} não tem fluxo de aparência+ A {} annotation isn't set to print, or is hidden A anotação {} não está configurada para impressão ou está oculta+ Accessibility Report Relatório de acessibilidade+ Add the PDFs to combine Adicione os PDFs que deseja combinar+ Added the first {n} PDFs in {folder} Os primeiros {n} PDFs de {folder} foram adicionados+ Always Sempre+ Automatically Automaticamente+ CRL Signing Assinatura de CRL+ Certificate Signing Assinatura de certificado+ Change Author Alterar autor+ Change Keywords Alterar palavras-chave+ Change Subject Alterar assunto+ Change Title Alterar título+ Choose a digital ID. Escolha uma identidade digital.+ Choose a file… Escolher um arquivo…+ Choose a folder… Escolher uma pasta…+ Choose… Escolher…+ Color Cor+ Comment Comentário+ Comment and review Comentar e revisar+ Copied to clipboard Copiado para a área de transferência+ Copy to clipboard Copiar para a área de transferência+ Create folder Criar pasta+ Create links Criar links+ Creator Criador+ Cut and stack needs Two-sided: Off. Print single-sided sheets. Recortar e empilhar requer Frente e verso: desativado. Imprima em folhas de um só lado.+ Data Encipherment Criptografia de dados+ Decipher Only Somente descriptografia+ Detailed Report Relatório detalhado+ DeviceCMYK is used, but the PDF/A output intent isn't a CMYK profile O DeviceCMYK está em uso, mas o perfil de saída do PDF/A não é um perfil CMYK+ DeviceRGB is used, but the PDF/A output intent isn't an RGB profile O DeviceRGB está em uso, mas o perfil de saída do PDF/A não é um perfil RGB+ Digital Signature Assinatura digital+ Disabled Desativado+ Document properties (⌘D) Propriedades do documento (⌘D)+ Drop PDFs or folders here, or choose them. Solte PDFs ou pastas aqui, ou selecione-os.+ Duplicate Duplicar+ Enabled Ativado+ Encipher Only Somente criptografia+ English Inglês+ Enter a URL Informe uma URL+ Enter a name. Informe um nome.+ Enter a page number Informe o número da página+ Enter the field names Informe os nomes dos campos+ Error Erro+ Every PDF in the folder Todos os PDFs da pasta+ Every PDF in the folder and the folders inside it Todos os PDFs da pasta e de suas subpastas+ Field "{}" on page {p} has no description (tooltip) O campo "{}" na página {p} não tem descrição (dica de ferramenta)+ Filename Nome do arquivo+ Flatten Fill & Sign Achatar Preencher e assinar+ Folder Pasta+ Font Fonte+ Bulleted list Lista com marcadores+ Numbered list Lista numerada+ Alignment Alinhamento+ Superscript Sobrescrito+ Subscript Subscrito+ Paragraph spacing Espaçamento entre parágrafos+ Less Menos+ Other options Outras opções+ Thumbnail size Tamanho das miniaturas+ Smaller thumbnails Miniaturas menores+ Larger thumbnails Miniaturas maiores+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Alterar a forma do comentário+ Font (unnamed) on page {p} doesn't map its characters to Unicode A fonte (sem nome) na página {p} não mapeia seus caracteres para Unicode+ Font {} on page {p} doesn't map its characters to Unicode A fonte {} na página {p} não mapeia seus caracteres para Unicode+ Form field on page {p} isn't tagged O campo de formulário na página {p} não está marcado com tag+ Help… Ajuda…+ H{n} follows an H{d}; headings should not skip levels H{n} vem depois de H{d}; os títulos não devem pular níveis+ Import Importar+ Information Informações+ Key Agreement Acordo de chaves+ Key Encipherment Cifragem de chaves+ Loading… Carregando…+ Mouse wheel scroll speed Velocidade de rolagem da roda do mouse+ Move Mover+ Never Nunca+ New bookmark (⌘B) Novo marcador (⌘B)+ Next Próximo+ Next (⌘G) Próximo (⌘G)+ No PDFs found in {folder} Nenhum PDF encontrado em {folder}+ No document language is set Nenhum idioma foi definido para o documento+ No page has text: the document appears to be images of pages Nenhuma página contém texto: o documento parece ser composto por imagens de páginas+ No results Nenhum resultado+ Non-Repudiation Não repúdio+ On Ativado+ Only the document's owner can change its security (open it with the permissions password) Somente o proprietário do documento pode alterar sua segurança (abra-o com a senha de permissões)+ Open a PDF (⌘O) Abrir um PDF (⌘O)+ Open folder Abrir pasta+ Organize Organizar+ Page {n} Página {n}+ Page {n} of {total} Página {n} de {total}+ Page {p} doesn't tab in structure order A ordem de tabulação da página {p} não segue a ordem da estrutura+ Page {p}: {n} untagged content item Página {p}: {n} item de conteúdo sem tag+ Page {p}: {n} untagged content items Página {p}: {n} itens de conteúdo sem tag+ Page {} has additional actions A página {} tem ações adicionais+ Panel layout could not be restored: {error} Não foi possível restaurar o layout dos painéis: {error}+ Panel move was not applied: {error} A movimentação do painel não foi aplicada: {error}+ Paste Colar+ PdfCraft can't check this signature yet: {}. O PdfCraft ainda não pode verificar esta assinatura: {}.+ Previous Anterior+ Previous (⇧⌘G) Anterior (⇧⌘G)+ Print (⌘P) Imprimir (⌘P)+ Producer Produtor+ Refresh Atualizar+ Rendering… Renderizando…+ Report created Relatório criado+ Rev. {rev}: Certified by an unknown signer Rev. {rev}: certificada por um signatário desconhecido+ Rev. {rev}: Certified by {name} Rev. {rev}: certificada por {name}+ Rev. {rev}: Signed by an unknown signer Rev. {rev}: assinada por um signatário desconhecido+ Rev. {rev}: Signed by {name} Rev. {rev}: assinada por {name}+ Rotate view clockwise (⇧⌘+) Girar a visualização no sentido horário (⇧⌘+)+ Rule Name Nome da regra+ Save (M4) Salvar (M4)+ Save as {level} Salvar como {level}+ Save changes? Salvar as alterações?+ Save file Salvar arquivo+ Search results Resultados da pesquisa+ Select all Selecionar tudo+ Signature is invalid A assinatura é inválida+ Signature is valid A assinatura é válida+ Signature validity is unknown A validade da assinatura é desconhecida+ Signing time is from the clock on the signer's computer. O horário da assinatura vem do relógio do computador do signatário.+ Still rendering — this page is unusually complex… Ainda renderizando — esta página é excepcionalmente complexa…+ Success Sucesso+ System Sistema+ Text recognition isn't installed: its models are missing (run `cargo xtask models`, or set PDFCRAFT_MODELS). O reconhecimento de texto não está instalado: faltam os modelos (execute `cargo xtask models` ou defina PDFCRAFT_MODELS).+ The ECDSA signature is not in canonical DER (trailing bytes, padding or a missing sign byte); it was read anyway. A assinatura ECDSA não está no formato DER canônico (há bytes excedentes, preenchimento ou falta o byte de sinal); mesmo assim, ela foi lida.+ The ECDSA signature is the raw r and s values instead of a DER sequence; it was read anyway. A assinatura ECDSA contém os valores brutos de r e s em vez de uma sequência DER; mesmo assim, ela foi lida.+ The RSA signature value does not have the length of the key's modulus (leading zero bytes dropped or added); it was read anyway. O valor da assinatura RSA não tem o mesmo comprimento do módulo da chave (bytes zero iniciais foram removidos ou adicionados); mesmo assim, ele foi lido.+ The RSA signature's DigestInfo has no NULL parameter (older signers write it so); it was read anyway. O DigestInfo da assinatura RSA não tem o parâmetro NULL (assinantes mais antigos o incluem); mesmo assim, ele foi lido.+ The certificate of {} does not allow this many CA certificates below it (path length), so it is not used to vouch for {}. O certificado de {} não permite essa quantidade de certificados de AC abaixo dele (comprimento do caminho), então não é usado para atestar a validade de {}.+ The certificate of {} is not a CA certificate that may issue certificates, so it is not used to vouch for {}. O certificado de {} não é um certificado de AC autorizado a emitir certificados, então não é usado para atestar a validade de {}.+ The certificate of {} has critical extensions PdfCraft does not recognize, so it is not used to vouch for {}. The certificate of {} has critical extensions PdfCraft does not recognize, so it is not used to vouch for {}.+ The certificate of {} was not valid at the time of signing, so it is not used to vouch for {}. O certificado de {} não era válido no momento da assinatura, então não é usado para atestar a validade de {}.+ The checker found problems which may prevent the document from being fully accessible. A verificação encontrou problemas que podem impedir que o documento seja totalmente acessível.+ The document has been altered or corrupted since the signature was applied. O documento foi alterado ou corrompido desde que a assinatura foi aplicada.+ The document has been altered or corrupted since the timestamp was applied. O documento foi alterado ou corrompido desde que o carimbo de data e hora foi aplicado.+ The document has been altered since this signature was applied in ways it does not permit ({}). O documento foi alterado de maneiras não permitidas ({}), depois que esta assinatura foi aplicada.+ The document has been altered since this timestamp was applied in ways it does not permit ({}). O documento foi alterado de maneiras não permitidas ({}), depois que este carimbo de data e hora foi aplicado.+ The document has been modified since this signature was applied, but the changes are permitted ({}). O documento foi modificado depois que esta assinatura foi aplicada, mas as alterações são permitidas ({}).+ The document has been modified since this timestamp was applied, but the changes are permitted ({}). O documento foi modificado depois que este carimbo de data e hora foi aplicado, mas as alterações são permitidas ({}).+ The document has no tags (structure tree) O documento não tem tags (árvore de estrutura)+ The document has no title O documento não tem título+ The document isn't marked as tagged (MarkInfo Marked) O documento não está marcado como etiquetado (MarkInfo Marked)+ The document isn't tagged, so none of its content is O documento não está etiquetado, portanto nenhum conteúdo está+ The document's embedded revocation information shows that the signer's certificate has not been revoked. As informações de revogação incorporadas ao documento indicam que o certificado do signatário não foi revogado.+ The embedded timestamp token is valid and its authority is trusted; trusted time is {}. O token de carimbo de data e hora incorporado é válido e sua autoridade é confiável; o horário confiável é {}.+ The font {} isn't embedded A fonte {} não está incorporada+ The metadata doesn't identify the file as {} Os metadados não identificam o arquivo como {}+ The password is incorrect. A senha está incorreta.+ The password must have at least 6 characters. A senha deve ter pelo menos 6 caracteres.+ The password must have at least 8 characters. A senha deve ter pelo menos 8 caracteres.+ The passwords do not match. As senhas não correspondem.+ The security settings don't allow screen readers to read the text As configurações de segurança não permitem que leitores de tela leiam o texto+ The signature algorithm and the SignerInfo's digest algorithm name different hashes; the signature was made with the SignerInfo's. O algoritmo de assinatura e o algoritmo de resumo do SignerInfo indicam hashes diferentes; a assinatura foi feita com o hash indicado pelo SignerInfo.+ The signature carries an unverified timestamp ({}): the timestamp authority is not in your list of trusted certificates, so the signing time claimed by the signer is used instead. A assinatura contém um carimbo de data e hora não verificado ({}): a autoridade de carimbo de data e hora não está na sua lista de certificados confiáveis, então será usado o horário de assinatura informado pelo signatário.+ The signature contents are not hexadecimal. O conteúdo da assinatura não está em hexadecimal.+ The signature could not be checked ({}). Não foi possível verificar a assinatura ({}).+ The signature could not be read ({}). Não foi possível ler a assinatura ({}).+ The signature could not be verified ({}). Não foi possível validar a assinatura ({}).+ The signature has no valid byte range. A assinatura não tem um intervalo de bytes válido.+ The signature includes an embedded timestamp. A assinatura inclui um carimbo de data e hora incorporado.+ The signature is BER-encoded (indefinite lengths) rather than DER; it was read leniently. A assinatura está codificada em BER (comprimentos indefinidos), e não em DER; ela foi lida de forma permissiva.+ The signature uses the legacy adbe.x509.rsa_sha1 format. A assinatura usa o formato legado adbe.x509.rsa_sha1.+ The signature value does not match the signer's certificate: the signature is corrupt. O valor da assinatura não corresponde ao certificado do signatário: a assinatura está corrompida.+ The signature's byte range does not exclude exactly its contents. O intervalo de bytes da assinatura não exclui exatamente o conteúdo dela.+ The signature's byte range does not match the file. O intervalo de bytes da assinatura não corresponde ao arquivo.+ The signature's timestamp token could not be verified ({}). Não foi possível validar o token de carimbo de data e hora da assinatura ({}).+ The signature's timestamp token does not cover the signature value. O token de carimbo de data e hora da assinatura não abrange o valor da assinatura.+ The signed content is a constructed (segmented) OCTET STRING, as BER allows; it was read anyway. O conteúdo assinado é uma OCTET STRING construída (segmentada), como permite o BER; mesmo assim, foi lido.+ The signer's certificate does not allow digital signatures (its key usage has neither digital signature nor non-repudiation). O certificado do signatário não permite assinaturas digitais (o uso da chave não inclui assinatura digital nem não repúdio).+ The signer's certificate has been revoked ({}). O certificado do signatário foi revogado ({}).+ The signer's certificate has critical extensions PdfCraft does not recognize ({}). O certificado do signatário tem extensões críticas que o PdfCraft não reconhece ({}).+ The signer's certificate is not in the signature. O certificado do signatário não está incluído na assinatura.+ The signer's certificate is not issued for signing documents (its extended key usage has no document-signing purpose). O certificado do signatário não foi emitido para assinar documentos (o uso estendido da chave não inclui essa finalidade).+ The signer's certificate was not valid at the time of signing. O certificado do signatário não era válido no momento da assinatura.+ The signer's identity is unknown because it has not been included in your list of trusted certificates and none of its parent certificates are trusted certificates. A identidade do signatário é desconhecida porque não foi incluída na sua lista de certificados confiáveis e nenhum dos certificados na cadeia acima dela é confiável.+ The signer's identity is valid. A identidade do signatário é válida.+ The timestamp authority's certificate was not valid at the time of timestamping. O certificado da autoridade de carimbo de data e hora não era válido no momento da emissão do carimbo.+ The timestamp authority's certificate is not issued for time stamping. The timestamp authority's certificate is not issued for time stamping.+ The timestamp contents are not hexadecimal. O conteúdo do carimbo de data e hora não está em hexadecimal.+ The timestamp has no valid byte range. O carimbo de data e hora não tem um intervalo de bytes válido.+ The timestamp token could not be read ({}). Não foi possível ler o token de carimbo de data e hora ({}).+ The timestamp token is valid and its authority is trusted. O token de carimbo de data e hora é válido e sua autoridade é confiável.+ The timestamp token is valid, but the timestamp authority is not in your list of trusted certificates. O token de carimbo de data e hora é válido, mas a autoridade não está na sua lista de certificados confiáveis.+ The timestamp's byte range does not exclude exactly its contents. O intervalo de bytes do carimbo de data e hora não exclui exatamente o conteúdo dele.+ The timestamp's byte range does not match the file. O intervalo de bytes do carimbo de data e hora não corresponde ao arquivo.+ The window shows the file name, not the title (Initial View > Show) A janela exibe o nome do arquivo, e não o título (Exibição inicial > Mostrar)+ Theme Tema+ There is no folder to save the digital ID in. Não há uma pasta para salvar a identidade digital.+ This document has not been modified since this signature was applied. Este documento não foi modificado desde que esta assinatura foi aplicada.+ This document has not been modified since this timestamp was applied. Este documento não foi modificado desde que este carimbo de data e hora foi aplicado.+ This file changed on disk. Reload it to see the new version; your unsaved changes will be lost. Este arquivo foi alterado no disco. Recarregue-o para ver a nova versão; suas alterações não salvas serão perdidas.+ This signature uses RIPEMD-160, a legacy 160-bit hash algorithm that is no longer recommended for signatures. It still validates, but it should not be relied on. Esta assinatura usa RIPEMD-160, um algoritmo de hash legado de 160 bits que não é mais recomendado para assinaturas. Ela ainda é validada, mas não deve ser considerada confiável.+ This signature uses SHA-1, a weak hash algorithm: collisions in it have been demonstrated. It still validates because many documents signed years ago use it, but it should not be relied on. Esta assinatura usa SHA-1, um algoritmo de hash fraco para o qual já foram demonstradas colisões. Ela ainda é validada porque muitos documentos assinados há anos o utilizam, mas não deve ser considerada confiável.+ Unsigned signature field Campo de assinatura não assinado+ Unsigned signature field: {name} Campo de assinatura não assinado: {name}+ Warning Aviso+ Zoom in (⌘+) Ampliar (⌘+)+ Zoom in / out (also pinch or ⌘-scroll) Ampliar / reduzir (também com pinça ou rolagem com ⌘)+ Zoom out (⌘−) Reduzir (⌘−)+ alternate text hides an annotation inside it o texto alternativo oculta uma anotação em seu interior+ alternate text on an element with no page content texto alternativo em um elemento sem conteúdo na página+ comments comentários+ document security store repositório de segurança do documento+ document structure estrutura do documento+ form fill preenchimento de formulário+ its alternate text is inside another element's and will never be read seu texto alternativo está dentro do texto de outro elemento e nunca será lido+ links links+ metadata metadados+ no alternate text sem texto alternativo+ no header cells (TH) sem células de cabeçalho (TH)+ no summary sem resumo+ not in a TR fora de uma TR+ not in a Table, THead, TBody or TFoot fora de uma Table, THead, TBody ou TFoot+ not in an L (list) fora de uma L (lista)+ not in an LI (list item) fora de um LI (item de lista)+ of de+ other changes outras alterações+ page content conteúdo da página+ page {n} is out of range (1–{count}) a página {n} está fora do intervalo (1–{count})+ pages added or removed páginas adicionadas ou removidas+ rows have between {min} and {max} columns as linhas têm entre {min} e {max} colunas+ the first heading is an H{n}; headings should not skip levels o primeiro título é H{n}; os títulos não devem pular níveis+ the signed version could not be read não foi possível ler a versão assinada+ {n} pages and no bookmarks {n} páginas e nenhum marcador+ {page} is not a page number or label {page} não é um número nem um rótulo de página+ {ty} element on page {p}: {what} elemento {ty} na página {p}: {what}+ {ty} element: {what} elemento {ty}: {what}+ {who}, certificate issued by an unknown issuer. {who}, certificado emitido por uma autoridade desconhecida.+ {who}, certificate issued by {issuer}. {who}, certificado emitido por {issuer}.+ {} annotation on page {p} isn't tagged A anotação {} na página {p} não está marcada com tag+ {} annotations aren't allowed As anotações {} não são permitidas+ … and {n} more … e mais {n}+ @plural Delete {n} field|Delete {n} fields Excluir {n} campo|Excluir {n} campos+ @plural {n} byte|{n} bytes {n} byte|{n} bytes+ @plural {n} comment|{n} comments {n} comentário|{n} comentários+ @plural {n} file|{n} files {n} arquivo|{n} arquivos+ @plural {n} image optimized|{n} images optimized {n} imagem otimizada|{n} imagens otimizadas+ @plural {n} item discarded|{n} items discarded {n} item descartado|{n} itens descartados+ @plural {n} pixel|{n} pixels {n} pixel|{n} pixels+ @plural {n} result|{n} results {n} resultado|{n} resultados+ calendar weekday Fr Sex+ calendar weekday Mo Seg+ calendar weekday Sa Sáb+ calendar weekday Su Dom+ calendar weekday Th Qui+ calendar weekday Tu Ter+ calendar weekday We Qua+ certificate Basic constraints Restrições básicas+ certificate Intended usage Uso pretendido+ certificate Issued by Emitido por+ certificate Issued to Emitido para+ certificate Issuer Emissor+ certificate Key usage Uso da chave+ certificate Public key Chave pública+ certificate SHA-1 digest Resumo SHA-1+ certificate SHA-256 digest Resumo SHA-256+ certificate Self-signed Autoassinado+ certificate Serial number Número de série+ certificate Valid from Válido desde+ certificate Valid to Válido até+ certificate Validity ends Fim da validade+ certificate Validity starts Início da validade+ certificate Version Versão+ theme Appearance Aparência+ # Untranslated: English text until a translator fills these in.+ The signature's signed attributes have no content type, which CMS requires; it was read anyway. The signature's signed attributes have no content type, which CMS requires; it was read anyway.+ This signature uses an RSA key shorter than 2048 bits, which is no longer considered strong enough for signatures. It still validates, but it should not be relied on. This signature uses an RSA key shorter than 2048 bits, which is no longer considered strong enough for signatures. It still validates, but it should not be relied on.+ The signature's signed attributes have no message digest, so the signature does not cover the document. The signature's signed attributes have no message digest, so the signature does not cover the document.+ The signature's signed attributes name a content type other than data, so it is not a signature of the document. The signature's signed attributes name a content type other than data, so it is not a signature of the document.+ Remove {standard} identification Remove {standard} identification++ # Prepare a form ▸ Text field table+ Add text field table Adicionar tabela de campos de texto+ Text field table Tabela de campos de texto+ Text Field Table Tabela de campos de texto+ Columns Colunas+ Row spacing Espaçamento entre linhas+ Column spacing Espaçamento entre colunas+ First row number Número da primeira linha+ Column widths Larguras das colunas+ Distribute evenly Distribuir igualmente+ Field names Nomes dos campos+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N ou {row} é o número da linha, {col} o da coluna e {seq} o da célula. Sem nenhum deles, o número da linha vai no final.+ Column {n} Coluna {n}+ Add fields Adicionar campos+ the rows are too short: make the area taller, or use fewer rows or less row spacing as linhas estão baixas demais: deixe a área mais alta ou use menos linhas ou menos espaçamento entre linhas+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing uma coluna está estreita demais: deixe a área mais larga, dê mais largura à coluna ou use menos colunas ou menos espaçamento entre colunas+ field names can't contain a period: {name} nomes de campo não podem conter ponto: {name}+ two cells would both be named {name} duas células teriam o nome {name}+ a field named {name} already exists já existe um campo chamado {name}++ # Prepare a form ▸ Text field table: limits (AI-assisted, not separately native-reviewed)+ a table has 1 to {max} rows uma tabela tem de 1 a {max} linhas+ a table has 1 to {max} columns uma tabela tem de 1 a {max} colunas+ the first row number can be at most {max} o número da primeira linha pode ser no máximo {max}+ the area, the spacing and the column widths must be numbers, the spacing 0 or more and each width more than 0 a área, o espaçamento e as larguras das colunas devem ser números, o espaçamento 0 ou mais e cada largura maior que 0++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Hoje+ @plural {n} reply|{n} replies {n} resposta|{n} respostas++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Ferramentas de página+ Insert pages from a file after the selection… Inserir páginas de um arquivo após a seleção…+ Rotate the selected pages counterclockwise Girar as páginas selecionadas no sentido anti-horário+ Rotate the selected pages clockwise Girar as páginas selecionadas no sentido horário+ Extract the selected pages… Extrair as páginas selecionadas…+ Delete the selected pages Excluir as páginas selecionadas++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Opções desta resposta+ Export value Valor de exportação+ Show Page Edge Shadows Mostrar sombras nas bordas das páginasdiff --cc crates/ui-egui/src/i18n/ru.tsvindex 1a6cda79b,59c483526..047c01228--- a/crates/ui-egui/src/i18n/ru.tsv+++ b/crates/ui-egui/src/i18n/ru.tsv@@@ -2347,4 -2428,66 +2428,67 @@@ animation effects Off Вык�Make properties default Сделать свойства стандартнымиPages selected Выделенные страницыPage properties Свойства страницы+ Create & Edit Создание и редактирование+ Review & Compare Рецензирование и сравнение+ Forms & Signatures Формы и подписи+ Protect & Standardize Защита и стандартизация+ Customize & Automate Настройка и автоматизация+ No tools match your search. Нет инструментов, соответствующих запросу.+ Expand all tools Развернуть все инструменты+ Collapse all tools Свернуть все инструменты+ Attach a file… Прикрепить файл…+ Delete attachment Удалить вложение+ Attaching files is not available on the web yet Прикрепление файлов в веб-версии пока недоступно+ Attach {name} Прикрепить {name}+ Delete attachment {key} Удалить вложение {key}+ Font Шрифт+ Bulleted list Маркированный список+ Numbered list Нумерованный список+ Alignment Выравнивание+ Superscript Надстрочный+ Subscript Подстрочный+ Paragraph spacing Интервал между абзацами+ Less Меньше+ Other options Другие параметры+ Thumbnail size Размер миниатюр+ Smaller thumbnails Уменьшить миниатюры+ Larger thumbnails Увеличить миниатюры+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Изменить форму комментария++ # Prepare a form ▸ Text field table+ Add text field table Добавить таблицу текстовых полей+ Text field table Таблица текстовых полей+ Text Field Table Таблица текстовых полей+ Columns Столбцы+ Row spacing Интервал между строками+ Column spacing Интервал между столбцами+ First row number Номер первой строки+ Column widths Ширина столбцов+ Distribute evenly Распределить равномерно+ Field names Имена полей+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N или {row} — номер строки, {col} — номер столбца, {seq} — номер ячейки. Если их нет, номер строки добавляется в конец.+ Column {n} Столбец {n}+ Add fields Добавить поля+ the rows are too short: make the area taller, or use fewer rows or less row spacing строки слишком низкие: увеличьте высоту области, уменьшите число строк или интервал между ними+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing столбец слишком узкий: расширьте область, отдайте столбцу больше ширины, уменьшите число столбцов или интервал между ними+ field names can't contain a period: {name} имена полей не могут содержать точку: {name}+ two cells would both be named {name} две ячейки получили бы одно имя {name}+ a field named {name} already exists поле с именем {name} уже существует++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Сегодня+ @plural {n} reply|{n} replies {n} ответ|{n} ответа|{n} ответов++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Инструменты страниц+ Insert pages from a file after the selection… Вставить страницы из файла после выделения…+ Rotate the selected pages counterclockwise Повернуть выбранные страницы против часовой стрелки+ Rotate the selected pages clockwise Повернуть выбранные страницы по часовой стрелке+ Extract the selected pages… Извлечь выбранные страницы…+ Delete the selected pages Удалить выбранные страницы++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Параметры этого ответа+ Export value Значение экспорта+ Show Page Edge Shadows Показывать тени по краям страницdiff --cc crates/ui-egui/src/i18n/sl.tsvindex 6b572badc,83cb59415..63c3a3f77--- a/crates/ui-egui/src/i18n/sl.tsv+++ b/crates/ui-egui/src/i18n/sl.tsv@@@ -2439,4 -2520,66 +2520,67 @@@ animation effects Off IzklopljenMake properties default Nastavi lastnosti kot privzetePages selected Izbrane straniPage properties Lastnosti strani+ Create & Edit Ustvarjanje in urejanje+ Review & Compare Pregled in primerjava+ Forms & Signatures Obrazci in podpisi+ Protect & Standardize Zaščita in standardizacija+ Customize & Automate Prilagajanje in avtomatizacija+ No tools match your search. Iskanju ne ustreza nobeno orodje.+ Expand all tools Razširi vsa orodja+ Collapse all tools Strni vsa orodja+ Attach a file… Priloži datoteko…+ Delete attachment Izbriši prilogo+ Attaching files is not available on the web yet Prilaganje datotek na spletu še ni na voljo+ Attach {name} Priloži {name}+ Delete attachment {key} Izbriši prilogo {key}+ Font Pisava+ Bulleted list Označen seznam+ Numbered list Oštevilčen seznam+ Alignment Poravnava+ Superscript Nadpisano+ Subscript Podpisano+ Paragraph spacing Razmik med odstavki+ Less Manj+ Other options Druge možnosti+ Thumbnail size Velikost sličic+ Smaller thumbnails Manjše sličice+ Larger thumbnails Večje sličice+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Spremeni obliko komentarja++ # Prepare a form ▸ Text field table+ Add text field table Dodaj tabelo besedilnih polj+ Text field table Tabela besedilnih polj+ Text Field Table Tabela besedilnih polj+ Columns Stolpci+ Row spacing Razmik med vrsticami+ Column spacing Razmik med stolpci+ First row number Številka prve vrstice+ Column widths Širine stolpcev+ Distribute evenly Enakomerno porazdeli+ Field names Imena polj+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N ali {row} je številka vrstice, {col} številka stolpca in {seq} številka celice. Brez njih se številka vrstice doda na konec.+ Column {n} Stolpec {n}+ Add fields Dodaj polja+ the rows are too short: make the area taller, or use fewer rows or less row spacing vrstice so prenizke: povečajte višino območja ali uporabite manj vrstic ali manjši razmik med vrsticami+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing stolpec je preozek: razširite območje, stolpcu dajte več širine ali uporabite manj stolpcev ali manjši razmik med stolpci+ field names can't contain a period: {name} imena polj ne smejo vsebovati pike: {name}+ two cells would both be named {name} dve celici bi imeli enako ime {name}+ a field named {name} already exists polje z imenom {name} že obstaja++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Danes+ @plural {n} reply|{n} replies {n} odgovor|{n} odgovora|{n} odgovori|{n} odgovorov++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Orodja za strani+ Insert pages from a file after the selection… Vstavi strani iz datoteke za izborom…+ Rotate the selected pages counterclockwise Zavrti izbrane strani v nasprotni smeri urnega kazalca+ Rotate the selected pages clockwise Zavrti izbrane strani v smeri urnega kazalca+ Extract the selected pages… Izvleci izbrane strani…+ Delete the selected pages Izbriši izbrane strani++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Možnosti tega odgovora+ Export value Izvozna vrednost+ Show Page Edge Shadows Prikaži sence robov stranidiff --cc crates/ui-egui/src/i18n/te.tsvindex 62c6ff3ca,0bb56f479..6186eb171--- a/crates/ui-egui/src/i18n/te.tsv+++ b/crates/ui-egui/src/i18n/te.tsv@@@ -2343,4 -2424,66 +2424,67 @@@ animation effects Off ఆఫ�Make properties default లక్షణాలను డిఫాల్ట్గా చేయిPages selected ఎంచుకున్న పేజీలుPage properties పేజీ లక్షణాలు+ Create & Edit సృష్టించు & సవరించు+ Review & Compare సమీక్షించు & పోల్చు+ Forms & Signatures ఫారమ్లు & సంతకాలు+ Protect & Standardize రక్షించు & ప్రామాణీకరించు+ Customize & Automate అనుకూలీకరించు & ఆటోమేట్ చేయి+ No tools match your search. మీ శోధనకు సరిపోలే సాధనాలు లేవు.+ Expand all tools అన్ని సాధనాలను విస్తరించు+ Collapse all tools అన్ని సాధనాలను కుదించు+ Attach a file… ఫైల్ను జోడించు…+ Delete attachment జోడింపును తొలగించు+ Attaching files is not available on the web yet వెబ్లో ఫైల్లను జోడించడం ఇంకా అందుబాటులో లేదు+ Attach {name} {name}ను జోడించు+ Delete attachment {key} జోడింపు {key}ను తొలగించు+ Font ఫాంట్+ Bulleted list బుల్లెట్ జాబితా+ Numbered list సంఖ్యల జాబితా+ Alignment అమరిక+ Superscript సూపర్స్క్రిప్ట్+ Subscript సబ్స్క్రిప్ట్+ Paragraph spacing పేరా అంతరం+ Less తక్కువ+ Other options ఇతర ఎంపికలు+ Thumbnail size థంబ్నెయిల్ పరిమాణం+ Smaller thumbnails చిన్న థంబ్నెయిల్లు+ Larger thumbnails పెద్ద థంబ్నెయిల్లు+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment వ్యాఖ్య ఆకారాన్ని మార్చు++ # Prepare a form ▸ Text field table+ Add text field table టెక్స్ట్ ఫీల్డ్ పట్టిక జోడించు+ Text field table టెక్స్ట్ ఫీల్డ్ పట్టిక+ Text Field Table టెక్స్ట్ ఫీల్డ్ పట్టిక+ Columns నిలువు వరుసలు+ Row spacing వరుసల మధ్య దూరం+ Column spacing నిలువు వరుసల మధ్య దూరం+ First row number మొదటి వరుస సంఖ్య+ Column widths నిలువు వరుసల వెడల్పులు+ Distribute evenly సమానంగా పంచు+ Field names ఫీల్డ్ పేర్లు+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N లేదా {row} వరుస సంఖ్య, {col} నిలువు వరుస సంఖ్య, {seq} గడి సంఖ్య. వీటిలో ఏదీ లేకపోతే, వరుస సంఖ్య చివర చేరుతుంది.+ Column {n} నిలువు వరుస {n}+ Add fields ఫీల్డ్లు జోడించు+ the rows are too short: make the area taller, or use fewer rows or less row spacing వరుసలు చాలా తక్కువ ఎత్తులో ఉన్నాయి: ప్రాంతాన్ని ఎత్తుగా చేయండి, లేదా తక్కువ వరుసలు లేదా తక్కువ వరుస దూరం వాడండి+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing ఒక నిలువు వరుస చాలా ఇరుకుగా ఉంది: ప్రాంతాన్ని వెడల్పు చేయండి, ఆ నిలువు వరుసకు ఎక్కువ వెడల్పు ఇవ్వండి, లేదా తక్కువ నిలువు వరుసలు లేదా తక్కువ దూరం వాడండి+ field names can't contain a period: {name} ఫీల్డ్ పేర్లలో చుక్క ఉండకూడదు: {name}+ two cells would both be named {name} రెండు గడులకూ {name} అనే పేరు వస్తుంది+ a field named {name} already exists {name} అనే ఫీల్డ్ ఇప్పటికే ఉంది++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today ఈరోజు+ @plural {n} reply|{n} replies {n} ప్రత్యుత్తరం|{n} ప్రత్యుత్తరాలు++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools పేజీ సాధనాలు+ Insert pages from a file after the selection… ఎంపిక తర్వాత ఫైల్ నుండి పేజీలను చొప్పించు…+ Rotate the selected pages counterclockwise ఎంచుకున్న పేజీలను అపసవ్య దిశలో తిప్పు+ Rotate the selected pages clockwise ఎంచుకున్న పేజీలను సవ్య దిశలో తిప్పు+ Extract the selected pages… ఎంచుకున్న పేజీలను సంగ్రహించు…+ Delete the selected pages ఎంచుకున్న పేజీలను తొలగించు++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply ఈ ప్రత్యుత్తరం ఎంపికలు+ Export value ఎగుమతి విలువ+ Show Page Edge Shadows పేజీ అంచుల నీడలను చూపించుdiff --cc crates/ui-egui/src/i18n/tr.tsvindex e3f14aff3,b52688606..a8a993af8--- a/crates/ui-egui/src/i18n/tr.tsv+++ b/crates/ui-egui/src/i18n/tr.tsv@@@ -2430,4 -2511,66 +2511,67 @@@ animation effects Off Kapal�Make properties default Özellikleri varsayılan yapPages selected Seçilen sayfalarPage properties Sayfa özellikleri+ Create & Edit Oluştur ve Düzenle+ Review & Compare İncele ve Karşılaştır+ Forms & Signatures Formlar ve İmzalar+ Protect & Standardize Koru ve Standartlaştır+ Customize & Automate Özelleştir ve Otomatikleştir+ No tools match your search. Aramanızla eşleşen araç yok.+ Expand all tools Tüm araçları genişlet+ Collapse all tools Tüm araçları daralt+ Attach a file… Dosya ekle…+ Delete attachment Eki sil+ Attaching files is not available on the web yet Dosya eklemek web'de henüz kullanılamıyor+ Attach {name} {name} ekle+ Delete attachment {key} {key} ekini sil+ Font Yazı tipi+ Bulleted list Madde işaretli liste+ Numbered list Numaralı liste+ Alignment Hizalama+ Superscript Üst simge+ Subscript Alt simge+ Paragraph spacing Paragraf aralığı+ Less Daha az+ Other options Diğer seçenekler+ Thumbnail size Küçük resim boyutu+ Smaller thumbnails Küçük resimleri küçült+ Larger thumbnails Küçük resimleri büyüt+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Yorumun şeklini değiştir++ # Prepare a form ▸ Text field table+ Add text field table Metin alanı tablosu ekle+ Text field table Metin alanı tablosu+ Text Field Table Metin alanı tablosu+ Columns Sütunlar+ Row spacing Satır aralığı+ Column spacing Sütun aralığı+ First row number İlk satır numarası+ Column widths Sütun genişlikleri+ Distribute evenly Eşit dağıt+ Field names Alan adları+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N veya {row} satır numarası, {col} sütun numarası, {seq} hücre numarasıdır. Hiçbiri yoksa satır numarası sona eklenir.+ Column {n} Sütun {n}+ Add fields Alanları ekle+ the rows are too short: make the area taller, or use fewer rows or less row spacing satırlar çok kısa: alanı uzatın ya da daha az satır veya daha az satır aralığı kullanın+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing bir sütun çok dar: alanı genişletin, sütuna daha fazla yer verin ya da daha az sütun veya daha az sütun aralığı kullanın+ field names can't contain a period: {name} alan adları nokta içeremez: {name}+ two cells would both be named {name} iki hücrenin de adı {name} olurdu+ a field named {name} already exists {name} adlı bir alan zaten var++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Bugün+ @plural {n} reply|{n} replies {n} yanıt++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Sayfa araçları+ Insert pages from a file after the selection… Seçimin ardından dosyadan sayfa ekle…+ Rotate the selected pages counterclockwise Seçili sayfaları saat yönünün tersine döndür+ Rotate the selected pages clockwise Seçili sayfaları saat yönünde döndür+ Extract the selected pages… Seçili sayfaları ayıkla…+ Delete the selected pages Seçili sayfaları sil++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Bu yanıtın seçenekleri+ Export value Dışa aktarma değeri+ Show Page Edge Shadows Sayfa kenarı gölgelerini gösterdiff --cc crates/ui-egui/src/i18n/uk.tsvindex 5add728e3,dc65faf7a..566e67317--- a/crates/ui-egui/src/i18n/uk.tsv+++ b/crates/ui-egui/src/i18n/uk.tsv@@@ -2456,4 -2537,66 +2537,67 @@@ animation effects Off Вимкнен�Make properties default Зробити властивості типовимиPages selected Вибрані сторінкиPage properties Властивості сторінки+ Create & Edit Створення й редагування+ Review & Compare Рецензування й порівняння+ Forms & Signatures Форми й підписи+ Protect & Standardize Захист і стандартизація+ Customize & Automate Налаштування й автоматизація+ No tools match your search. Немає інструментів, що відповідають пошуку.+ Expand all tools Розгорнути всі інструменти+ Collapse all tools Згорнути всі інструменти+ Attach a file… Прикріпити файл…+ Delete attachment Видалити вкладення+ Attaching files is not available on the web yet Прикріплення файлів у веб-версії поки недоступне+ Attach {name} Прикріпити {name}+ Delete attachment {key} Видалити вкладення {key}+ Font Шрифт+ Bulleted list Маркований список+ Numbered list Нумерований список+ Alignment Вирівнювання+ Superscript Надрядковий+ Subscript Підрядковий+ Paragraph spacing Інтервал між абзацами+ Less Менше+ Other options Інші параметри+ Thumbnail size Розмір мініатюр+ Smaller thumbnails Зменшити мініатюри+ Larger thumbnails Збільшити мініатюри+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Змінити форму коментаря++ # Prepare a form ▸ Text field table+ Add text field table Додати таблицю текстових полів+ Text field table Таблиця текстових полів+ Text Field Table Таблиця текстових полів+ Columns Стовпці+ Row spacing Інтервал між рядками+ Column spacing Інтервал між стовпцями+ First row number Номер першого рядка+ Column widths Ширина стовпців+ Distribute evenly Розподілити рівномірно+ Field names Імена полів+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N або {row} — номер рядка, {col} — номер стовпця, {seq} — номер клітинки. Якщо їх немає, номер рядка додається в кінці.+ Column {n} Стовпець {n}+ Add fields Додати поля+ the rows are too short: make the area taller, or use fewer rows or less row spacing рядки занадто низькі: збільште висоту області, зменште кількість рядків або інтервал між ними+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing стовпець занадто вузький: розширте область, дайте стовпцю більше ширини, зменште кількість стовпців або інтервал між ними+ field names can't contain a period: {name} імена полів не можуть містити крапку: {name}+ two cells would both be named {name} дві клітинки мали б однакове ім'я {name}+ a field named {name} already exists поле з іменем {name} уже існує++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Сьогодні+ @plural {n} reply|{n} replies {n} відповідь|{n} відповіді|{n} відповідей++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Інструменти сторінок+ Insert pages from a file after the selection… Вставити сторінки з файлу після виділення…+ Rotate the selected pages counterclockwise Повернути вибрані сторінки проти годинникової стрілки+ Rotate the selected pages clockwise Повернути вибрані сторінки за годинниковою стрілкою+ Extract the selected pages… Витягнути вибрані сторінки…+ Delete the selected pages Видалити вибрані сторінки++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Параметри цієї відповіді+ Export value Значення експорту+ Show Page Edge Shadows Показувати тіні на краях сторінокdiff --cc crates/ui-egui/src/i18n/vi.tsvindex b5b396d56,e9a9a73f2..41063cc0d--- a/crates/ui-egui/src/i18n/vi.tsv+++ b/crates/ui-egui/src/i18n/vi.tsv@@@ -2687,4 -2789,59 +2789,60 @@@ key Space Spac# Historical snapshot notice bar (View signed version / View revision).You are viewing the signed version of “{from}” (revision {rev}). It is a snapshot: changes here won't affect the original. Bạn đang xem phiên bản đã ký của “{from}” (bản sửa đổi {rev}). Đây là ảnh nhanh: các thay đổi ở đây không được áp dụng đến bản gốc.You are viewing revision {rev} of “{from}”. It is a snapshot: changes here won't affect the original. Bạn đang xem bản sửa đổi {rev} của “{from}”. Đây là ảnh nhanh: các thay đổi ở đây không được áp dụng đến bản gốc.+ Attach a file… Đính kèm tệp…+ Delete attachment Xóa tệp đính kèm+ Attaching files is not available on the web yet Chưa thể đính kèm tệp trên web+ Attach {name} Đính kèm {name}+ Delete attachment {key} Xóa tệp đính kèm {key}+ Thumbnail size Kích thước hình thu nhỏ+ Smaller thumbnails Giảm kích thước hình thu nhỏ+ Larger thumbnails Tăng kích thước hình thu nhỏ+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment Đổi hình dạng nhận xét++ # AI-assisted additions for reading printer options off the GUI thread (#1818) (2026-10-16); not reviewed by a native speaker.+ Reading the printer's settings… Đang đọc cài đặt của máy in…++ # Prepare a form ▸ Text field table+ Add text field table Thêm bảng trường văn bản+ Text field table Bảng trường văn bản+ Text Field Table Bảng trường văn bản+ Columns Cột+ Row spacing Khoảng cách hàng+ Column spacing Khoảng cách cột+ First row number Số hàng đầu tiên+ Column widths Độ rộng cột+ Distribute evenly Phân bố đều+ Field names Tên trường+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N hoặc {row} là số hàng, {col} là số cột, {seq} là số ô. Nếu không có cái nào, số hàng được thêm vào cuối.+ Column {n} Cột {n}+ Add fields Thêm các trường+ the rows are too short: make the area taller, or use fewer rows or less row spacing các hàng quá thấp: hãy làm vùng cao hơn, hoặc dùng ít hàng hơn hay khoảng cách hàng nhỏ hơn+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing một cột quá hẹp: hãy làm vùng rộng hơn, cho cột thêm độ rộng, hoặc dùng ít cột hơn hay khoảng cách cột nhỏ hơn+ field names can't contain a period: {name} tên trường không được chứa dấu chấm: {name}+ two cells would both be named {name} hai ô sẽ cùng có tên {name}+ a field named {name} already exists đã có trường tên {name}+ a table has 1 to {max} rows một bảng có từ 1 đến {max} hàng+ a table has 1 to {max} columns một bảng có từ 1 đến {max} cột+ the first row number can be at most {max} số hàng đầu tiên tối đa là {max}+ the area, the spacing and the column widths must be numbers, the spacing 0 or more and each width more than 0 vùng, khoảng cách và độ rộng cột phải là số, khoảng cách từ 0 trở lên và mỗi độ rộng lớn hơn 0++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today Hôm nay++ # AI-assisted additions for restoring the last view (#1767) (2026-10-16); not reviewed by a native speaker.+ Restore the last view (page, zoom and page display) when a document is opened again Khôi phục chế độ xem gần nhất (trang, thu phóng và hiển thị trang) khi mở lại tài liệu+ @plural {n} reply|{n} replies {n} câu trả lời++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools Công cụ trang+ Insert pages from a file after the selection… Chèn trang từ tệp sau vùng chọn…+ Rotate the selected pages counterclockwise Xoay các trang đã chọn ngược chiều kim đồng hồ+ Rotate the selected pages clockwise Xoay các trang đã chọn theo chiều kim đồng hồ+ Extract the selected pages… Trích xuất các trang đã chọn…+ Delete the selected pages Xóa các trang đã chọn++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply Tùy chọn cho câu trả lời này+ Export value Giá trị xuất+ Show Page Edge Shadows Hiển thị bóng viền trangdiff --cc crates/ui-egui/src/i18n/zh-hans.tsvindex 31ea7fc18,5f08576b8..6089c942f--- a/crates/ui-egui/src/i18n/zh-hans.tsv+++ b/crates/ui-egui/src/i18n/zh-hans.tsv@@@ -2398,4 -2479,66 +2479,67 @@@ animation effects Off �Make properties default 将属性设为默认Pages selected 选定的页面Page properties 页面属性+ Create & Edit 创建和编辑+ Review & Compare 审阅和比较+ Forms & Signatures 表单和签名+ Protect & Standardize 保护和标准化+ Customize & Automate 自定义和自动化+ No tools match your search. 没有与搜索匹配的工具。+ Expand all tools 展开所有工具+ Collapse all tools 折叠所有工具+ Attach a file… 附加文件…+ Delete attachment 删除附件+ Attaching files is not available on the web yet 网页版尚不支持附加文件+ Attach {name} 附加 {name}+ Delete attachment {key} 删除附件 {key}+ Font 字体+ Bulleted list 项目符号列表+ Numbered list 编号列表+ Alignment 对齐+ Superscript 上标+ Subscript 下标+ Paragraph spacing 段落间距+ Less 收起+ Other options 其他选项+ Thumbnail size 缩略图大小+ Smaller thumbnails 缩小缩略图+ Larger thumbnails 放大缩略图+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment 更改注释形状++ # Prepare a form ▸ Text field table+ Add text field table 添加文本字段表格+ Text field table 文本字段表格+ Text Field Table 文本字段表格+ Columns 列+ Row spacing 行间距+ Column spacing 列间距+ First row number 起始行号+ Column widths 列宽+ Distribute evenly 平均分布+ Field names 字段名称+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N 或 {row} 表示行号,{col} 表示列号,{seq} 表示单元格序号。如果都没有,行号加在末尾。+ Column {n} 第 {n} 列+ Add fields 添加字段+ the rows are too short: make the area taller, or use fewer rows or less row spacing 行太矮:请增加区域高度,或减少行数或行间距+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing 某列太窄:请加宽区域、给该列更多宽度,或减少列数或列间距+ field names can't contain a period: {name} 字段名称不能包含句点:{name}+ two cells would both be named {name} 两个单元格的名称都会是 {name}+ a field named {name} already exists 已存在名为 {name} 的字段++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today 今天+ @plural {n} reply|{n} replies {n} 条回复++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools 页面工具+ Insert pages from a file after the selection… 在所选内容后插入文件中的页面…+ Rotate the selected pages counterclockwise 逆时针旋转所选页面+ Rotate the selected pages clockwise 顺时针旋转所选页面+ Extract the selected pages… 提取所选页面…+ Delete the selected pages 删除所选页面++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply 此回复的选项+ Export value 导出值+ Show Page Edge Shadows 显示页面边缘阴影diff --cc crates/ui-egui/src/i18n/zh-hant.tsvindex 4a94f44f5,2570f12f1..292e39957--- a/crates/ui-egui/src/i18n/zh-hant.tsv+++ b/crates/ui-egui/src/i18n/zh-hant.tsv@@@ -2384,4 -2465,66 +2465,67 @@@ animation effects Off �Make properties default 將內容設為預設Pages selected 選取的頁面Page properties 頁面屬性+ Create & Edit 建立與編輯+ Review & Compare 審閱與比較+ Forms & Signatures 表單與簽名+ Protect & Standardize 保護與標準化+ Customize & Automate 自訂與自動化+ No tools match your search. 沒有符合搜尋的工具。+ Expand all tools 展開所有工具+ Collapse all tools 摺疊所有工具+ Attach a file… 附加檔案…+ Delete attachment 刪除附件+ Attaching files is not available on the web yet 網頁版尚不支援附加檔案+ Attach {name} 附加 {name}+ Delete attachment {key} 刪除附件 {key}+ Font 字型+ Bulleted list 項目符號清單+ Numbered list 編號清單+ Alignment 對齊+ Superscript 上標+ Subscript 下標+ Paragraph spacing 段落間距+ Less 收起+ Other options 其他選項+ Thumbnail size 縮圖大小+ Smaller thumbnails 縮小縮圖+ Larger thumbnails 放大縮圖+ # Lines, connected lines and polygons reshaped by their ends and corners (M5).+ Reshape comment 變更註解形狀++ # Prepare a form ▸ Text field table+ Add text field table 新增文字欄位表格+ Text field table 文字欄位表格+ Text Field Table 文字欄位表格+ Columns 欄+ Row spacing 列間距+ Column spacing 欄間距+ First row number 起始列號+ Column widths 欄寬+ Distribute evenly 平均分配+ Field names 欄位名稱+ N or {row} is the row number, {col} the column number, {seq} the cell number. With none of them, the row number goes last. N 或 {row} 代表列號,{col} 代表欄號,{seq} 代表儲存格序號。若都沒有,列號會加在結尾。+ Column {n} 第 {n} 欄+ Add fields 新增欄位+ the rows are too short: make the area taller, or use fewer rows or less row spacing 列太矮:請加高區域,或減少列數或列間距+ a column is too narrow: make the area wider, give the column more of it, or use fewer columns or less column spacing 某欄太窄:請加寬區域、給該欄更多寬度,或減少欄數或欄間距+ field names can't contain a period: {name} 欄位名稱不能包含句點:{name}+ two cells would both be named {name} 兩個儲存格的名稱都會是 {name}+ a field named {name} already exists 已有名為 {name} 的欄位++ # Date picker: Today button (#4274) (AI-assisted, not separately native-reviewed)+ Today 今天+ @plural {n} reply|{n} replies {n} 則回覆++ # Pages panel: the Page tools menu (#4415) (AI-assisted, not separately native-reviewed)+ Page tools 頁面工具+ Insert pages from a file after the selection… 在所選內容後插入檔案中的頁面…+ Rotate the selected pages counterclockwise 逆時針旋轉所選頁面+ Rotate the selected pages clockwise 順時針旋轉所選頁面+ Extract the selected pages… 擷取所選頁面…+ Delete the selected pages 刪除所選頁面++ # Comments panel: each reply's own "…" menu (AI-assisted, not separately native-reviewed)+ Options for this reply 此回覆的選項+ Export value 匯出值+ Show Page Edge Shadows 顯示頁面邊緣陰影diff --cc crates/ui-egui/src/workflows/js_ui.rsindex bc66766be,b8f5d51cc..c87699278--- a/crates/ui-egui/src/workflows/js_ui.rs+++ b/crates/ui-egui/src/workflows/js_ui.rs@@@ -260,27 -351,40 +351,44 @@@ fn date_language_picker_name(l: &pdfcra}}- /// Preferences: interface language and size, appearance, identity and JavaScript. Returns `true` to close.- pub(crate) fn preferences_body(ui: &mut egui::Ui, app: &mut PdfCraftApp, t: &Tokens) -> bool {+ /// Preferences: interface language and size, appearance, identity and JavaScript. Drawn in a scroll+ /// area; [`preferences_buttons`] goes below it, outside the scroll, so OK is always in reach.+ pub(crate) fn preferences_body(ui: &mut egui::Ui, app: &mut PdfCraftApp, t: &Tokens) {ui.label(egui::RichText::new(tl!("Preferences")).font(theme::semibold(18.0)));+ ui.label(egui::RichText::new(tl!("Appearance")).font(theme::semibold(13.0)));+ if ui.add(widgets::checkbox(&mut app.show_page_edge_shadows, tl!("Show Page Edge Shadows"))).changed() {+ ui.ctx().request_repaint();+ }ui.horizontal(|ui| {- ui.label(tl!("Interface language"));- let selected = crate::i18n::Lang::from_code(&app.language).map_or(tl!("Auto"), crate::i18n::Lang::name);+ let label = ui.label(tl!("Interface language"));+ // A native name is only drawn when these fonts can draw it; otherwise the English name+ // keeps the list readable instead of aborting on a missing glyph (for example Hindi+ // without a Devanagari face, and installed system fonts turned off).+ let (selected, picker) = {+ let drawable = |text: &str| picker_text_is_drawable(ui, text);+ let selected = crate::i18n::Lang::from_code(&app.language)+ .map_or_else(|| tl!("Auto").to_owned(), |language| language.picker_name(drawable).to_owned());+ let picker = crate::i18n::Lang::for_picker_by(|language| language.picker_name(drawable))+ .into_iter()+ .map(|language| (language, language.picker_name(drawable)))+ .collect::<Vec<_>>();+ (selected, picker)+ };let before = app.language.clone();- egui::ComboBox::from_id_salt("interface-language").selected_text(selected).show_ui(ui, |ui| {- if ui.selectable_value(&mut app.language, crate::i18n::AUTO.to_string(), tl!("Auto")).clicked() {- ui.close();- }- for language in crate::i18n::Lang::all() {- if ui.selectable_value(&mut app.language, language.code().to_string(), language.name()).clicked() {+ craft_ui::ComboBox::from_id_salt("interface-language")+ .selected_text(selected)+ .show_ui(ui, |ui| {+ if ui.selectable_value(&mut app.language, crate::i18n::AUTO.to_string(), tl!("Auto")).clicked() {ui.close();}- }- });+ for (language, name) in &picker {+ if ui.selectable_value(&mut app.language, language.code().to_string(), *name).clicked() {+ ui.close();+ }+ }+ })+ .response+ .labelled_by(label.id);// Relabel the rest of this dialog in the new language right away, not next frame.if app.language != before {crate::i18n::set_current(crate::i18n::Lang::from_pref(&app.language));diff --cc crates/ui-egui/tests/it/control.rsindex 18773b267,e1a7e1f1d..2ca751f11--- a/crates/ui-egui/tests/it/control.rs+++ b/crates/ui-egui/tests/it/control.rs@@@ -86,25 -88,58 +88,77 @@@ fn ok(h: &mut Harness<'static, PdfCraftcall(h, c, method, params).unwrap_or_else(|e| panic!("{method}: {e}"))}+ /// Let the next real frames run after a control setting that changes the interface fonts or+ /// opens a modal. `ui.set` answers in the input pass, and a font change discards the pass that+ /// applies it, so the modal's labels are not in the accessibility tree until those frames have+ /// been laid out.+ fn settle(h: &mut Harness<'static, PdfCraftApp>) {+ h.run_steps(3);+ }++ #[test]+ fn comment_pin_is_reported_and_persistent() {+ let (mut h, c) = harness();+ assert_eq!(ok(&mut h, &c, "ui.state", json!({}))["comment_tool_pinned"], false);+ for pinned in [true, false] {+ ok(&mut h, &c, "ui.set", json!({"key":"comment-tool-pinned","value":pinned}));+ assert_eq!(ok(&mut h, &c, "ui.state", json!({}))["comment_tool_pinned"], pinned);+ let mut restored = PdfCraftApp::new();+ restored.comment_prefs.pinned = !pinned;+ restored.restore(&h.state().persist());+ assert_eq!(restored.comment_prefs.pinned, pinned);+ for invalid in [json!("yes"), json!(1), json!(null), json!([]), json!({})] {+ assert!(call(&mut h, &c, "ui.set", json!({"key":"comment-tool-pinned","value":invalid})).is_err());+ assert_eq!(ok(&mut h, &c, "ui.state", json!({}))["comment_tool_pinned"], pinned);+ }+ assert_eq!(ok(&mut h, &c, "ui.state", json!({}))["documents"][0]["dirty"], false);+ }+ }++ #[test]+ fn thumbnail_size_is_settable_and_inspectable_through_the_control_channel() {+ let (mut h, c) = harness();+ ok(&mut h, &c, "ui.set", json!({"key": "panel", "value": "pages"}));+ ok(&mut h, &c, "ui.set", json!({"key": "thumbnail-zoom", "value": "50"}));+ let state = ok(&mut h, &c, "ui.state", json!({}));+ assert_eq!(state["active"]["thumbnail_zoom"], 0.5);+ assert_eq!(state["active"]["grid_zoom"], 1.0);+ assert_eq!(state["documents"][0]["dirty"], false);+ let controls = ok(&mut h, &c, "ui.inspect", json!({"query": "thumbnails"}));+ let widgets = controls["widgets"].as_array().unwrap();+ assert!(widgets.iter().any(|w| w["label"] == "Larger thumbnails"));+ assert!(widgets.iter().any(|w| w["label"] == "Smaller thumbnails" && w["enabled"] == false));+ assert!(call(&mut h, &c, "ui.set", json!({"key": "thumbnail-zoom", "value": "NaN"})).is_err());+ ok(&mut h, &c, "ui.click", json!({"label": "Larger thumbnails"}));+ h.run_steps(3);+ assert_eq!(ok(&mut h, &c, "ui.state", json!({}))["active"]["thumbnail_zoom"], 0.75);+ let sliders = ok(&mut h, &c, "ui.inspect", json!({"query": "Thumbnail size", "role": "Slider"}));+ let slider = sliders["widgets"].as_array().unwrap().first().expect("the thumbnail size slider is labelled");+ ok(&mut h, &c, "ui.focus", json!({"id": slider["id"]}));+ ok(&mut h, &c, "ui.key", json!({"key": "ArrowRight"}));+ h.run_steps(3);+ assert!(ok(&mut h, &c, "ui.state", json!({}))["active"]["thumbnail_zoom"].as_f64().unwrap() > 0.75);+ }++#[test]+fn page_shadows_are_an_observable_app_wide_preference() {+ let (mut h, c) = harness();+ assert_eq!(ok(&mut h, &c, "ui.state", json!({}))["show_page_edge_shadows"], true);+ for value in ["false", "true"] {+ ok(&mut h, &c, "ui.set", json!({ "key": "show_page_edge_shadows", "value": value }));+ assert_eq!(ok(&mut h, &c, "ui.state", json!({}))["show_page_edge_shadows"], value == "true");+ }+ for value in ["off", "1", "False", ""] {+ assert!(call(&mut h, &c, "ui.set", json!({ "key": "show_page_edge_shadows", "value": value })).is_err());+ assert_eq!(ok(&mut h, &c, "ui.state", json!({}))["show_page_edge_shadows"], true);+ }+ ok(&mut h, &c, "ui.set", json!({ "key": "show_page_edge_shadows", "value": false }));+ assert_eq!(ok(&mut h, &c, "ui.state", json!({}))["show_page_edge_shadows"], false);+ h.state_mut().active = None;+ ok(&mut h, &c, "ui.set", json!({ "key": "show_page_edge_shadows", "value": "false" }));+ assert_eq!(ok(&mut h, &c, "ui.state", json!({}))["show_page_edge_shadows"], false);+}+#[test]fn control_resize_reports_observed_dimensions_and_rejects_invalid_sizes() {let (mut h, c) = harness();diff --cc docs/roadmap.mdindex 653041e17,0f1fb6f4d..df8623014--- a/docs/roadmap.md+++ b/docs/roadmap.md@@@ -199,7 -290,49 +290,50 @@@ Estimates unchanged| Date | Change | Summary ||---|---|---|++| 2026-10-31 | patch | #1577: reconcile optional page shadows with current viewer/organizer and settings modules; CI validation pending. |+ | 2026-10-31 | patch | M2, PR #4172: eight GBK font/alias cases compare exact pixels with independent installed-face and explicit-Unicode references; wrong-glyph and wrong-family negative controls fail. Estimates unchanged. |+ | 2026-10-31 | patch | M2, PR #4172: integrate main fa5f9f8c, preserve both raster test groups and restore explicit display_config imports; display-only CJK policy and estimates unchanged. |+ | 2026-10-28 | patch | M2, PR #4172: integrate main 5af10276 and retain both roadmap histories; viewer-only CJK and print/output font policies and estimates unchanged. |+ | 2026-10-24 | minor | M11: the PDF Optimizer and Reduce File Size store Group 3 fax images as Group 4 when smaller (`Document::fax_params`), and pack eight-bit `DeviceRGB` of only black and white (as grey) and indexed images of 2, 4 or 8 bits that use only palette entries 0 and 1 (keeping the palette) to one bit, so Monochrome Images compresses and downsamples them. Estimates unchanged. |+ | 2026-10-24 | minor | M11: monochrome downsampling: the PDF Optimizer and Reduce File Size average black-and-white images (1-bit, CCITT fax, eight-bit black-and-white grey) above 450 ppi down to 300 ppi, by area with ties black, as Monochrome Images ▸ Downsample to and `doc_optimize` `mono: { downsample, ppi, above_ppi }`; CCITT decoding moves into `pdfcraft-filters` (`decode_ccitt`) behind `Document::decoded_image`. Estimates unchanged. |+ | 2026-10-24 | minor | M11: Create PDF stores pictures of only black and white at one bit (Group 4 or Flate, whichever is smaller) instead of eight-bit grey; the optimizer packs eight-bit black-and-white grey images to one bit before Monochrome Images compresses them, unless the grey settings make them smaller, as they can a dithered scan, soft mask counted; Export ▸ Images decodes CCITT fax images. Estimates unchanged. |+ | 2026-10-26 | minor | M11: lossless JBIG2 symbol coding (`pdfcraft_filters::encode_jbig2`): each distinct mark stored once in a symbol dictionary and its exact copies placed by a text region, larger and lone marks in a generic region, used when smaller than the generic coding; on six pages of rendered 300 dpi text 28% of the generic region's size and 17% of Group 4's. Scans gain little until refinement coding; `/JBIG2Globals` and lossy coding not yet. Estimates unchanged. |+ | 2026-10-23 | minor | M11: lossless JBIG2 for black-and-white images (`pdfcraft_filters::encode_jbig2_generic`, a generic region coded with the MQ coder, written from the JBIG2 draft standard), as Monochrome Images ▸ JBIG2 (lossless) and `doc_optimize` `mono: jbig2`; about a third smaller than Group 4 on 300 dpi text. Export ▸ Images reads JBIG2 images (`hayro-jbig2`, with `/JBIG2Globals`). Symbol coding not yet. Estimates unchanged. |+ | 2026-10-23 | minor | M11: black-and-white images (1-bit, and image masks) are stored losslessly as CCITT Group 4 when that is smaller: PDF Optimizer ▸ Images ▸ Monochrome Images (on by default, so Reduce File Size too), `doc_optimize` `mono`; `pdfcraft_filters::encode_g4`. JBIG2 and monochrome downsampling not yet. Estimates unchanged. |+ | 2026-10-23 | minor | M6: calculation checks: a formula reading a field the form doesn't have, and a script building the names it reads, are flagged by `form_calculation_order` and on the Calculation order page (a red mark, a card naming the broken formulas, a note for built names); `form_calculation_order` gives each formula and `form_fields` a custom Calculate script. Estimates unchanged. |+ | 2026-10-29 | minor | M7 #2517: widening a paragraph rejoins a wrap with the spaces that wrap consumed, including a typed run and none for a Chinese or Japanese word split, after an incremental save and a full rewrite. Estimates unchanged. |+ | 2026-10-27 | minor | M10: OCR stages SHA-256-verified ONNX models after the upstream RTEN URL brownout; discovery prefers a complete ONNX pair per directory, falls back to a complete RTEN pair, and never mixes formats or directories; language/web limits and estimates unchanged. |+ | 2026-10-24 | minor | M3, #3970 follow-up: the button release given back after a window move or resize goes before the pointer leaving, so hover doesn't stick. Estimates unchanged. |+ | 2026-10-23 | minor | M8, #3205 follow-up: phone-pattern redaction includes the +39 country code on labelled Italian geographic numbers with a slash; dates, protocol identifiers and whole-run guards remain. Estimates unchanged. |+ | 2026-10-23 | minor | M10: Word table cells use the grid columns they span, including cells after a merged cell; synthetic export regression and CLI reproduction. Estimates unchanged. |+ | 2026-10-23 | minor | M10: covered table slots retain their text in paragraph flow across Office exporters; emitted superscripts remain in their cells. Synthetic source and CLI regressions; estimates unchanged. |+ | 2026-10-23 | minor | M10: Export all images and Save Image As apply soft-mask Decode intervals to PNG alpha before resizing, including inverted/subrange, indirect, packed and JPEG masks. Estimates unchanged. |+ | 2026-10-23 | minor | M10: annotation appearances use unoccupied XObject names, preserving original page artwork and distinct appearances through inherited resources and print/reopen. Estimates unchanged. |+ | 2026-10-21 | minor | M3: on GNOME/Wayland, a second resize by an edge or move by the tab strip works without a click in between (the compositor kept the button's release from egui). Estimates unchanged. |+ | 2026-10-22 | minor | M4, #3916 partial: edits and Undo/Redo cancel Organize page drags. Pointer-release and save/reopen regressions check page order. Estimates unchanged. |+ | 2026-10-22 | minor | M14 #3558: rebased macOS association recovery; reuse #3042 shared metadata preservation instead of a duplicate save wrapper. Estimates unchanged. |+ | 2026-10-22 | minor | M7 #2517: a partial rewrite of two paragraphs that share one text object closes the marker before the neighbour, so a later edit does not delete it. Estimates unchanged. |+ | 2026-10-18 | minor | M7 #2517: a partial rewrite of the last paragraph closes its marker after the last `ET`, and does not close a following marked region early. Estimates unchanged. |+ | 2026-10-15 | minor | M7 #2517: a blank line between paragraphs stays a paragraph break, and growing the first paragraph does not absorb the next one. Estimates unchanged. |+ | 2026-10-20 | minor | M4: initial-view window and interface options resolve indirect boolean ViewerPreferences values; synthetic true/false and save/reopen regressions retain defaults for malformed entries. Estimates unchanged. |+ | 2026-10-21 | minor | M3, #3808: the Pages inspector has an independent 50–150% thumbnail size slider and buttons; selection and current-page following are retained, with headless ui.set coverage. Estimates unchanged. |+ | 2026-10-20 | minor | M11 #3507: image merging preserves comments and state across content streams. Estimates unchanged. |+ | 2026-10-17 | minor | M8, gap 6 #2662: a filled cover that hides half of any one word of a long line counts as a redaction-audit finding, applied or not; a sliver under half of every word stays unflagged. Estimates unchanged. |+ | 2026-10-13 | minor | M10: dotted-leader contents entries retain titles and page numbers in separate paragraphs (#1757); estimates unchanged. |+ | 2026-10-22 | minor | M6: calculation scripts: simplified field notation is read only from a comment, and a regular expression after `if (…)`, `while (…)`, `for (…)` or `with (…)` as one, so a rename leaves strings and regular expressions alone; a `//` comment ends at any line terminator, not only `\n`. Estimates unchanged. |+ | 2026-10-20 | minor | M6: Prepare a form ▸ Calculation order: formulas and values, what is wrong and Fix order, Up/Down, Alt+↑/↓ and drag, links on the page. Estimates unchanged. |+ | 2026-10-20 | minor | M6: `form_calculation_order` reads, checks, fixes and sets the calculation order; an edited formula keeps its place in `/CO`. Estimates unchanged. |+ | 2026-10-20 | minor | M12 #3673: Character encoding accepts Identity-H/V with Adobe CJK collections, or a predefined non-Identity CMap; unknown names and foreign registries do not establish a mapping route. Synthetic checker and read-only automation regressions passed after failing before the fix. Per-glyph validation and embedded-font extraction remain separate; estimates unchanged. |+ | 2026-10-19 | minor | M6: renaming a field renames it in the calculations that read it; `form_set_props` returns `formulas_updated` and Field Properties says how many changed. Estimates unchanged. |+ | 2026-10-20 | minor | M6, #3502: form detection preserves comments across content streams; estimates unchanged. |+ | 2026-10-20 | minor | M3/#3620: overlapping comment hover follows original annotation indices independently of spatial inspection sorting; a synthetic differing-upper-edge regression covers paint order. Estimates unchanged. |+ | 2026-10-20 | minor | M10, #3532 partial: vector printing retains existing appearances with absent Subtype; estimates unchanged. |+ | 2026-10-19 | minor | M4 #3309: named-destination pruning keeps large documents usable; 60,000-name and deep-tree regressions verify targets through undo/redo and both save modes. Estimates unchanged. |+ | 2026-10-19 | minor | M6: Text field table (rows and columns of text fields as one edit, `form_add_field_table`); estimates unchanged |+ | 2026-10-18 | minor | M5, PR #1971: nested source `/Page` and `/Pages` dictionaries export as null without traversing page content or the page tree. Synthetic saved/reopened three-page regression retains unrelated metadata and aliases. FDF import semantics, copied-graph limits and estimates unchanged. |+ | 2026-10-15 | minor | M5: budget retained FDF entries before cloning; discovery keeps lazy array owners and annotation positions, with alias/cache-eviction stress fixtures. Limits cover the copied graph; source parsing/page discovery retain existing COS/parser limits, with no total source-memory bound. FDF import semantics and estimates unchanged. || 2026-10-15 | minor | M7: Edit text caret height follows its row, with a kittest regression; estimates unchanged |+ | 2026-10-19 | minor | M3 #3360: retain each document’s scroll position when switching Read and the docking workspace at fixed zoom. Estimates unchanged. || 2026-10-18 | minor | M4, PR #1919 review: repeated page indices apply each rotation to the latest page-local value, preserving indirect/inherited angles. Synthetic adjacent/interleaved duplicates retain siblings and page contents through incremental and full saves. Estimates unchanged. || 2026-10-18 | minor | M3, #3149: page replacement cancels render demand collected for the previous geometry; all viewer raster upload paths reject empty or oversized textures before cache eviction. Synthetic regressions reproduce the reported 1880×2350 upload at a 2048 limit, retain cached images and unsaved edits, and resume bounded backdrops and tiles. Estimates unchanged. || 2026-10-17 | minor | M4 #2997: Ctrl-drag (Option on macOS) in the Organize grid copies the dragged pages into the drop gap (a "+" badge says so; the copies land selected, one undo step); `page_duplicate` takes `at`, and the UI control channel's `ui.drag` modifiers reach the input state. Estimates unchanged. |diff --cc parity/acrobat-features.tomlindex 9a38052eb,0b6f658dd..98bfdccc3--- a/parity/acrobat-features.toml+++ b/parity/acrobat-features.toml@@@ -9816,8 -9928,8 +9928,8 @@@ milestone = "M14status = "partial"commands = []tools = []- evidence = ["crates/ui-egui/tests/page_shadows.rs::viewport_fades_follow_the_preference_and_keep_other_scroll_areas_styled", "crates/ui-egui/tests/page_shadows.rs::rendered_page_content_is_identical_with_and_without_decoration", "crates/ui-egui/tests/page_shadows.rs::page_shadow_preference_round_trips_and_ignores_invalid_settings", "crates/ui-egui/tests/page_shadows.rs::viewer_shadows_follow_the_preference_without_moving_pages", "crates/ui-egui/tests/page_shadows.rs::organize_shadows_follow_the_preference", "crates/ui-egui/tests/control.rs::page_shadows_are_an_observable_app_wide_preference", "crates/ui-egui/tests/view.rs::default_page_display_is_used_for_new_documents", "crates/ui-egui/tests/view.rs::default_zoom_is_used_for_new_documents", "crates/ui-egui/tests/view.rs::preferences_set_the_default_zoom"]-evidence = ["crates/ui-egui/tests/it/view.rs::default_page_display_is_used_for_new_documents", "crates/ui-egui/tests/it/view.rs::default_zoom_is_used_for_new_documents", "crates/ui-egui/tests/it/view.rs::preferences_set_the_default_zoom", "crates/ui-egui/tests/it/view.rs::always_use_my_default_zoom_and_page_layout_ignores_what_the_pdf_asks_for"]-notes = "Preferences ▸ Documents and view: Default page display and Default zoom (Fit to width, Zoom to page level or a percentage) for every new tab; a PDF that asks for a layout or zoom gets it, unless Always use my default zoom and page layout is on. Missing: Acrobat's resolution, rendering and page-content options"++evidence = ["crates/ui-egui/tests/page_shadows.rs::viewport_fades_follow_the_preference_and_keep_other_scroll_areas_styled", "crates/ui-egui/tests/page_shadows.rs::rendered_page_content_is_identical_with_and_without_decoration", "crates/ui-egui/tests/page_shadows.rs::page_shadow_preference_round_trips_and_ignores_invalid_settings", "crates/ui-egui/tests/page_shadows.rs::viewer_shadows_follow_the_preference_without_moving_pages", "crates/ui-egui/tests/page_shadows.rs::organize_shadows_follow_the_preference", "crates/ui-egui/tests/it/control.rs::page_shadows_are_an_observable_app_wide_preference", "crates/ui-egui/tests/it/view.rs::default_page_display_is_used_for_new_documents", "crates/ui-egui/tests/it/view.rs::default_zoom_is_used_for_new_documents", "crates/ui-egui/tests/it/view.rs::preferences_set_the_default_zoom"]+notes = "Preferences ▸ Documents and view: Default page display and Default zoom (Fit to width, Zoom to page level or a percentage) for every new tab; a PDF that asks for a layout or zoom gets it. Preferences ▸ Appearance also has an app-wide, persistent Show Page Edge Shadows checkbox (on by default), exposed through ui.set and ui.state; it affects viewer and Organize decorations, including the viewport-edge gradients painted over pages, only. Missing: Acrobat's resolution, rendering and page-content options"[[feature]]id = "misc.prefs-documents"