Align multileader property visibility

This commit is contained in:
ramox81 committed 2026-08-28 09:59:23 +03:00
1 parent cce25be83a
commit ef7f26be68
4 files changed
+27 -60

No files matched your search

+2
View File
@@ -2447,6 +2447,8 @@ properties =
.associative = Associative .associative = Associative
.at-least = At least .at-least = At least
.attachment-type = Attachment type .attachment-type = Attachment type
.attachment = Attachment
.arrowhead-size = Arrowhead Size
.attenuation = Attenuation .attenuation = Attenuation
.attribute-definition = Attribute Definition .attribute-definition = Attribute Definition
.attributedefinition = AttributeDefinition .attributedefinition = AttributeDefinition
+2
View File
@@ -2387,6 +2387,8 @@ properties =
.associative = İlişkisel .associative = İlişkisel
.at-least = En az .at-least = En az
.attachment-type = Bağlantı türü .attachment-type = Bağlantı türü
.attachment = Bağlantı
.arrowhead-size = Ok Ucu Boyutu
.attenuation = Zayıflama .attenuation = Zayıflama
.attribute-definition = Öznitelik Tanımı .attribute-definition = Öznitelik Tanımı
.attributedefinition = Öznitelik Tanımı .attributedefinition = Öznitelik Tanımı
+21 -60
View File
@@ -905,9 +905,7 @@ fn properties(ml: &MultiLeader) -> Vec<PropSection> {
// ── Leaders ────────────────────────────────────────────────────────── // ── Leaders ──────────────────────────────────────────────────────────
// Landing rows are folded in here: the standalone "Leader Structure" group // Landing rows are folded in here: the standalone "Leader Structure" group
// is a style-dialog tab, not a palette group. // is a style-dialog tab, not a palette group.
let leaders = PropSection { let mut leader_props = vec![
title: t!("Leaders").into_owned(),
props: vec![
choice( choice(
t!("Leader type").as_ref(), t!("Leader type").as_ref(),
"path_type", "path_type",
@@ -931,20 +929,27 @@ fn properties(ml: &MultiLeader) -> Vec<PropSection> {
}, },
// Arrowhead block name resolved by the panel builder (default "Closed filled"). // Arrowhead block name resolved by the panel builder (default "Closed filled").
ro(t!("Arrowhead").as_ref(), "arrowhead_handle", "Closed filled"), ro(t!("Arrowhead").as_ref(), "arrowhead_handle", "Closed filled"),
edit(t!("Arrowhead size").as_ref(), "arrowhead_size", ml.arrowhead_size), edit(t!("Arrowhead Size").as_ref(), "arrowhead_size", ml.arrowhead_size),
bool_toggle(t!("Horizontal Landing").as_ref(), "enable_dogleg", ml.enable_dogleg), bool_toggle(t!("Horizontal Landing").as_ref(), "enable_dogleg", ml.enable_dogleg),
num_row( num_row(
t!("Landing distance").as_ref(), t!("Landing distance").as_ref(),
"landing_distance", "landing_distance",
ml.dogleg_length, if ml.enable_dogleg { ml.dogleg_length } else { 0.0 },
ml.enable_dogleg, ml.enable_dogleg,
), ),
bool_toggle( ];
t!("Extend leader to text").as_ref(), // The extension is an MText-only landing option. It is absent for block
// content and whenever the horizontal landing itself is disabled.
if ml.content_type == LeaderContentType::MText && ml.enable_dogleg {
leader_props.push(bool_toggle(
t!("Leader extension").as_ref(),
"extend_leader_to_text", "extend_leader_to_text",
ml.extend_leader_to_text, ml.extend_leader_to_text,
), ));
], }
let leaders = PropSection {
title: t!("Leaders").into_owned(),
props: leader_props,
}; };
// ── Text (shown only for MText content) ────────────────────────────── // ── Text (shown only for MText content) ──────────────────────────────
@@ -958,11 +963,6 @@ fn properties(ml: &MultiLeader) -> Vec<PropSection> {
}, },
// Text-style name resolved from text_style_handle by the panel builder. // Text-style name resolved from text_style_handle by the panel builder.
ro(t!("Text style").as_ref(), "text_style_handle", "Standard"), ro(t!("Text style").as_ref(), "text_style_handle", "Standard"),
Property {
label: t!("Text color").into_owned(),
field: "text_color",
value: PropValue::ColorChoice(ml.text_color),
},
choice( choice(
t!("Justify").as_ref(), t!("Justify").as_ref(),
"text_alignment", "text_alignment",
@@ -995,40 +995,6 @@ fn properties(ml: &MultiLeader) -> Vec<PropSection> {
"background_fill_enabled", "background_fill_enabled",
ctx.background_fill_enabled, ctx.background_fill_enabled,
), ),
if ctx.background_fill_enabled {
bool_toggle(
t!("Use drawing background color").as_ref(),
"background_mask_fill_on",
ctx.background_mask_fill_on,
)
} else {
ro(
t!("Use drawing background color").as_ref(),
"background_mask_fill_on",
if ctx.background_mask_fill_on { "Yes" } else { "No" },
)
},
Property {
label: t!("Background mask color").into_owned(),
field: "background_fill_color",
value: if ctx.background_fill_enabled && !ctx.background_mask_fill_on {
PropValue::ColorChoice(ctx.background_fill_color)
} else {
PropValue::ReadOnly(format!("{:?}", ctx.background_fill_color))
},
},
num_row(
t!("Border offset factor").as_ref(),
"background_scale_factor",
ctx.background_scale_factor,
ctx.background_fill_enabled,
),
num_row(
t!("Background transparency").as_ref(),
"background_transparency",
ctx.background_transparency as f64,
ctx.background_fill_enabled,
),
choice( choice(
t!("Attachment type").as_ref(), t!("Attachment type").as_ref(),
"text_attachment_direction", "text_attachment_direction",
@@ -1087,7 +1053,7 @@ fn properties(ml: &MultiLeader) -> Vec<PropSection> {
hexh(ml.block_content_handle), hexh(ml.block_content_handle),
), ),
choice( choice(
t!("Block connection").as_ref(), t!("Attachment").as_ref(),
"block_connection_type", "block_connection_type",
match ml.block_connection_type { match ml.block_connection_type {
BlockContentConnectionType::BasePoint => "Insertion point", BlockContentConnectionType::BasePoint => "Insertion point",
@@ -1095,17 +1061,7 @@ fn properties(ml: &MultiLeader) -> Vec<PropSection> {
}, },
&["Extents", "Insertion point"], &["Extents", "Insertion point"],
), ),
Property { edit(t!("Scale").as_ref(), "block_scale", ml.block_scale.x),
label: t!("Block color").into_owned(),
field: "block_content_color",
value: PropValue::ColorChoice(ml.block_content_color),
},
edit(t!("Block scale").as_ref(), "block_scale", ml.block_scale.x),
edit(
t!("Block rotation").as_ref(),
"block_rotation",
ml.block_rotation.to_degrees(),
),
], ],
}; };
@@ -1409,6 +1365,11 @@ fn apply_geom_prop(ml: &mut MultiLeader, field: &str, value: &str) {
"Vertical" => TextAttachmentDirectionType::Vertical, "Vertical" => TextAttachmentDirectionType::Vertical,
_ => TextAttachmentDirectionType::Horizontal, _ => TextAttachmentDirectionType::Horizontal,
}; };
if ml.text_attachment_direction == TextAttachmentDirectionType::Vertical {
ml.enable_dogleg = false;
ml.property_override_flags
.insert(MultiLeaderPropertyOverrideFlags::ENABLE_DOGLEG);
}
for root in &mut ml.context.leader_roots { for root in &mut ml.context.leader_roots {
root.text_attachment_direction = ml.text_attachment_direction; root.text_attachment_direction = ml.text_attachment_direction;
} }
+2
View File
@@ -325,6 +325,7 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static
"Arrow size (DIMASZ)" => Some(("styles", "arrow-size-dimasz")), "Arrow size (DIMASZ)" => Some(("styles", "arrow-size-dimasz")),
"Arrowhead" => Some(("common", "arrowhead")), "Arrowhead" => Some(("common", "arrowhead")),
"Arrowhead (DIMBLK)" => Some(("styles", "arrowhead-dimblk")), "Arrowhead (DIMBLK)" => Some(("styles", "arrowhead-dimblk")),
"Arrowhead Size" => Some(("properties", "arrowhead-size")),
"Arrowhead block:" => Some(("styles", "arrowhead-block")), "Arrowhead block:" => Some(("styles", "arrowhead-block")),
"Arrowhead size" => Some(("common", "arrowhead-size")), "Arrowhead size" => Some(("common", "arrowhead-size")),
"Arrowhead size:" => Some(("styles", "arrowhead-size")), "Arrowhead size:" => Some(("styles", "arrowhead-size")),
@@ -332,6 +333,7 @@ pub(super) fn message_attribute(source: &str) -> Option<(&'static str, &'static
"Arrows out first" => Some(("styles", "arrows-out-first")), "Arrows out first" => Some(("styles", "arrows-out-first")),
"As displayed" => Some(("common", "as-displayed")), "As displayed" => Some(("common", "as-displayed")),
"Associative" => Some(("properties", "associative")), "Associative" => Some(("properties", "associative")),
"Attachment" => Some(("properties", "attachment")),
"At first ext" => Some(("styles", "at-first-ext")), "At first ext" => Some(("styles", "at-first-ext")),
"At least" => Some(("properties", "at-least")), "At least" => Some(("properties", "at-least")),
"At second ext" => Some(("styles", "at-second-ext")), "At second ext" => Some(("styles", "at-second-ext")),