GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
style: wider graph-to-strip gap in the ramp; section corner radius doubled
The ramp's control strip drops 12px lower (STRIP_RESERVE 70 → 82, one
named constant + graph_h() replacing seven scattered `h - 70` computations)
so the graph opening's rim shading gets a clear band of plate before the
label tabs' carves. SECTION_R 4 → 8 rounds the params sections' tabs and
wells.
Co-Authored-By: Claude Fable 5 <[email protected]>
src/widget/container/parameters_bg.rs | 2 +-
src/widget/input/ramp.rs | 26 ++++++++++++++++++--------
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/src/widget/container/parameters_bg.rs b/src/widget/container/parameters_bg.rs
index 37b1cd8..4f0fb54 100644
--- a/src/widget/container/parameters_bg.rs
+++ b/src/widget/container/parameters_bg.rs
@@ -90,7 +90,7 @@ const CONTENT_BOX_PAD: f32 = CHANNEL;
/// concave (inner) corners where the neck joins the title and content boxes.
const SECTION_BORDER_COLOR: [f32; 4] = [0.18, 0.18, 0.27, 1.0];
const SECTION_BORDER_T: f32 = 1.0;
-const SECTION_R: f32 = 4.0;
+const SECTION_R: f32 = 8.0;
/// The throat — the concave fillet where the tab's right side turns onto the content
/// body's top edge (the tab sits flush on the body; there is no connector neck).
const SECTION_THROAT_R: f32 = 3.0;
diff --git a/src/widget/input/ramp.rs b/src/widget/input/ramp.rs
index 02da506..a33f3ba 100644
--- a/src/widget/input/ramp.rs
+++ b/src/widget/input/ramp.rs
@@ -760,6 +760,16 @@ impl Input for ColorRamp {
}
impl Ramp {
+ /// Vertical reserve under the curve area for the control strip (gap, label
+ /// tabs, controls, bottom margin) — the graph gets the rest. Sized so the
+ /// graph opening's rim shading stays clear of the label tabs' carves.
+ const STRIP_RESERVE: f32 = 82.0;
+
+ /// The curve area's height for a widget `h` tall.
+ fn graph_h(h: f32) -> f32 {
+ (h - Self::STRIP_RESERVE).max(30.0)
+ }
+
/// The detached-label strip height the labeled dropdowns carry
/// (`Widget::label_offset`'s formula).
fn label_strip() -> f32 {
@@ -779,9 +789,9 @@ impl Ramp {
/// strings and used to clip.
fn arrange_fields(&mut self) {
let (x, y, w, h) = (self.base.x, self.base.y, self.base.w, self.base.h);
- let gh = (h - 70.0).max(30.0);
+ let gh = Self::graph_h(h);
let graph_bottom = y + 10.0 + gh;
- let ctrl_y = graph_bottom + 28.0;
+ let ctrl_y = graph_bottom + 40.0;
let ctrl_h = 22.0;
let strip = Self::label_strip();
let (dd_y, dd_h) = (ctrl_y - strip, ctrl_h + strip);
@@ -862,7 +872,7 @@ impl Paint for Ramp {
// behind the plate, with the recess wall (drawn after the content, so
// its shading falls across the graph's edges) as the cut's bevel.
let graph = {
- let gh = (self.base.h - 70.0).max(30.0);
+ let gh = Self::graph_h(self.base.h);
Rect { x: self.base.x + 10.0, y: self.base.y + 10.0, width: self.base.w - 20.0, height: gh }
};
let graph_radius = 6.0f32;
@@ -875,7 +885,7 @@ impl Paint for Ramp {
let quads: Vec<(f32, f32, f32, f32, [f32; 4])> = {
let mut quads = Vec::new();
- let gh = (self.base.h - 70.0).max(30.0);
+ let gh = Self::graph_h(self.base.h);
let track_x = self.base.x + 10.0;
let track_w = self.base.w - 20.0;
@@ -917,7 +927,7 @@ impl Paint for Ramp {
// The curve itself: one anti-aliased round-capped polyline — exact
// key-to-key segments in linear mode, dense samples under smoothstep
// blending. Constant-value extensions reach the graph's side walls.
- let gh = (self.base.h - 70.0).max(30.0);
+ let gh = Self::graph_h(self.base.h);
let track_x = self.base.x + 10.0;
let track_w = self.base.w - 20.0;
let curve_color = [0.5, 0.75, 1.0, 1.0];
@@ -951,7 +961,7 @@ impl Paint for Ramp {
}
let circles: Vec<(f32, f32, f32, [f32; 4])> = {
let mut circles = Vec::new();
- let gh = (self.base.h - 70.0).max(30.0);
+ let gh = Self::graph_h(self.base.h);
let track_x = self.base.x + 10.0;
let track_w = self.base.w - 20.0;
@@ -1077,7 +1087,7 @@ impl Input for Ramp {
return true;
}
- let gh = (self.base.h - 70.0).max(30.0);
+ let gh = Self::graph_h(self.base.h);
let track_x = self.base.x + 10.0;
let track_w = self.base.w - 20.0;
@@ -1164,7 +1174,7 @@ impl Input for Ramp {
}
let mut changed = false;
- let gh = (self.base.h - 70.0).max(30.0);
+ let gh = Self::graph_h(self.base.h);
let track_x = self.base.x + 10.0;
let track_w = self.base.w - 20.0;