pub struct Widget {
pub kind: WidgetKind,
pub id: Option<String>,
pub style: Style,
pub flex_dir: FlexDir,
pub children: Vec<Widget>,
pub on_click: Option<String>,
}Expand description
A single widget in the UI tree.
Fields§
§kind: WidgetKind§id: Option<String>§style: Style§flex_dir: FlexDir§children: Vec<Widget>§on_click: Option<String>Implementations§
Source§impl Widget
impl Widget
pub fn id(self, id: impl Into<String>) -> Self
pub fn on_click(self, ev: impl Into<String>) -> Self
pub fn child(self, w: Widget) -> Self
pub fn w(self, w: f32) -> Self
pub fn h(self, h: f32) -> Self
pub fn min_w(self, v: f32) -> Self
pub fn min_h(self, v: f32) -> Self
pub fn flex(self, v: f32) -> Self
pub fn flex_dir(self, v: FlexDir) -> Self
pub fn gap(self, v: f32) -> Self
pub fn bg(self, v: u32) -> Self
pub fn color(self, v: u32) -> Self
pub fn align(self, v: Align) -> Self
pub fn font_scale(self, v: f32) -> Self
pub fn padding(self, top: f32, right: f32, bottom: f32, left: f32) -> Self
pub fn margin(self, top: f32, right: f32, bottom: f32, left: f32) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Widget
impl RefUnwindSafe for Widget
impl Send for Widget
impl Sync for Widget
impl Unpin for Widget
impl UnsafeUnpin for Widget
impl UnwindSafe for Widget
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more