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

commitc416cdab9640d0c6a7e2e11e2cf0e6d03b62366f
parentdbb185db52
authorLucas Galante <[email protected]>
date2026-07-22 12:16
fix: section labels follow the title tab; tighter control inset

The header label x was still the old hardcoded rect.x + 12 (box at 4px
+ 8px text inset), so moving the tab to SECTION_MARGIN left the text
hanging off its left edge — it now derives from the margin plus the
same 8px inset section_title_box's width math centers against.
CONTROL_INSET eases 12 -> 8.

Co-Authored-By: Claude Fable 5 <[email protected]>

 src/widget/container/parameters_bg.rs | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/widget/container/parameters_bg.rs b/src/widget/container/parameters_bg.rs
index 3e38b3b..7c639ca 100644
--- a/src/widget/container/parameters_bg.rs
+++ b/src/widget/container/parameters_bg.rs
@@ -102,7 +102,7 @@ const SECTION_GAP: f32 = 2.0 * ROW_GAP;
 /// float clearly inside the plate.
 const SECTION_MARGIN: f32 = 16.0;
 /// Horizontal gap between a control row and its parent section's side walls.
-const CONTROL_INSET: f32 = 12.0;
+const CONTROL_INSET: f32 = 8.0;
 /// A row's inset from the plate: the section margin plus the controls' inset within
 /// the section, so bare rows above the first section align with wrapped ones.
 const ROW_X_INSET: f32 = SECTION_MARGIN + CONTROL_INSET;
@@ -621,7 +621,9 @@ impl ParametersBg {
                 };
                 labels.push(TextLabel {
                     text: name.clone(),
-                    x: self.rect.x + 12.0,
+                    // 8px in from the title box's left edge — the inset
+                    // `section_title_box`'s width math centers against.
+                    x: self.rect.x + SECTION_MARGIN + 8.0,
                     y,
                     font_size,
                     color: [0xee, 0xee, 0xf0],