diff --git a/crates/ui-egui/locales/de.json b/crates/ui-egui/locales/de.json index 64a485ed..b8aaff93 100644 --- a/crates/ui-egui/locales/de.json +++ b/crates/ui-egui/locales/de.json @@ -1887,5 +1887,6 @@ "Pending photo action cancelled": "Pending photo action cancelled", "Pending photo action cancelled because its library or photo changed": "Pending photo action cancelled because its library or photo changed", "ONNX model": "ONNX model", - "commercial use subject to GPL conditions": "commercial use subject to GPL conditions" + "commercial use subject to GPL conditions": "commercial use subject to GPL conditions", + "Click to type a value": "Klicken, um einen Wert einzugeben" } diff --git a/crates/ui-egui/locales/es.json b/crates/ui-egui/locales/es.json index 461fa2f6..9f0362c3 100644 --- a/crates/ui-egui/locales/es.json +++ b/crates/ui-egui/locales/es.json @@ -1732,5 +1732,6 @@ "Pending photo action cancelled": "Pending photo action cancelled", "Pending photo action cancelled because its library or photo changed": "Pending photo action cancelled because its library or photo changed", "ONNX model": "ONNX model", - "commercial use subject to GPL conditions": "commercial use subject to GPL conditions" + "commercial use subject to GPL conditions": "commercial use subject to GPL conditions", + "Click to type a value": "Hacer clic para escribir un valor" } diff --git a/crates/ui-egui/locales/ja.json b/crates/ui-egui/locales/ja.json index 49f2ef80..1617546b 100644 --- a/crates/ui-egui/locales/ja.json +++ b/crates/ui-egui/locales/ja.json @@ -1732,5 +1732,6 @@ "Pending photo action cancelled": "Pending photo action cancelled", "Pending photo action cancelled because its library or photo changed": "Pending photo action cancelled because its library or photo changed", "ONNX model": "ONNX model", - "commercial use subject to GPL conditions": "commercial use subject to GPL conditions" + "commercial use subject to GPL conditions": "commercial use subject to GPL conditions", + "Click to type a value": "クリックして値を入力" } diff --git a/crates/ui-egui/locales/pt-br.json b/crates/ui-egui/locales/pt-br.json index 81e331c5..f87b9369 100644 --- a/crates/ui-egui/locales/pt-br.json +++ b/crates/ui-egui/locales/pt-br.json @@ -1732,5 +1732,6 @@ "Pending photo action cancelled": "Pending photo action cancelled", "Pending photo action cancelled because its library or photo changed": "Pending photo action cancelled because its library or photo changed", "ONNX model": "ONNX model", - "commercial use subject to GPL conditions": "commercial use subject to GPL conditions" + "commercial use subject to GPL conditions": "commercial use subject to GPL conditions", + "Click to type a value": "Clique para digitar um valor" } diff --git a/crates/ui-egui/locales/ru.json b/crates/ui-egui/locales/ru.json index 56ed5798..b7d5a0b6 100644 --- a/crates/ui-egui/locales/ru.json +++ b/crates/ui-egui/locales/ru.json @@ -1405,5 +1405,6 @@ "Pending photo action cancelled": "Pending photo action cancelled", "Pending photo action cancelled because its library or photo changed": "Pending photo action cancelled because its library or photo changed", "ONNX model": "ONNX model", - "commercial use subject to GPL conditions": "commercial use subject to GPL conditions" + "commercial use subject to GPL conditions": "commercial use subject to GPL conditions", + "Click to type a value": "Щёлкните, чтобы ввести значение" } diff --git a/crates/ui-egui/locales/zh-hans.json b/crates/ui-egui/locales/zh-hans.json index 4074dfbd..ec8621b2 100644 --- a/crates/ui-egui/locales/zh-hans.json +++ b/crates/ui-egui/locales/zh-hans.json @@ -1732,5 +1732,6 @@ "Pending photo action cancelled": "Pending photo action cancelled", "Pending photo action cancelled because its library or photo changed": "Pending photo action cancelled because its library or photo changed", "ONNX model": "ONNX model", - "commercial use subject to GPL conditions": "commercial use subject to GPL conditions" + "commercial use subject to GPL conditions": "commercial use subject to GPL conditions", + "Click to type a value": "点击以输入数值" } diff --git a/crates/ui-egui/locales/zh-hant.json b/crates/ui-egui/locales/zh-hant.json index 96fcbb18..90199415 100644 --- a/crates/ui-egui/locales/zh-hant.json +++ b/crates/ui-egui/locales/zh-hant.json @@ -1732,5 +1732,6 @@ "Pending photo action cancelled": "Pending photo action cancelled", "Pending photo action cancelled because its library or photo changed": "Pending photo action cancelled because its library or photo changed", "ONNX model": "ONNX model", - "commercial use subject to GPL conditions": "commercial use subject to GPL conditions" + "commercial use subject to GPL conditions": "commercial use subject to GPL conditions", + "Click to type a value": "按一下以輸入數值" } diff --git a/crates/ui-egui/src/tests_crop_rotate.rs b/crates/ui-egui/src/tests_crop_rotate.rs index f5aca4e7..977cb4eb 100644 --- a/crates/ui-egui/src/tests_crop_rotate.rs +++ b/crates/ui-egui/src/tests_crop_rotate.rs @@ -99,3 +99,18 @@ fn the_angle_reads_like_the_straighten_value() { assert_eq!(crop_angle_label(-12.254), "-12.25°"); assert_eq!(crop_angle_label(-0.001), "0.00°", "no minus zero, and every zero the same"); } + +/// Hovering the Straighten value says that a value can be typed there. +#[test] +fn the_straighten_value_says_it_can_be_typed() { + let mut h = crop_tool(); + let r = h.request("ui.hoverWidget", json!({"id": "sliderValue:crop.angle"}), T); + assert_eq!(r["ok"], true, "{r}"); + // tooltips wait for the pointer to rest + let _ = h.step_until(Duration::from_secs(5), |h| h.painted_text().iter().any(|t| t.contains("type"))); + assert!( + h.painted_text().iter().any(|t| t == "Click to type a value"), + "{:?}", + h.painted_text().iter().filter(|t| t.contains("lick")).collect::>() + ); +} diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 8865995f..9d41f1b7 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -180,6 +180,8 @@ pub fn slider(ui: &mut Ui, spec: &ControlSpec, value: f64, enabled: bool, label_ let value_rect = Rect::from_min_max(pos2(label_rect.right() - 64.0, label_rect.top()), label_rect.max); let value_resp = ui.interact(value_rect, id.with("value"), if enabled { Sense::click() } else { Sense::hover() }); register(ui.ctx(), format!("sliderValue:{}", spec.id), value_rect); + // say that an exact value can be typed here (issue #534: an exact crop angle was hard to find) + let value_resp = if enabled { value_resp.on_hover_text(crate::i18n::tr("Click to type a value")) } else { value_resp }; let typing_id = id.with("typing"); let field_id = id.with("typingField"); // the text being typed and how many frames the field has been up: it takes the keyboard on its