Skip to content

PdfCraft: An open-source PDF reader and editor written by scratch in pure Rust

M5: Make Properties Default in Comment Properties (#2031)

DCM4711e08f87f13854
diff --git a/ATTRIBUTION.toml b/ATTRIBUTION.toml
index 072de00c9..018360c26 100644
--- a/ATTRIBUTION.toml
+++ b/ATTRIBUTION.toml
@@ -7,7 +7,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Greek UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "119708b98e105edcd2889739099ea3517d7bbee83c481f41f92274b32c005614"
+sha256 = "393902c1a2e21346b5a328a1a8792bfc361cb0872a465901209e36d78ca45b79"
# ATTRIBUTION.toml: one entry per asset (AGENTS.md §1). The source of truth for provenance and licences.
# ATTRIBUTION.md is generated from this file: `cargo xtask assets --write`. Checked by `cargo xtask assets` (part of `xtask ci`).
@@ -30,7 +30,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Simplified Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "ae66a6f5a12265e3721dc72b9463f7508191e3a38bd2580079e26c9909adab54"
+sha256 = "d90200f734b322b9987cae89a1e6e7d98c10fd7071047d9d6538d3e58e0312db"
[[asset]]
path = "crates/ui-egui/src/i18n/zh-hant.tsv"
@@ -41,7 +41,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Traditional Chinese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "003d784c749c1134d31ff287c107818e8676ee6317531d513580249c4f22f6a6"
+sha256 = "3b24582f96c26d91afb592a787c20115e5adeacf5672cf2d3fe265ec25e012bf"
[[asset]]
path = "crates/ui-egui/src/i18n/cs.tsv"
@@ -52,7 +52,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Czech UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "d864ced685fb6796af01ba286b8ef8987a763c811e18a6cdc6b056c7aeef90dc"
+sha256 = "d3cd4e5358351adb254f4969a3c2d579c43a9b1c140ee2501a28bf09bd63b677"
[[asset]]
path = "crates/ui-egui/src/i18n/pt-br.tsv"
@@ -63,7 +63,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Brazilian Portuguese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "fe2cb9a64b0a484015919a7dd792367157df813451ad6d0a94cd958f1e020855"
+sha256 = "74c82a97934c5423d1fe6c56a4cc23ed821bb1abacfff258c2a64414aa13fb29"
[[asset]]
path = "crates/ui-egui/src/i18n/es.tsv"
@@ -74,7 +74,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Spanish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "249bc15bf1dc579a6f90dcd895b0f6b50f44af4fc46ea99e5b00bfff08434269"
+sha256 = "46e7ca20f0a6851c77fa73f3d9401ea9e9141f592d03be906328342924907310"
[[asset]]
path = "crates/ui-egui/src/i18n/fr.tsv"
@@ -85,7 +85,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "French UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "d94c9effca419f721ab2c6c40018e5f0d6b51f744cc915c924b97442b17eb6e9"
+sha256 = "5f51fd699f88c01828ce6386ac92814a16c32a1815ad3b2fb745e231376a6db2"
[[asset]]
path = "crates/ui-egui/src/i18n/de.tsv"
@@ -96,7 +96,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "German UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "63d36be7c0df64eeb7dc0ff62923d41fa7fa337fc5e442e67b1ee141a1c5e382"
+sha256 = "3a840c78fcf5ea19d0e683c78874ebc4ed46025595c84eb12cea4713f7d986d3"
[[asset]]
path = "crates/ui-egui/src/i18n/te.tsv"
@@ -107,7 +107,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Telugu UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "ec20cf580a10a1c8d6d5a70fd94a364cc4d2bacfc5230555967db272ccd9b22d"
+sha256 = "9e7866f38b811211b5b145052c11018c26d0e0d6b3e5edad93a9c2d7fba008a7"
[[asset]]
path = "crates/ui-egui/src/i18n/it.tsv"
@@ -118,7 +118,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Italian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "8c8486b06c8e77497ff1589c42566b9350c7a0a0f378c6762a65b80f34b81841"
+sha256 = "0d46bc90f3fd0faef2542b5958ddb931cfae56bca5b9ce6e69e805dfee50505a"
[[asset]]
path = "crates/ui-egui/src/i18n/pl.tsv"
@@ -129,7 +129,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Polish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "6aee8779c09c9b5b24a001d4a8f14d181a62a868db81920aa4614a15ca3f21ed"
+sha256 = "bfa4d801835202166874f717d9bda7c14731570bdc63b3e4c58f5dc93be02998"
[[asset]]
path = "crates/ui-egui/src/i18n/ru.tsv"
@@ -140,7 +140,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Russian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "35ad5905515e25b7dd4b31320f58bf54481e2c6b868e3e0a3ad1090558675ce3"
+sha256 = "24092581310895dca1f6ed2d88f582749cc776aedb13ae7d5d4dafd67efc1bad"
[[asset]]
path = "crates/ui-egui/src/i18n/hu.tsv"
@@ -151,7 +151,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Hungarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "369603fb7ff64bd576de6dad7077b41794f933bf2633fcd313674e2aa9dbf989"
+sha256 = "6fb3b98133d9af06d27dce35a1c0f370c6d16702b82598ffaa2909b05e9e9be4"
[[asset]]
path = "crates/ui-egui/src/i18n/bg.tsv"
@@ -162,7 +162,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Bulgarian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "6031098e20e488163969e4f403105a095581fd71b53dd16f063ecb71f93aba00"
+sha256 = "784f6dd4534dc842fd18e0c0af790af92e5caf32732d0ef85f88a094f0591a48"
[[asset]]
path = "crates/ui-egui/src/i18n/kk.tsv"
@@ -173,7 +173,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Kazakh UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "61d6bde7f2e3aac19449fe8b980d42d4b8a65536cac23ebae1553f81a1bb0372"
+sha256 = "2fd1b542c391537423a5b36a0617886fc4ca8abc8aa595cc4bd700eb5600760f"
[[asset]]
path = "crates/ui-egui/src/i18n/ja.tsv"
@@ -184,7 +184,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Japanese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "12003f40f6ce0bda46c7ead8de8e9c054e4ea605ce93d7fe0833e9e99d293bf9"
+sha256 = "9c3ae4e8692e9715f6a1cfb5eb0e7ef02d03d222833ca9cf11e286f222e8f024"
[[asset]]
path = "crates/ui-egui/src/i18n/uk.tsv"
@@ -195,7 +195,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Ukrainian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "f52e62e7bf4a2c78a21919bed90c81c9feb65feac1a615142f9f6d9f429fde54"
+sha256 = "6a44916924fd9fed55e97e9e9aed10299bd1c2cdd3213530afc328fcc3382b8a"
[[asset]]
path = "crates/ui-egui/src/i18n/ar.tsv"
@@ -206,7 +206,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Arabic UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "5292e88884e380090d191597e254f1f135e1a569d4336432ae5bb2a0b5233d11"
+sha256 = "623bf25e7f0dc783e497d2744ac7fa17437ef3cc9c65a25b91c82321700ae037"
[[asset]]
path = "crates/ui-egui/src/i18n/tr.tsv"
@@ -217,7 +217,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Turkish UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "138d6e18c5581205b61ca647eedca8ddc65f6eaed9ed8f6cad6e4fa788f31ddf"
+sha256 = "73b8af9831358bc6ea9124fd7a05b725cf80c89709348ac07680646bf11378d7"
[[asset]]
path = "crates/ui-egui/src/i18n/lt.tsv"
@@ -228,7 +228,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Lithuanian UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "fdc8591ecf8e4805c8bafef88810185676177a85bced0a47d4cc7c065e634267"
+sha256 = "b9edcc284143606785999408fb3c2e6ed61bd9d973225b6a37fdbbfbd226093f"
[[asset]]
@@ -240,7 +240,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Vietnamese UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "f9b0694f684bea95e20bd33bef33fedfd92e28c62f2c140193c89e0ed7a18b97"
+sha256 = "8f4d695f2a20a0a8470181c343b2a832d7cd05a7645aa07fe5e4a94299a84b82"
[[asset]]
path = "assets/icons/accessibility.svg"
@@ -3363,7 +3363,7 @@ licence = "MIT OR Apache-2.0"
licence_file = "LICENSE-MIT"
kind = "translation"
usage = "Slovene UI strings, compiled in by crates/ui-egui/src/i18n/mod.rs"
-sha256 = "af96cf439b9ea1c7e1d9177f909a14d2c0513572b6a579a5350d272fb70c53b2"
+sha256 = "d5b66bf35341a9ce1d66204a99cfc5679c66c26f7afb0bb394d87335783d229d"
[[asset]]
path = "vendor/vello_common/assets/probe.png"
diff --git a/crates/ui-egui/src/comment_props.rs b/crates/ui-egui/src/comment_props.rs
index 093aa592e..052fcd55f 100644
--- a/crates/ui-egui/src/comment_props.rs
+++ b/crates/ui-egui/src/comment_props.rs
@@ -23,6 +23,9 @@ pub struct PropsDraft {
pub tab: PropsTab,
pub original: CommentProps,
pub edited: CommentProps,
+ /// Acrobat's Make Properties Default box: on OK, new comments of this kind take the edited
+ /// colour, opacity and line width too.
+ pub make_default: bool,
}
const ICONS: [NoteIcon; 7] =
@@ -87,23 +90,31 @@ impl PdfCraftApp {
/// Make Current Properties Default: new comments of this kind take this one's colour,
/// opacity and line width.
pub fn make_comment_default(&mut self, page: usize, index: usize) {
+ let Some(p) = self.active_ids().and_then(|(_, id)| self.session.get(id)).and_then(|doc| doc.comment_props(page, index)) else { return };
+ self.make_props_default(page, index, &p);
+ }
+
+ /// New comments of the kind at `(page, index)` take the look in `p`: its colour, opacity,
+ /// line width and (for shapes) fill. `p` may be a Comment Properties draft not applied yet.
+ pub fn make_props_default(&mut self, page: usize, index: usize, p: &CommentProps) {
let Some((_, id)) = self.active_ids() else { return };
let Some(doc) = self.session.get(id) else { return };
let Some(a) = doc.info.annotations.iter().find(|a| a.page == page && a.index == index && a.in_reply_to.is_none()) else { return };
- let Some(p) = doc.comment_props(page, index) else { return };
let Some(tool) = crate::comments::tool_for_default(a, p.endings.as_deref()) else { return };
let mut style = self.comment_prefs.style(tool);
if let Some(c) = p.color {
style.color = c;
}
- style.opacity = p.opacity;
- if let Some(w) = p.width {
- style.width = w;
- }
if p.fillable && tool.has_fill() {
style.fill = p.fill;
}
self.comment_prefs.set_style(tool, style);
+ // Opacity and width go through the clamping setters: the dialog allows 0% opacity, and a
+ // default that draws invisible comments can't be found again.
+ self.comment_prefs.set_opacity(tool, p.opacity);
+ if let Some(w) = p.width {
+ self.comment_prefs.set_width(tool, w);
+ }
self.notify_fmt("New {tool} comments will look like this one", &[("tool", &crate::i18n::in_sentence(tl!(tool.label())))]);
}
@@ -111,7 +122,7 @@ impl PdfCraftApp {
pub fn open_comment_props(&mut self, page: usize, index: usize) {
let Some((_, id)) = self.active_ids() else { return };
let Some(p) = self.session.get(id).and_then(|d| d.comment_props(page, index)) else { return };
- self.comment_props = Some(PropsDraft { page, index, tab: PropsTab::Appearance, original: p.clone(), edited: p });
+ self.comment_props = Some(PropsDraft { page, index, tab: PropsTab::Appearance, original: p.clone(), edited: p, make_default: false });
self.dialog = Some(crate::Dialog::CommentProps);
}
}
@@ -168,6 +179,12 @@ pub(crate) fn body(ui: &mut egui::Ui, app: &mut PdfCraftApp, t: &Tokens) -> (boo
.collect()
})
.unwrap_or_default();
+ let default_tool = app.comment_props.as_ref().and_then(|d| {
+ let (_, id) = app.active_ids()?;
+ let doc = app.session.get(id)?;
+ let a = doc.info.annotations.iter().find(|a| a.page == d.page && a.index == d.index && a.in_reply_to.is_none())?;
+ crate::comments::tool_for_default(a, d.edited.endings.as_deref())
+ });
let Some(d) = app.comment_props.as_mut() else { return (false, true) };
let kind = tl!(crate::comments_panel::subtype_label(&d.edited.subtype)).to_string();
ui.label(egui::RichText::new(crate::i18n::fmt(tl!("{kind} Properties"), &[("kind", &kind)])).font(theme::semibold(18.0)));
@@ -270,7 +287,13 @@ pub(crate) fn body(ui: &mut egui::Ui, app: &mut PdfCraftApp, t: &Tokens) -> (boo
}
}
ui.add_space(12.0);
- ui.add(widgets::checkbox(&mut d.edited.locked, tl!("Locked")));
+ ui.horizontal(|ui| {
+ ui.add(widgets::checkbox(&mut d.edited.locked, tl!("Locked")));
+ ui.add_space(16.0);
+ // Acrobat's box beside Locked. Only a comment whose look can change, made by a tool.
+ let defaultable = d.edited.restylable && default_tool.is_some();
+ ui.add_enabled(defaultable, widgets::checkbox(&mut d.make_default, tl!("Make Properties Default")));
+ });
let (mut apply, mut cancel) = (false, false);
ui.with_layout(Layout::right_to_left(Align::Center), |ui| {
if widgets::pill_button(ui, tl!("OK"), true).clicked() {
diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs
index d5fe7df1a..cdd75d125 100644
--- a/crates/ui-egui/src/dialogs.rs
+++ b/crates/ui-egui/src/dialogs.rs
@@ -1339,6 +1339,10 @@ fn dialogs(app: &mut PdfCraftApp, ctx: &egui::Context) {
app.apply_edit(Edit::Batch { label: "Change comment properties".into(), edits });
}
}
+ // Make Properties Default: the look chosen here, even when it was already the comment's.
+ if d.make_default && d.edited.restylable {
+ app.make_props_default(d.page, d.index, &d.edited);
+ }
}
if export_now && let Dialog::Export(kind) = dialog {
app.start_export(kind);
diff --git a/crates/ui-egui/src/i18n/ar.tsv b/crates/ui-egui/src/i18n/ar.tsv
index 4326a5cf6..ade022757 100644
--- a/crates/ui-egui/src/i18n/ar.tsv
+++ b/crates/ui-egui/src/i18n/ar.tsv
@@ -1295,6 +1295,7 @@
Copy text نسخ النص
Properties… خصائص…
Make Current Properties Default جعل الخصائص الحالية افتراضية
+ Make Properties Default جعل الخصائص افتراضية
More options خيارات أخرى
Sort by فرز حسب
Author المؤلف
diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv
index dd021c56a..d6a90dbc0 100644
--- a/crates/ui-egui/src/i18n/bg.tsv
+++ b/crates/ui-egui/src/i18n/bg.tsv
@@ -1236,6 +1236,7 @@
Copy text Копирай текста
Properties… Свойства…
Make Current Properties Default Направи текущите свойства подразбиращи се
+ Make Properties Default Направи свойствата подразбиращи се
More options Още опции
Sort by Сортиране по
Author Автор
diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv
index ae2c19022..6a25ae06b 100644
--- a/crates/ui-egui/src/i18n/cs.tsv
+++ b/crates/ui-egui/src/i18n/cs.tsv
@@ -1363,6 +1363,7 @@ key Space Mezerník
Copy text Kopírovat text
Properties… Vlastnosti…
Make Current Properties Default Nastavit aktuální vlastnosti jako výchozí
+ Make Properties Default Nastavit vlastnosti jako výchozí
More options Další možnosti
Sort by Seřadit podle
Author Autor
diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv
index d1024fa64..8c1909098 100644
--- a/crates/ui-egui/src/i18n/de.tsv
+++ b/crates/ui-egui/src/i18n/de.tsv
@@ -1281,6 +1281,7 @@
Copy text Text kopieren
Properties… Eigenschaften…
Make Current Properties Default Als Standard festlegen
+ Make Properties Default Eigenschaften als Standard festlegen
More options Weitere Optionen
Sort by Sortieren nach
Author Verfasser
diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv
index 07400e483..086743339 100644
--- a/crates/ui-egui/src/i18n/el.tsv
+++ b/crates/ui-egui/src/i18n/el.tsv
@@ -852,6 +852,7 @@
Set status Ορισμός κατάστασης
Properties… Ιδιότητες…
Make Current Properties Default Ορισμός τρεχουσών ιδιοτήτων ως προεπιλογών
+ Make Properties Default Ορισμός ιδιοτήτων ως προεπιλογών
Colour Χρώμα
Show all comments Εμφάνιση όλων των σχολίων
Create PDF comment summary… Δημιουργία σύνοψης σχολίων σε PDF…
diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv
index 70a06e1f8..d83102bb4 100644
--- a/crates/ui-egui/src/i18n/es.tsv
+++ b/crates/ui-egui/src/i18n/es.tsv
@@ -1290,6 +1290,7 @@
Copy text Copiar texto
Properties… Propiedades…
Make Current Properties Default Usar las propiedades actuales como predeterminadas
+ Make Properties Default Usar las propiedades como predeterminadas
More options Más opciones
Sort by Ordenar por
Author Autor
diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv
index 322da37ff..f9cf0e2e9 100644
--- a/crates/ui-egui/src/i18n/fr.tsv
+++ b/crates/ui-egui/src/i18n/fr.tsv
@@ -1276,6 +1276,7 @@
Copy text Copier le texte
Properties… Propriétés…
Make Current Properties Default Utiliser les propriétés actuelles par défaut
+ Make Properties Default Utiliser ces propriétés par défaut
More options Plus d'options
Sort by Trier par
Author Auteur
diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv
index d16a9f788..13cf3e66a 100644
--- a/crates/ui-egui/src/i18n/hu.tsv
+++ b/crates/ui-egui/src/i18n/hu.tsv
@@ -1266,6 +1266,7 @@
Copy text Szöveg másolása
Properties… Tulajdonságok…
Make Current Properties Default A jelenlegi tulajdonságok legyenek az alapértelmezettek
+ Make Properties Default A tulajdonságok legyenek az alapértelmezettek
More options További beállítások
Sort by Rendezés szempontja
Author Szerző
diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv
index 88bd62077..5e416be94 100644
--- a/crates/ui-egui/src/i18n/it.tsv
+++ b/crates/ui-egui/src/i18n/it.tsv
@@ -1291,6 +1291,7 @@
Copy text Copia testo
Properties… Proprietà…
Make Current Properties Default Imposta le proprietà correnti come predefinite
+ Make Properties Default Imposta le proprietà come predefinite
More options Altre opzioni
Sort by Ordina per
Author Autore
diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv
index 4c8500940..d48b00a12 100644
--- a/crates/ui-egui/src/i18n/ja.tsv
+++ b/crates/ui-egui/src/i18n/ja.tsv
@@ -1296,6 +1296,7 @@
Copy text テキストをコピー
Properties… プロパティ…
Make Current Properties Default 現在のプロパティを既定にする
+ Make Properties Default プロパティを既定にする
More options 詳細オプション
Sort by 並べ替え
Author 作成者
diff --git a/crates/ui-egui/src/i18n/kk.tsv b/crates/ui-egui/src/i18n/kk.tsv
index 5a5d85c54..893fcf366 100644
--- a/crates/ui-egui/src/i18n/kk.tsv
+++ b/crates/ui-egui/src/i18n/kk.tsv
@@ -1239,6 +1239,7 @@
Copy text Мәтінді көшіру
Properties… Сипаттар…
Make Current Properties Default Ағымдағы сипаттарды әдепкі етіп орнату
+ Make Properties Default Сипаттарды әдепкі етіп орнату
More options Қосымша параметрлер
Sort by Бойынша сұрыптау
Author Автор
diff --git a/crates/ui-egui/src/i18n/lt.tsv b/crates/ui-egui/src/i18n/lt.tsv
index 887de283a..92feb2504 100644
--- a/crates/ui-egui/src/i18n/lt.tsv
+++ b/crates/ui-egui/src/i18n/lt.tsv
@@ -710,6 +710,7 @@
Low resolution Maža raiška
Magnification Didinimas
Make Current Properties Default Dabartines savybes nustatyti kaip numatytąsias
+ Make Properties Default Savybes nustatyti kaip numatytąsias
Margins Paraštės
Mark Page Range Pažymėti puslapių intervalą
Mark as comments Pažymėti kaip komentarus
diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv
index ab017e7f2..3606c934e 100644
--- a/crates/ui-egui/src/i18n/pl.tsv
+++ b/crates/ui-egui/src/i18n/pl.tsv
@@ -1279,6 +1279,7 @@
Copy text Kopiuj tekst
Properties… Właściwości…
Make Current Properties Default Ustaw bieżące właściwości jako domyślne
+ Make Properties Default Ustaw właściwości jako domyślne
More options Więcej opcji
Sort by Sortuj według
Author Autor
diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv
index 15bc496af..567cb629e 100644
--- a/crates/ui-egui/src/i18n/pt-br.tsv
+++ b/crates/ui-egui/src/i18n/pt-br.tsv
@@ -1180,6 +1180,7 @@
Copy text Copiar texto
Properties… Propriedades…
Make Current Properties Default Tornar as propriedades atuais padrão
+ Make Properties Default Tornar as propriedades padrão
More options Mais opções
Sort by Classificar por
Author Autor
diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv
index dcce4bf0c..33eb78745 100644
--- a/crates/ui-egui/src/i18n/ru.tsv
+++ b/crates/ui-egui/src/i18n/ru.tsv
@@ -1296,6 +1296,7 @@
Copy text Копировать текст
Properties… Свойства…
Make Current Properties Default Сделать текущие свойства по умолчанию
+ Make Properties Default Сделать свойства по умолчанию
More options Ещё
Sort by Сортировать по
Author Автор
diff --git a/crates/ui-egui/src/i18n/sl.tsv b/crates/ui-egui/src/i18n/sl.tsv
index 62708bbf6..8884b7503 100644
--- a/crates/ui-egui/src/i18n/sl.tsv
+++ b/crates/ui-egui/src/i18n/sl.tsv
@@ -1051,6 +1051,7 @@
Low resolution Nizka ločljivost
Magnification Povečava
Make Current Properties Default Nastavi kot privzeto
+ Make Properties Default Lastnosti nastavi kot privzete
Make accessible Naredi dostopno
Make scans searchable, then make them smaller. Skenirane dokumente naredite iskalne, nato pa jih zmanjšajte.
Manage embedded index Upravljaj vdelani indeks
diff --git a/crates/ui-egui/src/i18n/te.tsv b/crates/ui-egui/src/i18n/te.tsv
index e913e3fd1..8f1895317 100644
--- a/crates/ui-egui/src/i18n/te.tsv
+++ b/crates/ui-egui/src/i18n/te.tsv
@@ -1265,6 +1265,7 @@ comment menu Edit సవరించు
Copy text టెక్స్ట్‌ను కాపీ చేయి
Properties… లక్షణాలు…
Make Current Properties Default ప్రస్తుత లక్షణాలను డిఫాల్ట్‌గా చేయి
+ Make Properties Default లక్షణాలను డిఫాల్ట్‌గా చేయి
More options మరిన్ని ఎంపికలు
Sort by క్రమపరిచే విధానం
Author రచయిత
diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv
index aee579923..737e42678 100644
--- a/crates/ui-egui/src/i18n/tr.tsv
+++ b/crates/ui-egui/src/i18n/tr.tsv
@@ -1253,6 +1253,7 @@
Copy text Metni kopyala
Properties… Özellikler…
Make Current Properties Default Geçerli Özellikleri Varsayılan Yap
+ Make Properties Default Özellikleri Varsayılan Yap
More options Diğer seçenekler
Sort by Sırala
Author Yazar
diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv
index 6db566dbc..9a3ea4bfa 100644
--- a/crates/ui-egui/src/i18n/uk.tsv
+++ b/crates/ui-egui/src/i18n/uk.tsv
@@ -1293,6 +1293,7 @@
Copy text Копіювати текст
Properties… Властивості…
Make Current Properties Default Зробити поточні властивості типовими
+ Make Properties Default Зробити властивості типовими
More options Додаткові параметри
Sort by Сортувати за
Author Автор
diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv
index 9136fdfb4..dfb823756 100644
--- a/crates/ui-egui/src/i18n/vi.tsv
+++ b/crates/ui-egui/src/i18n/vi.tsv
@@ -705,6 +705,7 @@ theme Appearance Giao diện
Low resolution Độ phân giải thấp
Magnification Độ phóng đại
Make Current Properties Default Đặt thuộc tính hiện tại làm mặc định
+ Make Properties Default Đặt thuộc tính làm mặc định
Margins Lề
Mark Page Range Đánh dấu phạm vi trang
Mark as comments Đánh dấu là bình luận
diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv
index da7c2d47a..1a87b0f62 100644
--- a/crates/ui-egui/src/i18n/zh-hans.tsv
+++ b/crates/ui-egui/src/i18n/zh-hans.tsv
@@ -1243,6 +1243,7 @@
Copy text 复制文本
Properties… 属性…
Make Current Properties Default 将当前属性设为默认
+ Make Properties Default 将属性设为默认
More options 更多选项
Sort by 排序方式
Author 作者
diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv
index e098a8cf1..e4307ea94 100644
--- a/crates/ui-egui/src/i18n/zh-hant.tsv
+++ b/crates/ui-egui/src/i18n/zh-hant.tsv
@@ -1188,6 +1188,7 @@
Copy text 複製文字
Properties… 屬性…
Make Current Properties Default 將目前屬性設為預設
+ Make Properties Default 將屬性設為預設
More options 更多選項
Sort by 排序方式
Author 作者
diff --git a/crates/ui-egui/tests/comments.rs b/crates/ui-egui/tests/comments.rs
index b2d09cad7..9926bc3f6 100644
--- a/crates/ui-egui/tests/comments.rs
+++ b/crates/ui-egui/tests/comments.rs
@@ -962,6 +962,54 @@ fn make_current_properties_default() {
assert_eq!(last.color, Some([0.0, 0.47, 0.84]));
}
+/// Acrobat's Properties ▸ Make Properties Default: OK with the box ticked makes the edited look
+/// the tool's default (here a strikethrough's colour); without it, only the comment changes.
+#[test]
+fn properties_dialog_makes_the_strikethrough_colour_default() {
+ use pdfcraft_ui_egui::comments::CommentTool;
+ let mut h = harness(|app| app.set_option("quick", "strikeout").unwrap());
+ let green = [0.18, 0.62, 0.36];
+ let blue = [0.0, 0.47, 0.84];
+ assert_ne!(h.state().comment_prefs.style(CommentTool::StrikeOut).color, green);
+ drag_pt(&mut h, (18.0, 155.0), (150.0, 155.0));
+ assert_eq!(comments(&h).iter().filter(|a| a.subtype == "StrikeOut").count(), 1);
+
+ // Without the box: the comment turns blue, the tool keeps its colour.
+ let before = h.state().comment_prefs.style(CommentTool::StrikeOut);
+ h.state_mut().open_comment_props(0, 0);
+ h.run_steps(2);
+ h.state_mut().comment_props.as_mut().expect("open").edited.color = Some(blue);
+ h.get_by_label("OK").click();
+ h.run_steps(3);
+ assert_eq!(h.state().comment_prefs.style(CommentTool::StrikeOut).color, before.color);
+
+ // With it: green, and a 0% opacity is clamped so the next strikethrough stays visible.
+ h.state_mut().open_comment_props(0, 0);
+ h.run_steps(2);
+ {
+ let d = h.state_mut().comment_props.as_mut().expect("open");
+ d.edited.color = Some(green);
+ d.edited.opacity = 0.0;
+ }
+ h.get_by_label("Make Properties Default").click();
+ h.run_steps(1);
+ assert!(h.state().comment_props.as_ref().is_some_and(|d| d.make_default));
+ h.get_by_label("OK").click();
+ h.run_steps(3);
+ let st = h.state().comment_prefs.style(CommentTool::StrikeOut);
+ assert_eq!((st.color, st.opacity), (green, 0.1));
+ let fresh = {
+ let mut fresh = PdfCraftApp::new();
+ fresh.restore(&h.state().persist());
+ fresh.comment_prefs.style(CommentTool::StrikeOut).color
+ };
+ assert_eq!(fresh, green, "the default persisted");
+ drag_pt(&mut h, (18.0, 155.0), (150.0, 155.0));
+ let c = comments(&h);
+ let made = c.iter().rfind(|a| a.subtype == "StrikeOut").and_then(|a| a.color).expect("a colougreen strikethrough");
+ assert!(made.iter().zip(green).all(|(m, r)| (f64::from(*m) - r).abs() < 0.01), "the next strikethrough is green: {made:?}");
+}
+
/// #1302: making an arrow's properties the default updates the Arrow tool, not later plain lines.
#[test]
fn an_arrows_default_does_not_restyle_lines() {
diff --git a/parity/acrobat-features.toml b/parity/acrobat-features.toml
index 9400753bc..957ac5c3e 100644
--- a/parity/acrobat-features.toml
+++ b/parity/acrobat-features.toml
@@ -3901,8 +3901,8 @@ milestone = "M5"
status = "shipped"
commands = ["comment.list"]
tools = []
-evidence = ["crates/ui-egui/tests/comments.rs::make_current_properties_default"]
-notes = "colour, opacity and line width become the tool's defaults (canvas and Comments panel menus) and survive a restart: the per-tool styles are persisted with the settings and restored through their clamping setters (#340)"
+evidence = ["crates/ui-egui/tests/comments.rs::make_current_properties_default", "crates/ui-egui/tests/comments.rs::properties_dialog_makes_the_strikethrough_colour_default"]
+notes = "colour, opacity and line width become the tool's defaults (canvas and Comments panel menus, and Acrobat's Make Properties Default box in Comment Properties, applied on OK with the edited look) and survive a restart: the per-tool styles are persisted with the settings and restored through their clamping setters (#340)"
[[feature]]
id = "comment.author-identity"