mirror of
https://github.com/storytold/designcraft.git
synced 2026-10-25 18:56:50 -06:00
Paragraph panel: Optical Margin Alignment checkbox (#494)
The composer already hangs punctuation when a paragraph's opticalMargin is on, but nothing in the UI could turn it on. Reported by @mjohnson7cd
This commit is contained in:
@@ -2372,6 +2372,10 @@ const TABLE: &[(&str, [&str; 5])] = &[
|
||||
("Inward", ["Inward", "Inward", "Inward", "Inward", "向内"]),
|
||||
("Metrics", ["Metrics", "Metrics", "Metrics", "Metrics", "度量"]),
|
||||
("Optical", ["Optical", "Optical", "Optical", "Optical", "视觉"]),
|
||||
(
|
||||
"Optical Margin Alignment",
|
||||
["Optischer Randausgleich", "Marges optiques", "Alineación de márgenes ópticos", "オプティカルマージン揃え", "视觉边距对齐"],
|
||||
),
|
||||
("Applies to fill", ["Applies to fill", "Applies to fill", "Applies to fill", "Applies to fill", "应用于填色"]),
|
||||
("Applies to text", ["Applies to text", "Applies to text", "Applies to text", "Applies to text", "应用于文本"]),
|
||||
("Gray", ["Gray", "Gray", "Gray", "Gray", "灰度"]),
|
||||
|
||||
@@ -1478,6 +1478,10 @@ pub fn paragraph_panel(app: &mut DesignApp, ui: &mut egui::Ui) {
|
||||
let _ = app.run("type.para", json!({"attrs": {"gridAlign": if grid { "allLines" } else { "none" }}}));
|
||||
}
|
||||
});
|
||||
let mut optical = p["opticalMargin"].as_bool().unwrap_or(false);
|
||||
if ui.checkbox(&mut optical, crate::rtl::widget(ui, crate::i18n::tr(&app.ui.language, "Optical Margin Alignment"))).changed() {
|
||||
let _ = app.run("type.para", json!({"attrs": {"opticalMargin": optical}}));
|
||||
}
|
||||
ui.horizontal(|ui| {
|
||||
caption(ui, crate::i18n::tr(&app.ui.language, "Composer"));
|
||||
let single = p["composer"].as_str() == Some("singleLine");
|
||||
|
||||
Reference in New Issue
Block a user