file manager
git clone https://git.lucas.co/cce-files.git
fix: the focused plate's ring reaches the page target
The pages' RenderTarget mirrors the bridge's relief into its own effect list;
inset_plate_tinted lands as RELIEF_INSET_FOCUS → WidgetFx::InsetFocus, the
flush plate with its rim lit, so a Tab-focused breadcrumb or dropdown shows
its ring.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
src/main.rs | 7 +++++++
src/pages/mod.rs | 10 ++++++++++
2 files changed, 17 insertions(+)
diff --git a/src/main.rs b/src/main.rs
index 31afd5f..04cb75c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -190,6 +190,9 @@ enum WidgetFx {
/// A flush inset control (buttons): groove ring carved down around the
/// rect, beveled lip back up inside, face level with the surface.
Inset(f32),
+ /// [`WidgetFx::Inset`] with keyboard focus: the rim lit in the highlight —
+ /// the ring a focused control plate wears.
+ InsetFocus(f32),
/// A GPU-textured quad; the id comes from `cce_ui::vk::upload_rgba`
/// (the preview pane's image). `color` is unused.
Image { id: u32, alpha: f32 },
@@ -963,6 +966,7 @@ impl FilesystemApp {
fx: match *kind {
pages::RELIEF_RAISED => WidgetFx::Boss(*rd),
pages::RELIEF_INSET => WidgetFx::Inset(*rd),
+ pages::RELIEF_INSET_FOCUS => WidgetFx::InsetFocus(*rd),
pages::RELIEF_RECESSED_FOCUS => WidgetFx::RecessFocus(*rd),
_ => WidgetFx::Recess(*rd),
},
@@ -1616,6 +1620,9 @@ impl Application for FilesystemApp {
pc.recess_tinted(rect, radii, depth, [hc[0], hc[1], hc[2]]);
}
WidgetFx::Inset(depth) => pc.inset_plate(rect, radii, w.color, depth),
+ WidgetFx::InsetFocus(depth) => {
+ pc.inset_plate_tinted(rect, radii, w.color, depth, cce_ui::widget::ControlPlate::focus_tint())
+ }
WidgetFx::Image { id, alpha } => pc.image(id, rect, alpha),
WidgetFx::Groove { ax, ay, bx, by, width, depth } => {
pc.groove((ax, ay), (bx, by), width, depth, rect)
diff --git a/src/pages/mod.rs b/src/pages/mod.rs
index c96642c..66236f5 100644
--- a/src/pages/mod.rs
+++ b/src/pages/mod.rs
@@ -149,6 +149,9 @@ pub const RELIEF_INSET: u8 = 2;
/// wrapped accent glint REPLACING the relief lighting (the DE's one focus
/// language, same treatment as a focused plate's ring).
pub const RELIEF_RECESSED_FOCUS: u8 = 3;
+/// [`RELIEF_INSET`] with keyboard focus: the flush plate's rim lit in the
+/// highlight — the ring a focused control plate wears (`ControlPlate::with_tint`).
+pub const RELIEF_INSET_FOCUS: u8 = 4;
pub struct PageContent {
pub rects: Vec<([f32; 4], f32, f32, f32, f32, f32, (bool, bool, bool, bool))>,
@@ -435,4 +438,11 @@ impl RenderTarget for PageContent {
self.reliefs.push((x, y, w, h, radius, depth, RELIEF_INSET));
}
}
+ /// The focused control plate's ring — same plate, rim lit.
+ fn inset_plate_tinted(&mut self, color: [f32; 4], x: f32, y: f32, w: f32, h: f32, radius: f32, depth: f32, _tint: [f32; 3]) {
+ self.rects.push((color, x, y, w, h, radius, (true, true, true, true)));
+ if cce_ui::layout::control_relief() {
+ self.reliefs.push((x, y, w, h, radius, depth, RELIEF_INSET_FOCUS));
+ }
+ }
}