Packaging: the Fold Lines role list is as tall as its four roles

The role list took all the room the panel gave it. In the floating
window the panel opens in (260 by 360 pt), Check and Fold Preview were
drawn below the bottom of the panel, and the Fold Angle row was cut off,
with no scroll to reach them. The list now takes its natural height, as
the Learn panel's skill list does, so the controls show under the four
roles.
This commit is contained in:
dotCooCoo committed 2026-11-28 14:35:22 -08:00
1 parent d76abce927
commit ce6b32183b
3 files changed
+27 -5

No files matched your search

+2
View File
@@ -355,7 +355,9 @@ pub fn show(app: &mut VectorcraftApp, ui: &mut Ui) {
let kept = read_rows(app);
let rows = &kept.rows;
let source = Positional { rows, label: |row| role_label(&row.0) };
// The four roles: the list is as tall as its rows, so the Fold Angle row, Check and Fold Preview show under them.
let out = List::<usize>::new(tl!("Fold line roles").to_string())
.natural_height(true)
.select(SelectMode::None)
.activate(ActivateOn::Click)
.enabled(selected)
+19 -1
View File
@@ -229,7 +229,6 @@ fn canceling_a_fold_angle_edit_restores_the_angle_and_enter_is_one_undo_step() {
let doc = panel.app().session.active().unwrap().doc.clone();
let angle = read_rows(&mut panel.app()).angle;
let undo = undo_len(&panel.app());
// The role list fills the panel's height, so the field below it takes the focus as a screen reader gives it.
panel.focus("Fold Angle");
panel.key(Key::A, Modifiers::COMMAND);
panel.type_text(text);
@@ -250,3 +249,22 @@ fn canceling_a_fold_angle_edit_restores_the_angle_and_enter_is_one_undo_step() {
}
}
}
/// At the size the panel floats at, the role list is as tall as its rows, and the Fold Angle row,
/// Check and Fold Preview under it lie inside the panel.
#[test]
fn the_fold_angle_row_check_and_fold_preview_show_under_the_roles() {
let (mut app, a, _) = app();
app.run(SET_ROLE, json!({"role": "crease", "ids": [a]})).unwrap();
app.run("select.set", json!({"ids": [a]})).unwrap();
let mut panel = Panel::new(app, show);
let room = crate::panel_docking::floating_size(ID);
panel.room(room).frame();
panel.frame();
let (list, last) = (panel.rect("Fold line roles"), panel.rect("Perforation Line"));
assert!(list.bottom() <= last.bottom() + 8.0, "the list ends at its last role: {list:?} {last:?}");
for name in ["Fold Angle", "Check", "Fold Preview"] {
let rect = panel.rect(name);
assert!(rect.top() >= list.bottom() && rect.bottom() <= room.y, "{name} at {rect:?} lies under the list {list:?}, inside {room:?}");
}
}
+6 -4
View File
@@ -926,12 +926,14 @@ fn tab_strip_buttons_are_named_by_their_labels() {
assert!(ids.is_empty(), "buttons named by a command id: {ids:?}");
}
/// A panel the Window menu floats opens tall enough for its content: every control of Asset Export,
/// and every Image Trace control down to the top of its Advanced section, lies between the body's
/// top and bottom, none scrolled or clipped away.
/// A panel the Window menu floats opens tall enough for its content: every control of Asset Export
/// and Fold Lines, and every Image Trace control down to the top of its Advanced section, lies
/// between the body's top and bottom, none scrolled or clipped away.
#[test]
fn window_menu_floats_open_tall_enough_for_their_content() {
for (panel, title, until) in [("assetExport", "Asset Export", None), ("imageTrace", "Image Trace", Some("Advanced"))] {
for (panel, title, until) in
[("assetExport", "Asset Export", None), ("foldLines", "Fold Lines", None), ("imageTrace", "Image Trace", Some("Advanced"))]
{
let mut h = Harness::new();
h.app.run("window.panel", json!({"panel": panel})).unwrap();
assert!(floating_window(&h.layout(), panel).is_some(), "{panel} floats");