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>) -> Widget
pub fn on_click(self, ev: impl Into<String>) -> Widget
pub fn child(self, w: Widget) -> Widget
pub fn w(self, w: f32) -> Widget
pub fn h(self, h: f32) -> Widget
pub fn min_w(self, v: f32) -> Widget
pub fn min_h(self, v: f32) -> Widget
pub fn flex(self, v: f32) -> Widget
pub fn flex_dir(self, v: FlexDir) -> Widget
pub fn gap(self, v: f32) -> Widget
pub fn bg(self, v: u32) -> Widget
pub fn color(self, v: u32) -> Widget
pub fn align(self, v: Align) -> Widget
pub fn font_scale(self, v: f32) -> Widget
pub fn padding(self, top: f32, right: f32, bottom: f32, left: f32) -> Widget
pub fn margin(self, top: f32, right: f32, bottom: f32, left: f32) -> Widget
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