DynamicPanel

Struct DynamicPanel 

Source
pub struct DynamicPanel<'a> { /* private fields */ }
Expand description

Panel that can be displayed dynamically as a SidePanel or TopBottomPanel - e.g. if the screen size is too small.

Implementations§

Source§

impl<'a> DynamicPanel<'a>

Source

pub fn new(name: &str) -> Self

Constructor. Name will be used for the Panel Id.

Source

pub fn show_dynamic<R, F: Fn(&mut Ui) -> R>( &self, ctx: &'a Context, content: F, ) -> Option<InnerResponse<R>>

Show the Panel dynamically, based on the choice function.

Source

pub fn show_dynamic_inside<R, F: Fn(&mut Ui) -> R>( &self, ctx: &'a Context, ui: &mut Ui, content: F, ) -> Option<InnerResponse<R>>

Show the Panel dynamically inside a Ui, based on the choice function.

Source

pub fn show_dynamic_animated<R, F: Fn(&mut Ui) -> R>( &self, ctx: &'a Context, is_expanded: bool, content: F, ) -> Option<InnerResponse<R>>

Show the Panel dynamically and animated, based on the choice function.

Source

pub fn show_dynamic_animated_inside<R, F: Fn(&mut Ui) -> R>( &self, ctx: &'a Context, ui: &mut Ui, is_expanded: bool, content: F, ) -> Option<InnerResponse<R>>

Show the Panel dynamically and animated inside a Ui, based on the choice function.

Source

pub fn show<R, F: Fn(&mut Ui) -> R>( &self, ctx: &'a Context, index: usize, content: F, ) -> Option<InnerResponse<R>>

Show the Panel with the given index for its saved configuration. If you don’t need manual control, use show_dynamic instead.

Source

pub fn show_inside<R, F: Fn(&mut Ui) -> R>( &self, ui: &mut Ui, index: usize, content: F, ) -> Option<InnerResponse<R>>

Show the Panel inside a Ui with the given index for its saved configuration. If you don’t need manual control, use show_dynamic instead.

Source

pub fn show_animated<R, F: Fn(&mut Ui) -> R>( &self, ctx: &'a Context, index: usize, is_expanded: bool, content: F, ) -> Option<InnerResponse<R>>

Show the Panel with animation with the given index for its saved configuration. If you don’t need manual control, use show_dynamic instead.

Source

pub fn show_animated_inside<R, F: Fn(&mut Ui) -> R>( &self, ui: &mut Ui, index: usize, is_expanded: bool, content: F, ) -> Option<InnerResponse<R>>

Show the Panel with animation inside a Ui with the given index for its saved configuration. If you don’t need manual control, use show_dynamic instead.

Source§

impl<'a> DynamicPanel<'a>

Source

pub fn dual(self, first: PanelCfg, second: PanelCfg) -> Self

Convenience function for creating a breaking panel.

Source

pub fn with_threshold_function<F: Fn(&'a Context) -> bool + 'static>( self, f: F, ) -> Self

Convenience function to allow a choice function between index 0 and 1. (true = 1)

Source

pub fn with_panels(self, panels: Vec<PanelCfg>) -> Self

Source

pub fn push_panel(&mut self, panel: PanelCfg) -> usize

Source

pub fn with_choice_function<F: Fn(&'a Context) -> usize + 'static>( self, choice_function: F, ) -> Self

Auto Trait Implementations§

§

impl<'a> Freeze for DynamicPanel<'a>

§

impl<'a> !RefUnwindSafe for DynamicPanel<'a>

§

impl<'a> !Send for DynamicPanel<'a>

§

impl<'a> !Sync for DynamicPanel<'a>

§

impl<'a> Unpin for DynamicPanel<'a>

§

impl<'a> !UnwindSafe for DynamicPanel<'a>

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> 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, 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.