More text improvements, performance enhancements, input handling, text selection, wl cursors
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user