-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
UIAll things user interface relatedAll things user interface relatedenhancementNew feature or requestNew feature or requestlambda-rsIssues pertaining to the core frameworkIssues pertaining to the core framework
Description
Overview
Add a panel widget that provides a visual container for grouping other widgets
with optional background and border.
Current State
No response
Scope
Goals:
- Container for child widgets
- Optional background color
- Optional border
- Corner radius option
Non-Goals:
- Complex borders
- Shadows
- Scrolling
Proposed API
pub struct Panel {
children: Vec<Box<dyn Widget>>,
background: Option<[f32; 4]>,
border_color: Option<[f32; 4]>,
border_width: f32,
corner_radius: f32,
}
impl Panel {
pub fn new() -> Self;
pub fn with_background(self, color: [f32; 4]) -> Self;
pub fn with_border(self, color: [f32; 4], width: f32) -> Self;
pub fn with_corner_radius(self, radius: f32) -> Self;
pub fn add_child(&mut self, widget: impl Widget + 'static);
}
impl Widget for Panel {
fn render(&self, ctx: &mut UiRenderContext) -> Vec<RenderCommand>;
fn hit_test(&self, x: f32, y: f32) -> bool;
}Acceptance Criteria
- Panel renders background color
- Border renders with specified width/color
- Corner radius rounds corners
- Children render within panel bounds
- Hit test considers panel bounds
Affected Crates
lambda-rs
Notes
- Rounded rectangles need custom shader or geometry
- Consider 9-slice for complex backgrounds
Metadata
Metadata
Assignees
Labels
UIAll things user interface relatedAll things user interface relatedenhancementNew feature or requestNew feature or requestlambda-rsIssues pertaining to the core frameworkIssues pertaining to the core framework