More text improvements, performance enhancements, input handling, text selection, wl cursors

This commit is contained in:
2026-03-20 22:24:29 -04:00
parent d79a3bb728
commit 423df4ae1f
15 changed files with 2458 additions and 265 deletions

View File

@@ -20,6 +20,13 @@ pub enum FlexDirection {
Column,
}
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum CursorIcon {
Default,
Pointer,
Text,
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Edges {
pub top: f32,
@@ -65,6 +72,7 @@ pub struct Style {
pub padding: Edges,
pub background: Option<Color>,
pub pointer_events: bool,
pub cursor: Option<CursorIcon>,
}
impl Default for Style {
@@ -78,6 +86,7 @@ impl Default for Style {
padding: Edges::ZERO,
background: None,
pointer_events: true,
cursor: None,
}
}
}
@@ -189,6 +198,11 @@ impl Element {
self
}
pub fn cursor(mut self, cursor: CursorIcon) -> Self {
self.style.cursor = Some(cursor);
self
}
pub fn child(mut self, child: Element) -> Self {
self.assert_container();
self.children.push(child);