diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index 7b069e597..c300bf07f 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -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", diff --git a/crates/ui-egui/tests/it/dialog_focus.rs b/crates/ui-egui/tests/it/dialog_focus.rs index ee0896f8f..9ccce5f0f 100644 --- a/crates/ui-egui/tests/it/dialog_focus.rs +++ b/crates/ui-egui/tests/it/dialog_focus.rs @@ -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]