GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
treelist: paint container border as a true ring, not fill-plus-cover
The container border was a full-pane rect in border_color with the
background quad painted 1px inset on top — the border only ever showed
as the sliver the background didn't cover. With a transparent
tree background_color the mask vanished and the whole pane washed in
border_color (and would flip to the hover/focus colors whole-pane).
Emit a Prim::Border instead: rounded fill + solid ring
(push_plate_solid_border_vertices), which composes with any background
alpha including zero. The borderless branch is unchanged.
Co-Authored-By: Claude Fable 5 <[email protected]>
src/widget/container/treelist.rs | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/widget/container/treelist.rs b/src/widget/container/treelist.rs
index b6c2c6a..f6cb0b0 100644
--- a/src/widget/container/treelist.rs
+++ b/src/widget/container/treelist.rs
@@ -753,10 +753,19 @@ impl Paint for TreeList {
c
};
- // 1. Draw container border and background
+ // 1. Draw container border and background. A true fill + border ring
+ // (not the legacy full-rect border punched out by the background quad,
+ // which read as a whole-pane border_color wash once the background
+ // went transparent).
if let Some((border_color, thickness)) = self.tree_border() {
- quads.push((x, y, w, h, radius, apply_opacity(border_color), (r1, r2, r3, r4)));
- quads.push((x + thickness, y + thickness, w - 2.0 * thickness, h - 2.0 * thickness, radius - thickness, apply_opacity(crate::color::tree_background_color()), (r1, r2, r3, r4)));
+ let rr = |on: bool| if on { radius } else { 0.0 };
+ pc.border(
+ Rect { x, y, width: w, height: h },
+ (rr(r1), rr(r2), rr(r3), rr(r4)),
+ apply_opacity(crate::color::tree_background_color()),
+ apply_opacity(border_color),
+ thickness,
+ );
} else {
quads.push((x, y, w, h, radius, apply_opacity(crate::color::tree_background_color()), (r1, r2, r3, r4)));
}