mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-17 04:04:25 +00:00
New Guide: a measuring run does not decide OK; trial types without Tab
This commit is contained in:
@@ -190,7 +190,10 @@ impl<'a> NewGuideDialog<'a> {
|
||||
parsed = position_row(ui, &words, &number_units, &units, values, first);
|
||||
color_row(ui, &words, &mut values.color, NEW_GUIDE_COLOR_KEY, form.requests());
|
||||
});
|
||||
ok_enabled = parsed;
|
||||
// A measuring run lays the field out without its typing run, so it never says whether the text parses.
|
||||
if !crate::runtime::measure::active(ui.ctx()) {
|
||||
ok_enabled = parsed;
|
||||
}
|
||||
parsed
|
||||
});
|
||||
let result = shown.accepted.map(|values| {
|
||||
|
||||
@@ -151,8 +151,7 @@ fn position_text_that_does_not_parse_keeps_ok_from_making_a_guide() {
|
||||
let position = fixture.by_label("Position").expect("the Position field");
|
||||
fixture.click(&position).settle();
|
||||
fixture.key(egui::Key::A, egui::Modifiers::COMMAND);
|
||||
fixture.type_text("far");
|
||||
fixture.key(egui::Key::Tab, egui::Modifiers::NONE).settle();
|
||||
fixture.type_text("far").settle();
|
||||
assert!(!enabled.get(), "OK is disabled while the text does not parse");
|
||||
let ok = fixture.by_label("OK").expect("the footer has OK");
|
||||
fixture.click(&ok).settle();
|
||||
@@ -162,8 +161,7 @@ fn position_text_that_does_not_parse_keeps_ok_from_making_a_guide() {
|
||||
let position = fixture.by_label("Position").expect("the Position field");
|
||||
fixture.click(&position).settle();
|
||||
fixture.key(egui::Key::A, egui::Modifiers::COMMAND);
|
||||
fixture.type_text("40");
|
||||
fixture.key(egui::Key::Tab, egui::Modifiers::NONE).settle();
|
||||
fixture.type_text("40").settle();
|
||||
assert!(enabled.get(), "a number enables OK again");
|
||||
let ok = fixture.by_label("OK").expect("the footer has OK");
|
||||
fixture.click(&ok).settle();
|
||||
|
||||
Reference in New Issue
Block a user