Charts · Navigation · Forms: band names widen a sideways chart's gutter; Pagination takes a size, speaks the locale and jumps to a typed page
- A horizontal chart's gutter grows to its widest band name, floored at the theme gutter and capped at half the chart; a name past the cap ends in an ellipsis (#10). - Pagination's previous and next tooltips read i18n (English and zh-CN built in, app catalogs override); `.size(ControlSize)` sizes every control, Sm by default; `.jump()` adds a Go to field (#11). - NumberInput keys the owner's value as shown: a draft survives a blur, a value set while focused lands when focus leaves, and an echo of its own commit is no new value. A ranged field holds room for its widest bound through `Input::least`.
This commit is contained in:
1 parent
2ce336895c
commit
bd3772ad54
17 files changed
+438
-51
No files matched your search
@@ -281,6 +281,21 @@ fn a_blank_field_commits_only_what_is_typed(cx: &mut TestAppContext) {
|
||||
assert_eq!(view.read_with(cx, |view, _| view.values.clone()), [0.0]);
|
||||
}
|
||||
|
||||
#[gpui::test]
|
||||
fn a_blur_commits_the_typed_number(cx: &mut TestAppContext) {
|
||||
setup(cx);
|
||||
let (view, cx) = cx.add_window_view(|_, _| Committed { values: Vec::new() });
|
||||
cx.update(|window, cx| {
|
||||
window.activate_window();
|
||||
window.focus_next(cx);
|
||||
});
|
||||
cx.simulate_keystrokes("secondary-a");
|
||||
cx.simulate_input("12");
|
||||
cx.update(|window, cx| window.blur(cx));
|
||||
cx.run_until_parked();
|
||||
assert_eq!(view.read_with(cx, |view, _| view.values.clone()), [12.0]);
|
||||
}
|
||||
|
||||
struct Pin {
|
||||
code: String,
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user