Struct PopupCoreState

Source
pub struct PopupCoreState {
    pub area: Rect,
    pub area_z: u16,
    pub widget_area: Rect,
    pub h_scroll: ScrollState,
    pub v_scroll: ScrollState,
    pub active: FocusFlag,
    pub mouse: MouseFlags,
    pub non_exhaustive: NonExhaustive,
}
Expand description

State for the PopupCore.

Fields§

§area: Rect

Area for the widget. This is the area given to render(), corrected by the given constraints. read only. renewed for each render.

§area_z: u16

Z-Index for the popup.

§widget_area: Rect

Area where the widget can render it’s content. read only. renewed for each render.

§h_scroll: ScrollState

Horizontal scroll state if active. read+write

§v_scroll: ScrollState

Vertical scroll state if active. read+write

§active: FocusFlag

Active flag for the popup.

Uses a ContainerFlag that can be combined with the FocusFlags your widget uses for handling its focus to detect the transition ‘Did the popup loose focus and should it be closed now’.

If you don’t rely on Focus this way, this will just be a boolean flag that indicates active/visible.

See See the examples how to use for both cases. read+write

§mouse: MouseFlags

Mouse flags. read+write

§non_exhaustive: NonExhaustive

non-exhaustive struct.

Implementations§

Source§

impl PopupCoreState

Source

pub fn new() -> PopupCoreState

New

Source

pub fn named(name: &str) -> PopupCoreState

New with a focus name.

Source

pub fn set_area_z(&mut self, z: u16)

Set the z-index of the popup.

Source

pub fn area_z(&self) -> u16

The z-index of the popup.

Source

pub fn is_active(&self) -> bool

Is the popup active/visible.

Source

pub fn flip_active(&mut self)

Flip visibility of the popup.

Source

pub fn set_active(&mut self, active: bool) -> bool

Show the popup. This will set gained/lost flags according to the change. If the popup is hidden this will clear all flags.

Source

pub fn clear_areas(&mut self)

Clear the areas.

Trait Implementations§

Source§

impl Clone for PopupCoreState

Source§

fn clone(&self) -> PopupCoreState

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 PopupCoreState

Source§

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

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

impl Default for PopupCoreState

Source§

fn default() -> PopupCoreState

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

impl HandleEvent<Event, Popup, PopupOutcome> for PopupCoreState

Source§

fn handle(&mut self, event: &Event, _qualifier: Popup) -> PopupOutcome

Handle an event. Read more
Source§

impl RelocatableState for PopupCoreState

Source§

fn relocate(&mut self, shift: (i16, i16), clip: Rect)

Relocate the areas in this widgets state.

Auto Trait Implementations§

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
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.