Struct widgetry::Widget [−][src]
pub struct Widget { pub(crate) widget: Box<dyn WidgetImpl>, layout: LayoutStyle, pub(crate) rect: ScreenRectangle, bg: Option<Drawable>, bg_batch: Option<GeomBatch>, id: Option<String>, }
Fields
widget: Box<dyn WidgetImpl>
layout: LayoutStyle
rect: ScreenRectangle
bg: Option<Drawable>
bg_batch: Option<GeomBatch>
id: Option<String>
Implementations
impl Widget
[src]
impl Widget
[src]pub fn centered(self) -> Widget
[src]
pub fn centered_horiz(self) -> Widget
[src]
pub fn centered_vert(self) -> Widget
[src]
pub fn centered_cross(self) -> Widget
[src]
pub fn evenly_spaced(self) -> Widget
[src]
pub fn fill_width(self) -> Widget
[src]
pub fn fill_height(self) -> Widget
[src]
pub fn flex_wrap(self, ctx: &EventCtx<'_>, width: Percent) -> Widget
[src]
This one is really weird. percent_width should be LESS than the max_size_percent given to the overall Panel, otherwise weird things happen. Only makes sense for rows/columns.
pub fn flex_wrap_no_inner_spacing(
self,
ctx: &EventCtx<'_>,
width: Percent
) -> Widget
[src]
self,
ctx: &EventCtx<'_>,
width: Percent
) -> Widget
Like flex_wrap, but doesn’t horizontally space out widgets on the same row.
pub fn force_width(self, width: f64) -> Widget
[src]
Only for rows/columns. Used to force table columns to line up.
pub fn force_width_window_pct(
self,
ctx: &EventCtx<'_>,
width: Percent
) -> Widget
[src]
self,
ctx: &EventCtx<'_>,
width: Percent
) -> Widget
pub fn force_width_parent_pct(self, width: f64) -> Widget
[src]
pub fn get_width_for_forcing(&self) -> f64
[src]
Needed for force_width.
pub fn bg(self, color: Color) -> Widget
[src]
pub fn outline(self, style: OutlineStyle) -> Widget
[src]
Callers have to adjust padding too, probably
pub fn corner_rounding<R: Into<CornerRounding>>(self, value: R) -> Widget
[src]
pub fn container(self) -> Widget
[src]
Things like padding don’t work on many widgets, so just make a convenient way to wrap in a row/column first
pub fn section(self, ctx: &EventCtx<'_>) -> Widget
[src]
pub fn tab_body(self, ctx: &EventCtx<'_>) -> Widget
[src]
pub fn padding<I: Into<EdgeInsets>>(self, insets: I) -> Widget
[src]
pub fn padding_top(self, pixels: usize) -> Widget
[src]
pub fn padding_left(self, pixels: usize) -> Widget
[src]
pub fn padding_bottom(self, pixels: usize) -> Widget
[src]
pub fn padding_right(self, pixels: usize) -> Widget
[src]
pub fn margin<I: Into<EdgeInsets>>(self, insets: I) -> Widget
[src]
pub fn margin_above(self, pixels: usize) -> Widget
[src]
pub fn margin_below(self, pixels: usize) -> Widget
[src]
pub fn margin_left(self, pixels: usize) -> Widget
[src]
pub fn margin_right(self, pixels: usize) -> Widget
[src]
pub fn margin_horiz(self, pixels: usize) -> Widget
[src]
pub fn margin_vert(self, pixels: usize) -> Widget
[src]
pub fn align_left(self) -> Widget
[src]
pub fn align_right(self) -> Widget
[src]
pub fn align_bottom(self) -> Widget
[src]
pub fn align_vert_center(self) -> Widget
[src]
This doesn’t count against the entire container
fn abs(self, x: f64, y: f64) -> Widget
[src]
pub fn named<I: Into<String>>(self, id: I) -> Widget
[src]
impl Widget
[src]
impl Widget
[src]pub(crate) fn new(widget: Box<dyn WidgetImpl>) -> Widget
[src]
pub fn dropdown<T: 'static + PartialEq + Clone + Debug, I: AsRef<str>>(
ctx: &EventCtx<'_>,
label: I,
default_value: T,
choices: Vec<Choice<T>>
) -> Widget
[src]
ctx: &EventCtx<'_>,
label: I,
default_value: T,
choices: Vec<Choice<T>>
) -> Widget
pub fn custom_row(widgets: Vec<Widget>) -> Widget
[src]
Creates a row with the specified widgets. No margins or other layouting is applied.
pub fn row(widgets: Vec<Widget>) -> Widget
[src]
Creates a row with the specified widgets. Every member gets a default horizontal margin.
pub fn evenly_spaced_row(spacing: usize, widgets: Vec<Widget>) -> Widget
[src]
Creates a row with the specified widgets, with a spacing
sized margin between members
pub fn custom_col(widgets: Vec<Widget>) -> Widget
[src]
Creates a column with the specified widgets. No margins or other layouting is applied.
pub fn evenly_spaced_col(spacing: usize, widgets: Vec<Widget>) -> Widget
[src]
Creates a column with the specified widgets, with a spacing
sized margin between members
pub fn col(widgets: Vec<Widget>) -> Widget
[src]
Creates a column with the specified widgets. Every member gets a default vertical margin.
pub fn nothing() -> Widget
[src]
pub fn into_geom(
self,
ctx: &EventCtx<'_>,
exact_pct_width: Option<f64>
) -> (GeomBatch, Polygon)
[src]
self,
ctx: &EventCtx<'_>,
exact_pct_width: Option<f64>
) -> (GeomBatch, Polygon)
pub fn horiz_separator(
ctx: &mut EventCtx<'_>,
pct_container_width: f64
) -> Widget
[src]
ctx: &mut EventCtx<'_>,
pct_container_width: f64
) -> Widget
pub fn vert_separator(ctx: &mut EventCtx<'_>, height_px: f64) -> Widget
[src]
impl Widget
[src]
impl Widget
[src]pub(crate) fn draw(&self, g: &mut GfxCtx<'_>)
[src]
fn get_flexbox(
&self,
parent: Node,
stretch: &mut Stretch,
nodes: &mut Vec<Node>
)
[src]
&self,
parent: Node,
stretch: &mut Stretch,
nodes: &mut Vec<Node>
)
fn apply_flexbox(
&mut self,
stretch: &Stretch,
nodes: &mut Vec<Node>,
dx: f64,
dy: f64,
scroll_offset: (f64, f64),
ctx: &EventCtx<'_>,
recompute_layout: bool,
defer_draw: bool
)
[src]
&mut self,
stretch: &Stretch,
nodes: &mut Vec<Node>,
dx: f64,
dy: f64,
scroll_offset: (f64, f64),
ctx: &EventCtx<'_>,
recompute_layout: bool,
defer_draw: bool
)