PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust
Refactor ui workflows for strict Clippy checks
Dylan M. Taylor2ca92751cfb8
diff --git a/crates/ui-egui/src/workflows/combine_grid/card.rs b/crates/ui-egui/src/workflows/combine_grid/card.rsindex 63cf14c5e..3e98daa54 100644--- a/crates/ui-egui/src/workflows/combine_grid/card.rs+++ b/crates/ui-egui/src/workflows/combine_grid/card.rs@@ -1,5 +1,8 @@use super::thumbs::{Key, Look, MAX_SIDE, PREVIEW, PREVIEW_SIDE, SIZE_STEP, Thumbs, Want};-use super::*;+use super::{+ ABOVE, Align2, Arc, BAR_H, Color32, CombineFile, CornerRadius, ERROR, FALLBACK_PAGE, GridDrag, Lock, MAX_EXPAND, ON_PAPER, PdfCraftApp, Rect,+ RowAction, Sense, Stroke, TextureHandle, Tokens, Vec2, WARNING, fit_name, icons, paper_size, pos2, theme, vec2,+};/// One card's place and what it shows.pub(super) struct Card {@@ -18,6 +21,16 @@ pub(super) struct Card {pub(super) fit: Vec2,}+/// The paper box a card's page is drawn in.+struct Paper {+ rect: Rect,+ size: Vec2,+ /// The page's size in points.+ size_pt: (f32, f32),+ /// Whether the page's own size is known (else a fallback is drawn and no preview is asked for).+ known: bool,+}+impl Card {pub(super) fn id(&self, ui: &egui::Ui, f: &CombineFile) -> egui::Id {match self.page {@@ -81,56 +94,7 @@ impl Card {painter.rect_filled(paper, CornerRadius::ZERO, Color32::WHITE);// What goes on the paper: the thumbnail, or why there isn't one.- let mut why: Option<(&str, Color32, String)> = None;- if let Some(lock) = f.lock {- let text = match lock {- Lock::Open => tl!("Password-protected"),- Lock::Permissions => tl!("Its security settings don't allow copying pages"),- };- why = Some(("lock", ON_PAPER, text.to_owned()));- } else if let Some(p) = &f.problem {- why = Some(("circle-x", ERROR, p.clone()));- } else {- match page {- Err(e) => why = Some(("circle-x", ERROR, e)),- // The pages couldn't be counted, or the page's size is unknown (some passwords- // open a file for combining but not for reading it here): nothing is drawn (the- // engine decides at Combine), and the card says so rather than look blank.- Ok(p) if p >= f.pages || known.is_none() => why = Some(("eye-off", ON_PAPER, tl!("No preview").to_owned())),- Ok(p) => {- // Pixels per point: the size the paper is drawn at, on both sides, and never a- // side longer than a thumbnail's (a long, thin page fits by its long side).- let (w, h) = size_pt;- let scale = (size.x * self.ppp / w).min(size.y * self.ppp / h).min(MAX_SIDE / w.max(h));- let px = [w * scale, h * scale].map(|v| (v.max(1.0).ceil() as u32).div_ceil(SIZE_STEP).saturating_mul(SIZE_STEP));- let key = Key { source: Arc::as_ptr(&f.bytes) as usize, auth: f.auth, page: p, px };- let look = thumbs.look((f.group, p), key);- let mut want = false;- match look {- Look::Ready(tex) => {- painter.image(tex, paper, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);- }- Look::Failed(e) => why = Some(("triangle-alert", WARNING, crate::i18n::fmt(tl!("Preview unavailable: {e}"), &[("e", &e)]))),- Look::Pending(stand_in) => {- if let Some(tex) = stand_in {- painter.image(tex, paper, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);- }- want = true;- }- }- if want && scale.is_finite() && scale > 0.0 {- thumbs.wants.push(Want {- slot: (f.group, p),- key,- bytes: f.bytes.clone(),- password: f.password().map(Arc::from),- scale,- visible: ui.is_rect_visible(c),- });- }- }- }- }+ let why = self.paper_content(ui, &painter, f, thumbs, page, Paper { rect: paper, size, size_pt, known: known.is_some() });if let Some((icon, colour, _)) = &why {icons::paint(ui, Rect::from_center_size(paper.center(), Vec2::splat(28.0)), icon, 28.0, *colour);}@@ -187,26 +151,7 @@ impl Card {let previewable = why.is_none();// A file that adds more pages than one can be spread out into them.let expandable = self.page.is_none() && takes > 1 && takes <= MAX_EXPAND && f.lock.is_none() && f.problem.is_none() && self.check.is_ok();- // Shown large: the file from its first page, or a page card's page.- let preview = match self.page {- Some((nth, ..)) => RowAction::PreviewAt(f.id, nth),- None => RowAction::Preview(f.id),- };- // The card's own actions, in this order: expand (or, on a page, collapse), remove (the file,- // or the page), show large.- let mut buttons: Vec<(&str, String, RowAction)> = Vec::new();- if expandable {- buttons.push(("maximize-2", tl!("Expand").to_owned(), RowAction::Expand(f.id, true)));- }- if let Some((nth, ..)) = self.page {- buttons.push(("minimize-2", tl!("Collapse").to_owned(), RowAction::Expand(f.id, false)));- buttons.push(("trash-2", tl!("Remove page").to_owned(), RowAction::RemovePages(Some((f.id, nth)))));- } else {- buttons.push(("trash-2", crate::i18n::fmt(tl!("Remove {name}"), &[("name", &f.name)]), RowAction::RemoveFile(f.id)));- }- if previewable {- buttons.push(("search", tl!("Preview").to_owned(), preview));- }+ let buttons = self.card_buttons(f, expandable, previewable);// Nothing of the card shows over a dialog (the preview, the password box).let covered = ui.ctx().memory(|m| m.top_modal_layer().is_some());let mut over_bar = false;@@ -227,24 +172,7 @@ impl Card {}}- // The full name and everything known about the file, on hover (on a page card, which page).- let mut tip = match &page_label {- Some(page) => format!("{}\n{page}", f.name),- None => format!("{}\n{pages} · {}", f.name, crate::panels::human_size(f.bytes.len())),- };- for line in why.iter().map(|(_, _, s)| s).chain(&f.notes) {- tip.push('\n');- tip.push_str(line);- }- if self.twice {- tip.push('\n');- tip.push_str(tl!("Added more than once"));- }- // Page ranges are typed in the list.- if self.page.is_none() && self.check.is_err() {- tip.push('\n');- tip.push_str(tl!("Switch to List view to change the pages it takes."));- }+ let tip = self.tooltip(f, page_label.as_deref(), &pages, why.as_ref().map(|(_, _, reason)| reason.as_str()));// (Over the bar, its buttons say what they do instead.)let resp = if covered || over_bar { resp } else { resp.on_hover_text(tip) };@@ -279,6 +207,117 @@ impl Card {}action}++ /// The card's own actions, in this order: expand (or, on a page, collapse), remove (the file, or+ /// the page), show large.+ fn card_buttons(&self, f: &CombineFile, expandable: bool, previewable: bool) -> Vec<(&'static str, String, RowAction)> {+ // Shown large: the file from its first page, or a page card's page.+ let preview = match self.page {+ Some((nth, ..)) => RowAction::PreviewAt(f.id, nth),+ None => RowAction::Preview(f.id),+ };+ // The card's own actions, in this order: expand (or, on a page, collapse), remove (the file,+ // or the page), show large.+ let mut buttons: Vec<(&'static str, String, RowAction)> = Vec::new();+ if expandable {+ buttons.push(("maximize-2", tl!("Expand").to_owned(), RowAction::Expand(f.id, true)));+ }+ if let Some((nth, ..)) = self.page {+ buttons.push(("minimize-2", tl!("Collapse").to_owned(), RowAction::Expand(f.id, false)));+ buttons.push(("trash-2", tl!("Remove page").to_owned(), RowAction::RemovePages(Some((f.id, nth)))));+ } else {+ buttons.push(("trash-2", crate::i18n::fmt(tl!("Remove {name}"), &[("name", &f.name)]), RowAction::RemoveFile(f.id)));+ }+ if previewable {+ buttons.push(("search", tl!("Preview").to_owned(), preview));+ }+ buttons+ }++ /// The full name and everything known about the file, on hover (on a page card, which page).+ fn tooltip(&self, f: &CombineFile, page_label: Option<&str>, pages: &str, why: Option<&str>) -> String {+ let mut tip = match page_label {+ Some(page) => format!("{}\n{page}", f.name),+ None => format!("{}\n{pages} · {}", f.name, crate::panels::human_size(f.bytes.len())),+ };+ for line in why.into_iter().chain(f.notes.iter().map(String::as_str)) {+ tip.push('\n');+ tip.push_str(line);+ }+ if self.twice {+ tip.push('\n');+ tip.push_str(tl!("Added more than once"));+ }+ // Page ranges are typed in the list.+ if self.page.is_none() && self.check.is_err() {+ tip.push('\n');+ tip.push_str(tl!("Switch to List view to change the pages it takes."));+ }+ tip+ }++ /// What goes on the paper: the thumbnail, or why there isn't one (an icon, its colour and the reason).+ fn paper_content(+ &self,+ ui: &egui::Ui,+ painter: &egui::Painter,+ f: &CombineFile,+ thumbs: &mut Thumbs,+ page: Result<usize, String>,+ paper: Paper,+ ) -> Option<(&'static str, Color32, String)> {+ let mut why: Option<(&'static str, Color32, String)> = None;+ if let Some(lock) = f.lock {+ let text = match lock {+ Lock::Open => tl!("Password-protected"),+ Lock::Permissions => tl!("Its security settings don't allow copying pages"),+ };+ why = Some(("lock", ON_PAPER, text.to_owned()));+ } else if let Some(p) = &f.problem {+ why = Some(("circle-x", ERROR, p.clone()));+ } else {+ match page {+ Err(e) => why = Some(("circle-x", ERROR, e)),+ // The pages couldn't be counted, or the page's size is unknown (some passwords+ // open a file for combining but not for reading it here): nothing is drawn (the+ // engine decides at Combine), and the card says so rather than look blank.+ Ok(p) if p >= f.pages || !paper.known => why = Some(("eye-off", ON_PAPER, tl!("No preview").to_owned())),+ Ok(p) => {+ // Pixels per point: the size the paper is drawn at, on both sides, and never a+ // side longer than a thumbnail's (a long, thin page fits by its long side).+ let (w, h) = paper.size_pt;+ let scale = (paper.size.x * self.ppp / w).min(paper.size.y * self.ppp / h).min(MAX_SIDE / w.max(h));+ let px = [w * scale, h * scale].map(|v| (v.max(1.0).ceil() as u32).div_ceil(SIZE_STEP).saturating_mul(SIZE_STEP));+ let key = Key { source: Arc::as_ptr(&f.bytes) as usize, auth: f.auth, page: p, px };+ let look = thumbs.look((f.group, p), key);+ let mut want = false;+ match look {+ Look::Ready(tex) => {+ painter.image(tex, paper.rect, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);+ }+ Look::Failed(e) => why = Some(("triangle-alert", WARNING, crate::i18n::fmt(tl!("Preview unavailable: {e}"), &[("e", &e)]))),+ Look::Pending(stand_in) => {+ if let Some(tex) = stand_in {+ painter.image(tex, paper.rect, Rect::from_min_max(pos2(0.0, 0.0), pos2(1.0, 1.0)), Color32::WHITE);+ }+ want = true;+ }+ }+ if want && scale.is_finite() && scale > 0.0 {+ thumbs.wants.push(Want {+ slot: (f.group, p),+ key,+ bytes: f.bytes.clone(),+ password: f.password().map(Arc::from),+ scale,+ visible: ui.is_rect_visible(self.rect),+ });+ }+ }+ }+ }+ why+ }}/// The file a card's magnifier opened, shown large over the page: one of the pages it adds at adiff --git a/crates/ui-egui/src/workflows/combine_grid/thumbs.rs b/crates/ui-egui/src/workflows/combine_grid/thumbs.rsindex 5494cdc00..28c54b4be 100644--- a/crates/ui-egui/src/workflows/combine_grid/thumbs.rs+++ b/crates/ui-egui/src/workflows/combine_grid/thumbs.rs@@ -1,4 +1,4 @@-use super::*;+use super::{Arc, HashMap, RenderConfig, RenderPool, RenderRequest, Retiring, TextureHandle};/// Render threads for thumbnails at once, counting those of retired pools until they exit.pub(super) const MAX_THREADS: usize = 3;diff --git a/crates/ui-egui/src/workflows/combine_ui/actions.rs b/crates/ui-egui/src/workflows/combine_ui/actions.rsindex 1eee3f8d3..a4f80abdc 100644--- a/crates/ui-egui/src/workflows/combine_ui/actions.rs+++ b/crates/ui-egui/src/workflows/combine_ui/actions.rs@@ -1,7 +1,7 @@use super::files::{Preview, RowAction};use super::parts::{moved_pages, removed_pages, step_to};use super::view::expandable;-use super::*;+use super::{BTreeSet, PdfCraftApp};impl PdfCraftApp {pub(crate) fn combine_apply(&mut self, action: RowAction) {@@ -29,11 +29,38 @@ impl PdfCraftApp {a => a,};// Page edits work on the list as parts.+ let Some(action) = self.combine_page_action(action) else { return };+ // A file's card clicked (or the list's keys): the files are selected, no page.+ if matches!(action, RowAction::Click(..) | RowAction::SelectAll | RowAction::Step { .. }) {+ self.combine_tab.selected_pages.clear();+ }match action {- RowAction::ClickPage(id, nth, m) => return self.combine_click_page(id, nth, m),+ RowAction::Click(..) | RowAction::SelectAll | RowAction::Step { .. } | RowAction::Unlock(..) => self.combine_select_action(action),+ RowAction::MoveUp+ | RowAction::MoveDown+ | RowAction::Remove+ | RowAction::RemoveFile(_)+ | RowAction::Drop { .. }+ | RowAction::DropAt { .. }+ | RowAction::Sort(_) => {+ self.combine_order_action(action);+ }+ // (Page edits were done above.)+ RowAction::ClickPage(..) | RowAction::MovePages { .. } | RowAction::RemovePages(_) => {}+ _ => self.combine_preview_action(action),+ }+ }++ /// Page edits work on the list as parts. Returns the action back when it is not one.+ fn combine_page_action(&mut self, action: RowAction) -> Option<RowAction> {+ match action {+ RowAction::ClickPage(id, nth, m) => {+ self.combine_click_page(id, nth, m);+ return None;+ }RowAction::MovePages { page, revision, gap } => {if revision != self.combine_tab.revision {- return;+ return None;}let moving =if self.combine_tab.selected_pages.contains(&page) { self.combine_tab.selected_pages.clone() } else { BTreeSet::from([page]) };@@ -47,7 +74,7 @@ impl PdfCraftApp {if let Some(moved) = moved_pages(&parts, &moving, gap, &mut new_id) {self.combine_set_parts(moved);}- return;+ return None;}RowAction::RemovePages(one) => {let removing = match one {@@ -55,7 +82,7 @@ impl PdfCraftApp {None => self.combine_tab.selected_pages.clone(),};if removing.is_empty() {- return;+ return None;}let parts = self.combine_parts();let next = &mut self.combine_tab.next_id;@@ -68,14 +95,15 @@ impl PdfCraftApp {if let Some(left) = removed_pages(&parts, &removing, &mut new_id) {self.combine_set_parts(left);}- return;+ return None;}_ => {}}- // A file's card clicked (or the list's keys): the files are selected, no page.- if matches!(action, RowAction::Click(..) | RowAction::SelectAll | RowAction::Step { .. }) {- self.combine_tab.selected_pages.clear();- }+ Some(action)+ }++ /// Selecting files, and asking for the passwords of locked ones.+ fn combine_select_action(&mut self, action: RowAction) {let ids: Vec<u64> = self.combine_draft.iter().map(|f| f.id).collect();let n = ids.len();let index_of = |id: Option<u64>| id.and_then(|id| ids.iter().position(|x| *x == id));@@ -129,6 +157,31 @@ impl PdfCraftApp {tab.cursor = Some(id);tab.reveal = Some(id);}+ RowAction::Unlock(row, at) => {+ let locked: BTreeSet<u64> = self.combine_draft.iter().filter(|f| f.lock.is_some()).map(|f| f.id).collect();+ let rows: Vec<u64> = match row.and_then(|i| ids.get(i).copied()) {+ // A selected row brings the rest of the selection.+ Some(id) if tab.selected.contains(&id) => {+ ids.iter().copied().filter(|x| tab.selected.contains(x) && locked.contains(x)).collect()+ }+ Some(id) => {+ tab.selected = BTreeSet::from([id]);+ (tab.anchor, tab.cursor) = (Some(id), Some(id));+ vec![id]+ }+ None => ids.iter().copied().filter(|x| tab.selected.contains(x) && locked.contains(x)).collect(),+ };+ self.combine_ask_password(rows, at);+ }+ _ => {}+ }+ }++ /// Moving, removing, dropping and sorting files.+ fn combine_order_action(&mut self, action: RowAction) {+ let ids: Vec<u64> = self.combine_draft.iter().map(|f| f.id).collect();+ let tab = &mut self.combine_tab;+ match action {RowAction::MoveUp | RowAction::MoveDown => {let up = matches!(action, RowAction::MoveUp);let selected: Vec<bool> = ids.iter().map(|id| tab.selected.contains(id)).collect();@@ -181,6 +234,39 @@ impl PdfCraftApp {self.combine_tab.cursor = None;}}+ RowAction::Drop { from, to } => {+ let (Some(&dragged), Some(&target)) = (ids.get(from), ids.get(to)) else { return };+ // Dragging a selected file takes the whole selection along.+ let moving: BTreeSet<u64> = if tab.selected.contains(&dragged) { tab.selected.clone() } else { BTreeSet::from([dragged]) };+ // Dropped on the selection itself: nothing to do.+ if moving.contains(&target) {+ return;+ }+ // Below the row when dragged down, above it when dragged up.+ self.combine_move_to_gap(moving, if from < to { to + 1 } else { to });+ }+ RowAction::DropAt { file, revision, gap } => {+ // The list changed under the drag (e.g. undo): the gap no longer means the same.+ if revision != tab.revision || !ids.contains(&file) {+ return;+ }+ let moving: BTreeSet<u64> = if tab.selected.contains(&file) { tab.selected.clone() } else { BTreeSet::from([file]) };+ self.combine_move_to_gap(moving, gap);+ }+ RowAction::Sort(key) => {+ let ascending = !matches!(tab.sort, Some((k, true)) if k == key);+ self.combine_record();+ self.combine_sort(key, ascending);+ }+ _ => {}+ }+ }++ /// Previewing and expanding files.+ fn combine_preview_action(&mut self, action: RowAction) {+ let ids: Vec<u64> = self.combine_draft.iter().map(|f| f.id).collect();+ let tab = &mut self.combine_tab;+ match action {RowAction::Preview(id) => {if ids.contains(&id) {self.combine_tab.preview = Some(Preview { file: id, at: 0, page: None, pages: None });@@ -228,48 +314,7 @@ impl PdfCraftApp {self.combine_tab.preview = Some(Preview { file: id, at, page: None, pages: None });}}- // (Page edits were done above.)- RowAction::ClickPage(..) | RowAction::MovePages { .. } | RowAction::RemovePages(_) => {}- RowAction::Drop { from, to } => {- let (Some(&dragged), Some(&target)) = (ids.get(from), ids.get(to)) else { return };- // Dragging a selected file takes the whole selection along.- let moving: BTreeSet<u64> = if tab.selected.contains(&dragged) { tab.selected.clone() } else { BTreeSet::from([dragged]) };- // Dropped on the selection itself: nothing to do.- if moving.contains(&target) {- return;- }- // Below the row when dragged down, above it when dragged up.- self.combine_move_to_gap(moving, if from < to { to + 1 } else { to });- }- RowAction::DropAt { file, revision, gap } => {- // The list changed under the drag (e.g. undo): the gap no longer means the same.- if revision != tab.revision || !ids.contains(&file) {- return;- }- let moving: BTreeSet<u64> = if tab.selected.contains(&file) { tab.selected.clone() } else { BTreeSet::from([file]) };- self.combine_move_to_gap(moving, gap);- }- RowAction::Unlock(row, at) => {- let locked: BTreeSet<u64> = self.combine_draft.iter().filter(|f| f.lock.is_some()).map(|f| f.id).collect();- let rows: Vec<u64> = match row.and_then(|i| ids.get(i).copied()) {- // A selected row brings the rest of the selection.- Some(id) if tab.selected.contains(&id) => {- ids.iter().copied().filter(|x| tab.selected.contains(x) && locked.contains(x)).collect()- }- Some(id) => {- tab.selected = BTreeSet::from([id]);- (tab.anchor, tab.cursor) = (Some(id), Some(id));- vec![id]- }- None => ids.iter().copied().filter(|x| tab.selected.contains(x) && locked.contains(x)).collect(),- };- self.combine_ask_password(rows, at);- }- RowAction::Sort(key) => {- let ascending = !matches!(tab.sort, Some((k, true)) if k == key);- self.combine_record();- self.combine_sort(key, ascending);- }+ _ => {}}}}diff --git a/crates/ui-egui/src/workflows/combine_ui/files.rs b/crates/ui-egui/src/workflows/combine_ui/files.rsindex fdfa41dea..4947e4f8b 100644--- a/crates/ui-egui/src/workflows/combine_ui/files.rs+++ b/crates/ui-egui/src/workflows/combine_ui/files.rs@@ -1,4 +1,4 @@-use super::*;+use super::{Arc, BTreeSet, Modifiers, SourceProblem, SystemTime};/// A column of the list: what it shows and what it sorts by.#[derive(Clone, Copy, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]diff --git a/crates/ui-egui/src/workflows/combine_ui/parts.rs b/crates/ui-egui/src/workflows/combine_ui/parts.rsindex 74c668382..7de66b074 100644--- a/crates/ui-egui/src/workflows/combine_ui/parts.rs+++ b/crates/ui-egui/src/workflows/combine_ui/parts.rs@@ -1,4 +1,4 @@-use super::*;+use super::{BTreeSet, MAX_FOLDER_DEPTH, MAX_FOLDER_FILES, Ordering, SystemTime};/// The PDFs, images and text files in `dir` (and, if `recursive`, the folders inside it, not/// following links), in natural order, at most [`MAX_FOLDER_FILES`]; and whether there were more.diff --git a/crates/ui-egui/src/workflows/combine_ui/session.rs b/crates/ui-egui/src/workflows/combine_ui/session.rsindex c18b64e0e..ad8d2a402 100644--- a/crates/ui-egui/src/workflows/combine_ui/session.rs+++ b/crates/ui-egui/src/workflows/combine_ui/session.rs@@ -2,7 +2,7 @@ use super::files::{AssessError, Assessed, CombineFile, Incoming, Secret, Snapsho#[cfg(not(target_arch = "wasm32"))]use super::parts::combinable_in;use super::parts::{Part, items_of, moved_order, natural, parts_of, range_of, title_of};-use super::*;+use super::{Arc, BTreeSet, CombineTab, HISTORY, MAX_FOLDER_FILES, Modifiers, PdfCraftApp};impl PdfCraftApp {/// Show the Combine files tab (File ▸ Combine files…), opening it if needed.diff --git a/crates/ui-egui/src/workflows/combine_ui/table.rs b/crates/ui-egui/src/workflows/combine_ui/table.rsindex 3a95e8706..86015db39 100644--- a/crates/ui-egui/src/workflows/combine_ui/table.rs+++ b/crates/ui-egui/src/workflows/combine_ui/table.rs@@ -1,6 +1,9 @@use super::files::{Columns, Lock, RowAction, SortKey};use super::parts::{ago, utc_stamp};-use super::*;+use super::{+ Align, Color32, Column, CornerRadius, ERROR, Layout, Modifiers, PdfCraftApp, Rect, Sense, Stroke, TableBuilder, Tokens, WARNING, icons, theme,+ vec2,+};/// A column heading being dragged to a new place.#[derive(Clone, Copy)]diff --git a/crates/ui-egui/src/workflows/combine_ui/view.rs b/crates/ui-egui/src/workflows/combine_ui/view.rsindex 1e2033230..4e1d0c610 100644--- a/crates/ui-egui/src/workflows/combine_ui/view.rs+++ b/crates/ui-egui/src/workflows/combine_ui/view.rs@@ -1,6 +1,6 @@use super::files::{CombineFile, CombineView, Lock, RowAction};use super::table::{TableEvents, table};-use super::*;+use super::{Align, BTreeSet, CornerRadius, ERROR, Layout, Modifiers, PdfCraftApp, Rect, Stroke, Tokens, icons, theme, vec2, widgets};/// The Combine files page.pub(crate) fn page(app: &mut PdfCraftApp, ui: &mut egui::Ui) {diff --git a/crates/ui-egui/src/workflows/print_ui/body.rs b/crates/ui-egui/src/workflows/print_ui/body.rsindex 524382039..d5cdbf16e 100644--- a/crates/ui-egui/src/workflows/print_ui/body.rs+++ b/crates/ui-egui/src/workflows/print_ui/body.rs@@ -1,5 +1,8 @@use super::draft::{Handling, PrintDraft, Which};-use super::*;+use super::{+ Binding, BookletSubset, Color32, Content, Orientation, PAPERS, PREVIEW_BOX, PREVIEW_H, PREVIEW_W, PageOrder, Pos2, Rect, SizeMode, Stroke,+ Subset, Tokens, pos2, print, printer_label, spool, still_looking, theme, vec2, widgets,+};/// Properties… on CUPS: the driver's options for this print, grouped as the driver groups them./// Only choices away from the printer's defaults are kept, and sent with the job.diff --git a/crates/ui-egui/src/workflows/print_ui/draft.rs b/crates/ui-egui/src/workflows/print_ui/draft.rsindex 1609262ab..be2a22efb 100644--- a/crates/ui-egui/src/workflows/print_ui/draft.rs+++ b/crates/ui-egui/src/workflows/print_ui/draft.rs@@ -1,4 +1,4 @@-use super::*;+use super::{Binding, BookletSubset, Content, Layout, Orientation, PAPERS, PageOrder, SizeMode, Subset, print, spool};#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum Which {