desktop grid client
git clone https://git.lucas.co/cce-grid.git
lines: style.surface.desktop.line_relief overrides the lip width
Grid-specific relief knob: logical px for the rail lip, 0 = no lip,
unset (or negative) = follow the DE-wide relief material
(layout::bevel_width clamped to a quarter of the gap) as before. Lets
the grid go lipless — or heavier — without flattening backplate edges
everywhere via the shared material keys.
Co-Authored-By: Claude Fable 5 <[email protected]>
CLAUDE.md | 4 +++-
src/main.rs | 41 ++++++++++++++++++++++++++++-------------
2 files changed, 31 insertions(+), 14 deletions(-)
diff --git a/CLAUDE.md b/CLAUDE.md
index 2ddcdda..98b43dc 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -21,7 +21,9 @@ half-gap, so the walls occupy exactly the half-rail around each cell
and neighboring rings abut without double-shading. Cell floors carry NO
relief (user decision); the rails read as raised grout. The compositor
fallback draws the same expanded-ring chamfer so the client latch never
-swaps the grid's material. It reads the same `style.surface.desktop.*` /
+swaps the grid's material. `style.surface.desktop.line_relief` overrides
+the lip width in logical px for the grid alone (0 = no lip; unset =
+follow the DE-wide relief material) — both renderers honor it. It reads the same `style.surface.desktop.*` /
backplate-radius keys as the fallback. Keep it that way — no camera
state, no timers, no input (the surface is input-transparent
compositor-side).
diff --git a/src/main.rs b/src/main.rs
index 7d90fe2..002eb75 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -47,6 +47,10 @@ struct Style {
corner_radius: f64,
gap_color: [f32; 4],
cell_color: [f32; 4],
+ /// Grid-line lip width in virtual units; None = follow the DE-wide
+ /// relief material (`layout::bevel_width` clamped to the rail), 0 = no
+ /// lip. Negative config values mean unset.
+ line_relief: Option<f64>,
}
fn style() -> Style {
@@ -70,6 +74,10 @@ fn style() -> Style {
get_color("/style/surface/desktop/cell_color")
.unwrap_or([0.0, 0.0, 0.0, 1.0]),
),
+ line_relief: match get_i64("/style/surface/desktop/line_relief", -1) {
+ v if v < 0 => None,
+ v => Some(v as f64),
+ },
}
}
@@ -119,9 +127,14 @@ impl GridApp {
// read far heavier than any plate edge in the toolkit.) Rings stay
// inside their own half-rail, so neighbors never overlap; the outer
// radius offsets by the roll to stay concentric with the cell arc.
- let roll = (cce_ui::layout::bevel_width() as f64)
- .min(st.gap_width * 0.25)
+ // style.surface.desktop.line_relief overrides the roll width
+ // outright (0 = no lip) without touching the DE-wide material.
+ let roll = st
+ .line_relief
+ .unwrap_or_else(|| (cce_ui::layout::bevel_width() as f64).min(st.gap_width * 0.25))
+ .max(0.0)
* s;
+ let lip = roll >= 0.5;
let ring_radius = radius + roll as f32;
let ring_depth = (roll as f32).max(1.0);
@@ -147,17 +160,19 @@ impl GridApp {
height: (len * s) as f32,
};
pc.rounded_rect(rect, radius, (true, true, true, true), st.cell_color);
- let ring = Rect {
- x: rect.x - roll as f32,
- y: rect.y - roll as f32,
- width: rect.width + 2.0 * roll as f32,
- height: rect.height + 2.0 * roll as f32,
- };
- pc.recess(
- ring,
- (ring_radius, ring_radius, ring_radius, ring_radius),
- ring_depth,
- );
+ if lip {
+ let ring = Rect {
+ x: rect.x - roll as f32,
+ y: rect.y - roll as f32,
+ width: rect.width + 2.0 * roll as f32,
+ height: rect.height + 2.0 * roll as f32,
+ };
+ pc.recess(
+ ring,
+ (ring_radius, ring_radius, ring_radius, ring_radius),
+ ring_depth,
+ );
+ }
}
}
}