From 3de62e02fb3503366ed1933fc1990b443e8aee4d Mon Sep 17 00:00:00 2001 From: Elias Date: Fri, 9 Oct 2026 18:04:31 +0100 Subject: [PATCH] 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) --- crates/ui-egui/src/widgets.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index 18c6aedb..f82e4f64 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -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), ) }