[][src]Function nannou::ui::prelude::widget::default_x_dimension

pub fn default_x_dimension<W>(widget: &W, ui: &Ui) -> Dimension where
    W: Widget

Determines the default Dimension for a Widget.

This function checks for a default dimension in the following order.

  1. Check for a default value within the Ui's Theme.
  2. Otherwise attempts to copy the dimension of the previously set widget if there is one.
  3. Otherwise attempts to copy the dimension of our parent widget.
  4. If no parent widget can be inferred, the window dimensions are used.

This is called by the default implementations of Widget::default_x_dimension.

If you wish to override Widget::default_x_dimension, feel free to call this function internally if you partly require the bahaviour of the default implementations.