file manager
git clone https://git.lucas.co/cce-files.git
style: the context menu is frosted glass of the host plate's material
The menu carried popover_bg_color — a near-black chip of its own, opaque
against the slate it floats on. It now takes the HOST plate's face:
cce-files has exactly one plate a menu can open on (the root window
plate), and root_plate_opacity is defined as page_low_color()[3], so
that getter IS the plate's fill. Reading it means the menu inherits both
the color and the configured translucency from the surface beneath it
rather than from a second constant that has to be kept in step.
Translucent alone would leave the labels legible by luck, so the face
also carries the blur-behind sentinel (negative alpha): Prim::Plate
snapshots the frame-so-far and frosts it, which is what holds contrast
over live content. This is the breadcrumb raised run's treatment, and
the degradation is copied with it — a fully transparent configured fill
falls back to the edges-only boss, because a plate with no face to tint
paints a hole.
Verified against a plasma image behind the menu: the noise is sharp
outside the rounded edge and a smooth wash inside. Worth capturing since
every earlier check had flat color behind the menu, where a frosted
surface and an unfrosted one are indistinguishable.
The option labels move to the toolkit's semantic colors (TEXT_DIM /
TEXT_FG / TEXT_HEADER). Not drift: the header's hand-mixed 0.44 grey was
one step above the old near-black face and all but vanished on slate.
Note what the frost can hold. The snapshot is the frame so far, and this
app draws every widget before any text, so fills and images reach it and
text never does. That is invisible only because occlude_against already
discards text under the menu — the two agree by coincidence, not by
construction.
Co-Authored-By: Claude Fable 5 <[email protected]>
src/main.rs | 36 ++++++++++++++++++++++++++----------
1 file changed, 26 insertions(+), 10 deletions(-)
diff --git a/src/main.rs b/src/main.rs
index fc85540..e2c3e53 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -713,14 +713,26 @@ impl FilesystemApp {
let cw = self.context_menu.w;
let ch = self.context_menu.h;
- // The menu is a lit plate, the same material as the panes it floats
- // over: a rounded face plus the rolled perimeter, one primitive. It
- // used to be a flat fill inside a 1px border rect with a Boss rim
- // laid over the top — three marks for one edge, and the rim's hard
- // light/dark frame at radius 0 read as a drawn box rather than a
- // surface with a lit edge.
+ // The menu is a lit plate of the same material as the surface it
+ // opens on: it takes the HOST plate's face rather than a popover
+ // color of its own, and floats as frosted glass — the configured
+ // translucency plus the blur-behind sentinel (negative alpha), which
+ // is the breadcrumb's raised-run treatment. The frost is not
+ // decoration at this alpha: it is what keeps the labels readable
+ // over live content instead of over a legible-by-luck backdrop.
+ //
+ // A fully transparent host fill degrades to the edges-only boss,
+ // exactly as the raised run does — with no face to tint, a plate
+ // would paint a hole.
let menu_r = cce_ui::layout::plate_corner_radius();
- context_menu_pc.plate(cce_ui::color::popover_bg_color(), cx, cy, cw, ch, menu_r);
+ let face = cce_ui::color::page_low_color();
+ if face[3] > 0.001 {
+ let mut frosted = face;
+ frosted[3] = -frosted[3];
+ context_menu_pc.plate(frosted, cx, cy, cw, ch, menu_r);
+ } else {
+ context_menu_pc.relief_raised(cx, cy, cw, ch, menu_r);
+ }
// Hover highlight, inset off the roll so it sits on the face rather
// than climbing the lit edge. The last row is the only one that meets
// a rounded corner (row 0 is the header and never highlights), so it
@@ -742,12 +754,16 @@ impl FilesystemApp {
// Text options
for (idx, (opt, _)) in self.context_menu.options.iter().enumerate() {
let iy = cy + idx as f32 * ROW_H + (ROW_H - 12.0) / 2.0;
+ // The toolkit's semantic text colors, not the hand-mixed greys
+ // that came with the near-black popover face: the header's old
+ // 0.44 grey was a step above black and all but vanishes on the
+ // plate's own mid-slate.
let text_color = if idx == 0 {
- [0.44, 0.44, 0.47, 1.0]
+ cce_ui::color::TEXT_DIM
} else if self.context_menu.hovered == Some(idx) {
- [1.0, 1.0, 1.0, 1.0]
+ cce_ui::color::TEXT_HEADER
} else {
- [0.8, 0.8, 0.83, 1.0]
+ cce_ui::color::TEXT_FG
};
context_menu_pc.text(opt, cx + 8.0, iy, 12.0, text_color);
}