mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Merge branch 'pr-14321' into pr-14381
# Conflicts: # crates/engine/src/cmd/artboard_cmds.rs
This commit is contained in:
commit
ce61a98e1c
3 files changed
+19
-10
No files matched your search
@@ -16,7 +16,7 @@ use photocraft_raster::Surface;
|
||||
use serde_json::{Value, json};
|
||||
|
||||
use crate::commands::{CommandSpec, color_param, int, int_i32, parse_hex};
|
||||
use crate::file_cmds::{SaveOpts, encode, f64_param, join, native_doc, sanitize, stem, str_param, write_file};
|
||||
use crate::file_cmds::{encode, f64_param, join, native_doc, sanitize, stem, str_param, write_file};
|
||||
use crate::{EngineError, Result, Session};
|
||||
|
||||
/// Artboard size presets (name, width, height) in pixels, Photoshop's common devices and pages.
|
||||
@@ -1071,7 +1071,9 @@ fn artboards_to_files(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
Some(_) if truecolour && one.mode != ColorMode::Rgb => encode(&rgb_copy(&one)?, &path, save)?,
|
||||
Some(_) => encode(&one, &path, save)?,
|
||||
// The PNG-8 writer does not interlace; say so, as the palette PNG path of a save does.
|
||||
None if save.png_interlaced == Some(true) => (png8(&one, cmd)?, vec!["written without interlacing: the PNG-8 exporter does not interlace".to_owned()]),
|
||||
None if save.png_interlaced == Some(true) => {
|
||||
(png8(&one, cmd)?, vec!["written without interlacing: the PNG-8 exporter does not interlace".to_owned()])
|
||||
}
|
||||
None => (png8(&one, cmd)?, Vec::new()),
|
||||
};
|
||||
guard.check()?;
|
||||
@@ -1286,7 +1288,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"file.export.artboardsToPdf",
|
||||
"Artboards to PDF…",
|
||||
&["File", "Export"],
|
||||
r##"{"path":str (.pdf),"content":"overlapping|artboard"="overlapping" (Include Overlapping Areas: a board's page also shows the visible boards above it where they overlap it; artboard: Artboard Content Only),"artboards":[id]?,"quality":0..12=10,"reversePageOrder":bool=false (the default page order the other way round)} → {path, pages} (one raster page per board, bottom artboard of the Layers panel first)"##,
|
||||
r##"{"path":str (.pdf),"content":"overlapping|artboard"="overlapping" (Include Overlapping Areas: a board's page also shows the visible boards above it where they overlap it; artboard: Artboard Content Only),"artboards":[id]?,"quality":0..12=10,"reversePageOrder":bool=false (the default page order the other way round)} → {path, pages} (one raster page per board, bottom artboard of the Layers panel first)"##,
|
||||
export_artboards,
|
||||
artboards_to_pdf
|
||||
),
|
||||
@@ -1309,11 +1311,11 @@ mod file_types_tests;
|
||||
#[path = "artboard_cmds/first_board_background_tests.rs"]
|
||||
mod first_board_background_tests;
|
||||
#[cfg(test)]
|
||||
#[path = "artboard_cmds/include_name_tests.rs"]
|
||||
mod include_name_tests;
|
||||
#[cfg(test)]
|
||||
#[path = "artboard_cmds/from_group_reset_props_tests.rs"]
|
||||
mod from_group_reset_props_tests;
|
||||
#[cfg(test)]
|
||||
#[path = "artboard_cmds/include_name_tests.rs"]
|
||||
mod include_name_tests;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "artboard_cmds/from_layers_history_name_tests.rs"]
|
||||
|
||||
@@ -35,6 +35,8 @@ fn open(h: &mut H, path: &str) -> DialogId {
|
||||
let dialog = h.state().framework.dialogs.open_dialogs().into_iter().map(|d| d.id).find(|d| d.value().to_string() == want).unwrap();
|
||||
h.run_steps(4);
|
||||
h.state_mut().framework.dialogs.set_json_field(&ctx, dialog, "path", json!(path)).unwrap();
|
||||
// Every board, not only the selected one: Export Selected Artboards opens ticked while a board is selected (#13647).
|
||||
h.state_mut().framework.dialogs.set_json_field(&ctx, dialog, "artboards", serde_json::Value::Null).unwrap();
|
||||
h.run_steps(4);
|
||||
dialog
|
||||
}
|
||||
|
||||
@@ -322,10 +322,15 @@ pub(super) fn params_for(app: &mut PhotocraftApp, id: &str) -> Option<(Vec<Param
|
||||
// The reference application's list, PSD chosen when the dialog opens (#13635).
|
||||
choice("format", tl!("File Type"), artboard_formats(), "psd"),
|
||||
];
|
||||
// Export Options and each file type's settings (#13636); the JPEG quality is one of them.
|
||||
rows.extend(artboard_export_options::rows());
|
||||
// Include Artboard Name and its Name Options (#13637).
|
||||
rows.extend(artboard_name_options::rows(&crate::type_tool::families()));
|
||||
// Export Options and each file type's settings (#13636; the JPEG quality is one of them), then Include Artboard
|
||||
// Name and its Name Options (#13637). A section's body runs to the next section and hides with it, so both
|
||||
// checkboxes come before the Options section: after it, Include Artboard Name would show only with Export Options.
|
||||
let mut export = artboard_export_options::rows().into_iter();
|
||||
let mut name = artboard_name_options::rows(&crate::type_tool::families()).into_iter();
|
||||
rows.extend(export.next());
|
||||
rows.extend(name.next());
|
||||
rows.extend(export);
|
||||
rows.extend(name);
|
||||
plain(rows)
|
||||
}
|
||||
"file.export.artboardsToPdf" => {
|
||||
|
||||
Reference in new issue
Block a user