Struct egui::style::Spacing[][src]

pub struct Spacing {
    pub item_spacing: Vec2,
    pub window_padding: Vec2,
    pub button_padding: Vec2,
    pub indent: f32,
    pub interact_size: Vec2,
    pub slider_width: f32,
    pub text_edit_width: f32,
    pub icon_width: f32,
    pub icon_spacing: f32,
    pub tooltip_width: f32,
}

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_padding: Vec2

Horizontal and vertical padding within a window frame.

button_padding: Vec2

Button size is text size plus this on each side

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 and ComboBox.

text_edit_width: f32

Default width of a TextEdit.

icon_width: f32

Checkboxes, radio button and collapsing headers have an icon at the start. This is the width/height of this icon.

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

tooltip_width: f32

Width of a tooltip (on_hover_ui, on_hover_text etc).

Implementations

impl Spacing[src]

pub fn icon_rectangles(&self, rect: Rect) -> (Rect, Rect)[src]

Returns small icon rectangle and big icon rectangle

impl Spacing[src]

pub fn ui(&mut self, ui: &mut Ui)[src]

Trait Implementations

impl Clone for Spacing[src]

fn clone(&self) -> Spacing[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Spacing[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Spacing[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl PartialEq<Spacing> for Spacing[src]

fn eq(&self, other: &Spacing) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Spacing) -> bool[src]

This method tests for !=.

impl StructuralPartialEq for Spacing[src]

Auto Trait Implementations

impl RefUnwindSafe for Spacing

impl Send for Spacing

impl Sync for Spacing

impl Unpin for Spacing

impl UnwindSafe for Spacing

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.