Struct egui::containers::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_source: impl Hash) -> Self

A source for the unique Id, e.g. .id_source("second_resize_area") or .id_source(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 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 resizable(self, resizable: bool) -> Self

Can you resize it with the mouse? Note that a window can still auto-resize

source

pub fn is_resizable(&self) -> bool

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§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

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

const: unstable · 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 Twhere
T: Clone,

§

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 Twhere
U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more