pub struct Spacing {Show 20 fields
pub item_spacing: Vec2,
pub window_margin: Margin,
pub button_padding: Vec2,
pub menu_margin: Margin,
pub indent: f32,
pub interact_size: Vec2,
pub slider_width: f32,
pub slider_rail_height: f32,
pub combo_width: f32,
pub text_edit_width: f32,
pub icon_width: f32,
pub icon_width_inner: f32,
pub icon_spacing: f32,
pub default_area_size: Vec2,
pub tooltip_width: f32,
pub menu_width: f32,
pub menu_spacing: f32,
pub indent_ends_with_horizontal_line: bool,
pub combo_height: f32,
pub scroll: ScrollStyle,
}
Expand description
Controls the sizes and distances between widgets.
Fields§
§item_spacing: Vec2
Horizontal and vertical spacing between widgets.
To add extra space between widgets, use Ui::add_space
.
item_spacing
is inserted after adding a widget, so to increase the spacing between
widgets A
and B
you need to change item_spacing
before adding A
.
window_margin: Margin
Horizontal and vertical margins within a window frame.
Button size is text size plus this on each side
Horizontal and vertical margins within a menu frame.
indent: f32
Indent collapsing regions etc by this much.
interact_size: Vec2
Minimum size of a DragValue
, color picker button, and other small widgets.
interact_size.y
is the default height of button, slider, etc.
Anything clickable should be (at least) this size.
slider_width: f32
Default width of a Slider
.
slider_rail_height: f32
Default rail height of a Slider
.
combo_width: f32
Default (minimum) width of a ComboBox
.
text_edit_width: f32
Default width of a crate::TextEdit
.
icon_width: f32
Checkboxes, radio button and collapsing headers have an icon at the start. This is the width/height of the outer part of this icon (e.g. the BOX of the checkbox).
icon_width_inner: f32
Checkboxes, radio button and collapsing headers have an icon at the start. This is the width/height of the inner part of this icon (e.g. the check of the checkbox).
icon_spacing: f32
Checkboxes, radio button and collapsing headers have an icon at the start. This is the spacing between the icon and the text
default_area_size: Vec2
The size used for the Ui::max_rect
the first frame.
Text will wrap at this width, and images that expand to fill the available space will expand to this size.
If the contents are smaller than this size, the area will shrink to fit the contents. If the contents overflow, the area will grow.
tooltip_width: f32
Width of a tooltip (on_hover_ui
, on_hover_text
etc).
The default wrapping width of a menu.
Items longer than this will wrap to a new line.
Horizontal distance between a menu and a submenu.
indent_ends_with_horizontal_line: bool
End indented regions with a horizontal line
combo_height: f32
Height of a combo-box before showing scroll bars.
scroll: ScrollStyle
Controls the spacing of a crate::ScrollArea
.
Implementations§
Trait Implementations§
§impl<'de> Deserialize<'de> for Spacing
impl<'de> Deserialize<'de> for Spacing
§fn deserialize<__D>(
__deserializer: __D
) -> Result<Spacing, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Spacing, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Serialize for Spacing
impl Serialize for Spacing
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Spacing
Auto Trait Implementations§
impl Freeze for Spacing
impl RefUnwindSafe for Spacing
impl Send for Spacing
impl Sync for Spacing
impl Unpin for Spacing
impl UnwindSafe for Spacing
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
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request