Print is off where it is not built; no blocked command runs from the palette (D-08)
This commit is contained in:
5 files changed
+81
-14
No files matched your search
@@ -2,6 +2,9 @@
|
||||
|
||||
use std::path::Path;
|
||||
|
||||
/// This build has a system print panel.
|
||||
pub const BUILT: bool = cfg!(target_os = "macos");
|
||||
|
||||
/// Shows the print panel for `pdf`; false when cancelled.
|
||||
#[cfg(target_os = "macos")]
|
||||
pub fn print_pdf(pdf: &Path) -> anyhow::Result<bool> {
|
||||
@@ -85,8 +88,8 @@ fn paper_for(sizes: &[(f64, f64)]) -> Option<(f64, f64)> {
|
||||
|
||||
/// Printing needs a system panel this platform build lacks.
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
pub fn print_pdf(pdf: &Path) -> anyhow::Result<bool> {
|
||||
anyhow::bail!("printing {} is not built on this platform", pdf.display())
|
||||
pub fn print_pdf(_: &Path) -> anyhow::Result<bool> {
|
||||
anyhow::bail!("printing is not built on this platform")
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in new issue
Block a user