-
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 label widget for displaying static or dynamic text in the UI.
Current State
No response
Scope
Goals:
- Display text string
- Configurable text alignment
- Dynamic text updates
- Optional text wrapping
Non-Goals:
- Rich text
- Editable text
Proposed API
pub struct Label {
text: String,
font_size: f32,
color: [f32; 4],
align: TextAlign,
wrap: bool,
}
impl Label {
pub fn new(text: &str) -> Self;
pub fn with_size(self, size: f32) -> Self;
pub fn with_color(self, color: [f32; 4]) -> Self;
pub fn with_align(self, align: TextAlign) -> Self;
pub fn with_wrap(self, wrap: bool) -> Self;
pub fn set_text(&mut self, text: &str);
pub fn text(&self) -> &str;
}
impl Widget for Label {
fn render(&self, ctx: &mut UiRenderContext) -> Vec<RenderCommand>;
// Labels don't need complex hit testing
}Acceptance Criteria
- Label displays text
- Font size configurable
- Text color configurable
- Alignment options work
- Text updates reflect immediately
Affected Crates
lambda-rs
Notes
- Consider caching text layout for performance
- May need to relayout when bounds change
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