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

commit25cf868f5d9fb769399554cb510df2d788d20af8
parentcb1629b392
authorLucas Galante <[email protected]>
date2026-07-04 22:26
Support window_manager.bevel_depth configuration key and dynamically evaluate bevel depth in push_plate_bevel_vertices

 src/backend/window_runner.rs | 2 +-
 src/layout.rs                | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/backend/window_runner.rs b/src/backend/window_runner.rs
index 188de56..5717437 100644
--- a/src/backend/window_runner.rs
+++ b/src/backend/window_runner.rs
@@ -646,7 +646,7 @@ pub fn push_plate_bevel_vertices(
     let ly = -rad.sin();
 
     let edge_color = |factor: f32| -> [f32; 4] {
-        let max_offset = 0.15;
+        let max_offset = crate::layout::bevel_depth();
         let offset = factor * max_offset;
         [
             (base_color[0] + offset).clamp(0.0, 1.0),
diff --git a/src/layout.rs b/src/layout.rs
index 63c9893..e081911 100644
--- a/src/layout.rs
+++ b/src/layout.rs
@@ -106,6 +106,7 @@ fn flatten_json_to_flat_props(val: &serde_json::Value, prefix: &str, flat_props:
                 "style.control.toggle.border_color" => "toggle_border_color",
                 "style.control.toggle.corner_radius" => "toggle_corner_radius",
                 "window_manager.light_source_position" => "light_source_position",
+                "window_manager.bevel_depth" => "bevel_depth",
                 "style.control.ramp.height" => "ramp_height",
                 "style.status.normal_color" => "status_normal_color",
                 "style.status.background_color" => "status_background_color",
@@ -1417,6 +1418,10 @@ pub fn light_source_position() -> f32 {
     get_style_registry().read().unwrap().get_float("light_source_position").unwrap_or(135.0)
 }
 
+pub fn bevel_depth() -> f32 {
+    get_style_registry().read().unwrap().get_float("bevel_depth").unwrap_or(0.15)
+}
+
 pub fn toggle_corner_radius() -> f32 {
     lazy_init_style_registry();
     get_style_registry().read().unwrap().get_float("toggle_corner_radius").unwrap_or(4.0)