feat(annotation): integrate object contexts

This commit is contained in:
Hakan Seven committed 2026-08-02 12:00:15 +03:00
1 parent f39481ac49
commit e03e091b3c
37 files changed
+2823 -584

No files matched your search

+9 -1
View File
@@ -537,7 +537,15 @@ pub fn view_window<'a>(
chk("Annotative", vals.annotative, DsField::Annotative),
row![
lbl("Overall scale (DIMSCALE)"),
mk_field(DsField::Dimscale, vals.dimscale)
if vals.annotative {
text_input("", "0")
.style(field_style)
.size(11)
.width(100)
.into()
} else {
mk_field(DsField::Dimscale, vals.dimscale)
}
]
.spacing(8)
.align_y(iced::Center),
+15 -1
View File
@@ -105,6 +105,16 @@ fn num_row<'a>(
.into()
}
fn readonly_num_row<'a>(label: &'static str, value: &'a str) -> Element<'a, Message> {
row![
text(label).size(11).style(muted_style).width(150),
text(value).size(11).style(muted_style),
]
.spacing(8)
.align_y(iced::Center)
.into()
}
/// Shared colour selector row. Reuses MLeaderStyleEdit by sending the chosen
/// colour as an ACI string; `open` shows the expanded palette.
fn color_row<'a>(
@@ -288,7 +298,11 @@ pub fn view_window<'a>(
v.second_seg_angle,
"second_seg_angle"
),
num_row("Scale factor:", "1.0", v.scale_factor, "scale_factor"),
if s.is_annotative {
readonly_num_row("Scale factor:", "By annotation scale")
} else {
num_row("Scale factor:", "1.0", v.scale_factor, "scale_factor")
},
num_row("Align space:", "4.0", v.align_space, "align_space"),
enum_row(
"Leader draw order:",
-5
View File
@@ -293,11 +293,6 @@ pub fn view_window<'a>(
]
.spacing(8)
.align_y(iced::Center),
checkbox(s.annotative)
.label("Annotative")
.on_toggle(|_| Message::TableStyleToggleAnnotative)
.size(14)
.text_size(11),
row![
text("H Margin:").size(11).style(muted_style).width(160),
text_input("1.5", hmargin_buf)
+10 -1
View File
@@ -298,7 +298,16 @@ pub fn view_window<'a>(
text("Properties").size(11).style(primary_style),
frow("Big Font:", "big-font file…", bigfont_buf, "bigfont"),
frow("TrueType Font:", "e.g. Arial", ttf_buf, "ttf"),
frow("Fixed Height:", "0 = variable", height_buf, "height"),
frow(
if annotative {
"Paper Text Height:"
} else {
"Fixed Height:"
},
"0 = variable",
height_buf,
"height",
),
frow("Width Factor:", "1.0", width_buf, "width"),
frow("Oblique (°):", "0.0", oblique_buf, "oblique"),
row![