From 1fe62f6bd9257bf4966dbdb81bf66a3ed9821eba Mon Sep 17 00:00:00 2001 From: Breadway Date: Wed, 26 Aug 2026 11:53:28 +0800 Subject: [PATCH] bar: centre the row vertically instead of pinning it to the top MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wrapping the bar row in a vbox to gain the drawer slot left the CenterBox at its natural height, so it sat at the TOP of the window and the remainder showed as dead space along the bottom edge. Every valign:Center child then centred within that short box rather than within the bar, and the whole row rode high. The clock was the one element that looked right, because it carried a margin_top(3) nudging it back down. With the row centring properly that offset would push it below everything else, so it goes too — the compensation and the bug are the same change. --- src/main.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 1e4f77a..7654a6a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -255,6 +255,14 @@ impl SimpleComponent for App { #[name = "center_box"] gtk::CenterBox { + // Fill the bar's height. Without this the CenterBox takes + // only its natural height and sits at the TOP of the vbox, + // leaving the remainder as dead space along the bottom + // edge — so every valign:Center child centred within a + // short box rather than within the bar, and the whole row + // rode high. Regression from wrapping the bar row in a + // vbox to gain the drawer slot. + set_vexpand: true, }, #[name = "drawer_box"] @@ -506,7 +514,11 @@ impl SimpleComponent for App { clock_box.set_valign(gtk4::Align::Center); clock_box.set_vexpand(false); // Varela Round's em box sits optically high in the 44px island. - clock_box.set_margin_top(3); + // No compensating margin: this +3 existed to nudge the clock down + // against the mis-centred CenterBox above. With the row now filling + // the bar height and centring properly, the same offset would push + // the clock 3px BELOW everything else. + clock_box.set_margin_top(0); for digit in &clock_digits { clock_box.append(digit); }