git.lucas.co / cce-ui
GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git

commit6702afe9d6edc12a8cac8546821d7cf663ebf9d8
parent97dbbe0d82
authorLucas Galante <[email protected]>
date2026-07-20 13:18
fix: one shared height for the demo's control row

The dropdown leaf was 26 logical px against the button/toggle's 28, so its
plate bottom sat visibly higher in the row. All three leaves (and the row
container) now share one CONTROL_H constant.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XxjKyZK55xkRz43M8Fecsf

 src/main.rs | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/main.rs b/src/main.rs
index 4fb28b8..46f8fb6 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -245,14 +245,17 @@ impl Application for DemoApp {
                 Style::row(),
                 LSize::new(0.0, cce_ui::layout::bevel_width()),
             ));
+            // One shared height for the whole control row, so the button,
+            // toggle, and dropdown plates land on the same top and bottom edge.
+            const CONTROL_H: f32 = 28.0;
             let controls = arena.insert(LayoutBox::container(
-                Style::row().gap(14.0).height(Length::Fixed(28.0)),
+                Style::row().gap(14.0).height(Length::Fixed(CONTROL_H)),
             ));
             // `shrink` lets the fixed leaves give up width when the window is at its
             // minimum instead of overflowing the row.
-            let button = arena.insert(LayoutBox::leaf(Style::row().shrink(1.0), LSize::new(120.0, 28.0)));
-            let toggle = arena.insert(LayoutBox::leaf(Style::row(), LSize::new(64.0, 28.0)));
-            let dropdown = arena.insert(LayoutBox::leaf(Style::row().shrink(1.0), LSize::new(150.0, 26.0)));
+            let button = arena.insert(LayoutBox::leaf(Style::row().shrink(1.0), LSize::new(120.0, CONTROL_H)));
+            let toggle = arena.insert(LayoutBox::leaf(Style::row(), LSize::new(64.0, CONTROL_H)));
+            let dropdown = arena.insert(LayoutBox::leaf(Style::row().shrink(1.0), LSize::new(150.0, CONTROL_H)));
             let slider = arena.insert(LayoutBox::leaf(Style::row(), LSize::new(0.0, 24.0)));
             let name_box = arena.insert(LayoutBox::leaf(Style::row(), LSize::new(0.0, 30.0)));
             let spacer = arena.insert(LayoutBox::container(Style::column().grow(1.0)));