ui: centre text and hint vertically in search/text fields

The TextEdit inside widgets::field took its natural height at the top of the
field, so vertical_align(Center) had no room to act and the placeholder sat
~2pt above the magnifier (Timeline, Project, Effects & Presets, Home).

(cherry picked from commit 6806eb4f7c955e87c6f2a5b01a9d80d43dd6ac58)

(cherry picked from commit af85d220bc337d5a3c6fa94b6fa315b0d3b0c09b)
(cherry picked from commit 685b7f2057839da1af9607dc0c93020f062a0946)
This commit is contained in:
Elias
2026-10-11 11:50:13 +00:00
committed by Claude
parent ed5c3685e7
commit 3de62e02fb
+3
View File
@@ -301,6 +301,9 @@ fn field(ui: &mut Ui, rect: Rect, text: &mut String, hint: &str, t: &Tokens, sea
// As tall as the field, so the text and the hint sit on its middle (they sat high, #581).
.min_size(inner.size())
.font(Tokens::ui(12.0))
// Fill the field's height so the text and hint centre on the magnifier instead of
// hugging the top edge (`vertical_align` only acts within `min_size`).
.min_size(inner.size())
.vertical_align(egui::Align::Center),
)
}