egui::containers

Struct Resize

Source
pub struct Resize { /* private fields */ }
Expand description

A region that can be resized by dragging the bottom right corner.

Implementations§

Source§

impl Resize

Source

pub fn id(self, id: Id) -> Self

Assign an explicit and globally unique id.

Source

pub fn id_source(self, id_salt: impl Hash) -> Self

👎Deprecated: Renamed id_salt

A source for the unique Id, e.g. .id_source("second_resize_area") or .id_source(loop_index).

Source

pub fn id_salt(self, id_salt: impl Hash) -> Self

A source for the unique Id, e.g. .id_salt("second_resize_area") or .id_salt(loop_index).

Source

pub fn default_width(self, width: f32) -> Self

Preferred / suggested width. Actual width will depend on contents.

Examples:

  • if the contents is text, this will decide where we break long lines.
  • if the contents is a canvas, this decides the width of it,
  • if the contents is some buttons, this is ignored and we will auto-size.
Source

pub fn default_height(self, height: f32) -> Self

Preferred / suggested height. Actual height will depend on contents.

Examples:

  • if the contents is a crate::ScrollArea then this decides the maximum size.
  • if the contents is a canvas, this decides the height of it,
  • if the contents is text and buttons, then the default_height is ignored and the height is picked automatically..
Source

pub fn default_size(self, default_size: impl Into<Vec2>) -> Self

Source

pub fn min_size(self, min_size: impl Into<Vec2>) -> Self

Won’t shrink to smaller than this

Source

pub fn min_width(self, min_width: f32) -> Self

Won’t shrink to smaller than this

Source

pub fn min_height(self, min_height: f32) -> Self

Won’t shrink to smaller than this

Source

pub fn max_size(self, max_size: impl Into<Vec2>) -> Self

Won’t expand to larger than this

Source

pub fn max_width(self, max_width: f32) -> Self

Won’t expand to larger than this

Source

pub fn max_height(self, max_height: f32) -> Self

Won’t expand to larger than this

Source

pub fn resizable(self, resizable: impl Into<Vec2b>) -> Self

Can you resize it with the mouse?

Note that a window can still auto-resize.

Default is true.

Source

pub fn is_resizable(&self) -> Vec2b

Source

pub fn auto_sized(self) -> Self

Not manually resizable, just takes the size of its contents. Text will not wrap, but will instead make your window width expand.

Source

pub fn fixed_size(self, size: impl Into<Vec2>) -> Self

Source

pub fn with_stroke(self, with_stroke: bool) -> Self

Source§

impl Resize

Source

pub fn show<R>(self, ui: &mut Ui, add_contents: impl FnOnce(&mut Ui) -> R) -> R

Trait Implementations§

Source§

impl Clone for Resize

Source§

fn clone(&self) -> Resize

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Resize

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Resize

Source§

fn default() -> Self

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

impl Copy for Resize

Auto Trait Implementations§

§

impl Freeze for Resize

§

impl RefUnwindSafe for Resize

§

impl Send for Resize

§

impl Sync for Resize

§

impl Unpin for Resize

§

impl UnwindSafe for Resize

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,