Merge pull request #2524 from Silvertree2010:fix/2453-row-height-dialog-uses-pixels-sh

This commit is contained in:
Brandon Thomas
2026-10-25 09:36:29 -04:00
2 changed files with 6 additions and 4 deletions
+2 -2
View File
@@ -221,8 +221,8 @@ impl Dialog {
"rowHeight",
"Row Height",
"home.rowHeight",
vec![Number { key: "height", label: "Row height (pixels):" }],
json!({"height": app.session.active().and_then(|d| d.wb.active().map(|s| s.row_height(d.selection.active.row))).unwrap_or(20.0)}),
vec![Number { key: "points", label: "Row height (points):" }],
json!({"points": app.session.active().and_then(|d| d.wb.active().map(|s| s.row_height(d.selection.active.row) as f64 * 0.75)).unwrap_or(15.0)}),
),
"columnWidth" => Dialog::form(
"columnWidth",
+4 -2
View File
@@ -51,13 +51,15 @@ fn row_height_opens_with_the_height_ready_to_type() {
let mut h = harness();
h.state_mut().open_dialog("rowHeight", json!({}));
h.run_steps(6);
type_and_enter(&mut h, "40");
let shown = h.state().dialog.as_ref().and_then(|d| d.values.get("points")).and_then(|v| v.as_f64());
assert!(shown.is_some_and(|v| (v - 15.0).abs() < 0.01), "a default row opens at 15 points, got {shown:?}");
type_and_enter(&mut h, "30");
assert!(h.state().dialog.is_none(), "Enter confirmed the dialog");
let height = {
let d = h.state().session.active().unwrap();
d.wb.active().unwrap().row_height(CellRef::parse("C3").unwrap().row)
};
assert!((height as f64 - 40.0).abs() < 0.6, "row 3 is 40 high, got {height}");
assert!((height as f64 - 40.0).abs() < 0.6, "row 3 is 30 points (40 pixels) high, got {height}");
}
#[test]