system settings
git clone https://git.lucas.co/cce-system-interface.git
feat: beveled window plate + recessed status bar (the data-editor glass-slab look)
display_list opens with pc.plate() (rolled, lit perimeter at the app's
plate color) and carves the status bar's top edge in with
pc.recess_edges(), replacing the flat plate quad and the bar's opaque
background strip — the plate now shows through the bar as a step.
Co-Authored-By: Claude Fable 5 <[email protected]>
src/main.rs | 20 ++++++++++++++++++++
src/renderer.rs | 15 +++++----------
2 files changed, 25 insertions(+), 10 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index 3e82827..0b41210 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -252,6 +252,26 @@ impl cce_ui::engine::Application for SystemInterface {
}
use cce_ui::scene::layout::Rect;
let mut pc = cce_ui::scene::paint::PaintCtx::new();
+
+ // One glass slab (data-editor's idiom): the beveled window plate, with the
+ // status bar carved into it as a step — everything else paints on top.
+ {
+ let mut plate = cce_ui::color::to_linear([0x0a as f32 / 255.0, 0x1a as f32 / 255.0, 0x0e as f32 / 255.0, 1.0]);
+ if plate[3] > 0.001 {
+ plate[3] = cce_ui::color::active_backplate_opacity();
+ }
+ let r = 12.0f32;
+ pc.plate(Rect { x: 0.0, y: 0.0, width, height }, (r, r, r, r), plate, cce_ui::layout::bevel_width());
+ let sb_h = self.status_height;
+ let depth = cce_ui::layout::bar_wall_width().min(sb_h * 0.6);
+ pc.recess_edges(
+ Rect { x: 0.0, y: height - sb_h, width, height: sb_h },
+ (0.0, 0.0, 0.0, 0.0),
+ depth,
+ (true, false, false, false),
+ );
+ }
+
for w in &self.widgets {
let color = if w.hovering { w.hover_color } else { w.color };
let rect = Rect { x: w.x, y: w.y, width: w.w, height: w.h };
diff --git a/src/renderer.rs b/src/renderer.rs
index a59463a..e9cbca0 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -183,23 +183,18 @@ impl SystemInterface {
collect_window_child(&self.page_scroll_bar, &self.ui_context, logical_sw, logical_sh, plate_radius, &mut plain, &mut rounded, &mut wtexts);
- // The dissolved status bar's slot in the child order.
- let sb_y = logical_sh - self.status_height;
- let sb_theme = cce_ui::colors::backplate_statusbar_color();
- let sb_bg = if sb_theme[3] > 0.001 { sb_theme } else { cce_ui::color::STATUS_BG };
- rounded.push((sb_bg, 0.0, sb_y, logical_sw, self.status_height, plate_radius, (false, false, true, true)));
+ // The status bar has no background of its own anymore: the beveled window
+ // plate shows through and display_list carves its recess (data-editor's
+ // with_recess idiom).
collect_window_child(&self.page_dropdown, &self.ui_context, logical_sw, logical_sh, plate_radius, &mut plain, &mut rounded, &mut wtexts);
if self.search_open {
collect_window_child(&self.search_box, &self.ui_context, logical_sw, logical_sh, plate_radius, &mut plain, &mut rounded, &mut wtexts);
}
+ // The window plate itself is emitted by display_list as a beveled
+ // pc.plate() prim, under everything collected here.
window_pc.rects.extend(plain);
- let mut plate = cce_ui::color::to_linear([0x0a as f32 / 255.0, 0x1a as f32 / 255.0, 0x0e as f32 / 255.0, 1.0]);
- if plate[3] > 0.001 {
- plate[3] = cce_ui::color::active_backplate_opacity();
- }
- window_pc.rects.push((plate, 0.0, 0.0, logical_sw, logical_sh, plate_radius, (true, true, true, true)));
window_pc.rects.extend(rounded);
window_pc.texts.extend(wtexts);
}