WindowFrameState

Struct WindowFrameState 

Source
pub struct WindowFrameState {
Show 17 fields pub limit: Rect, pub area: Rect, pub arc_area: Rect, pub widget_area: Rect, pub top: bool, pub can_move: bool, pub can_resize: bool, pub can_close: bool, pub move_area: Rect, pub resize_area: Rect, pub close_area: Rect, pub mouse_close: MouseFlags, pub mouse_resize: MouseFlags, pub start_move: (Rect, Position), pub mouse_move: MouseFlags, pub focus: FocusFlag, pub non_exhaustive: NonExhaustive,
}
Expand description

Window state.

Fields§

§limit: Rect

Outer limit for the window. This will be set by the widget during render. read only

§area: Rect

the rendered window-area. change this area to move the window. read+write

§arc_area: Rect

archived area. used when switching between maximized and normal size.

§widget_area: Rect

area for window content. read only renewed with each render.

§top: bool

is this the top window? read+write

§can_move: bool

Window can be moved. read+write May be overwritten by the widget.

§can_resize: bool

Window can be resized. read+write May be overwritten by the widget.

§can_close: bool

Window can be closed. read+write May be overwritten by the widget.

§move_area: Rect

move area

§resize_area: Rect

resize area

§close_area: Rect

close area

§mouse_close: MouseFlags

mouse flags for close area

§mouse_resize: MouseFlags

mouse flags for resize area

§start_move: (Rect, Position)

window and mouse position at the start of move

§mouse_move: MouseFlags

mouse flags for move area

§focus: FocusFlag

Focus for move/resize

§non_exhaustive: NonExhaustive

Implementations§

Source§

impl WindowFrameState

Source

pub fn new() -> Self

Source

pub fn flip_maximize(&mut self)

Switch between maximized and normal size.

Source

pub fn set_resized_area( &mut self, new_area: Rect, arc: bool, ) -> WindowFrameOutcome

Set the window area and check the limits.

It always resizes the area to keep it within the limits.

Return

Returns WindowFrameOutcome::Resized if the area is changed.

Source

pub fn set_moved_area( &mut self, new_area: Rect, arc: bool, ) -> WindowFrameOutcome

Set the window area and check the limits.

If possible it moves the area to stay within the limits. If the given area is bigger than the limit it is clipped.

Return

Returns WindowFrameOutcome::Moved if the area is changed.

Trait Implementations§

Source§

impl Debug for WindowFrameState

Source§

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

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

impl Default for WindowFrameState

Source§

fn default() -> Self

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

impl HandleEvent<Event, Dialog, WindowFrameOutcome> for WindowFrameState

Source§

fn handle(&mut self, event: &Event, _qualifier: Dialog) -> WindowFrameOutcome

Handle an event. Read more
Source§

impl HasFocus for WindowFrameState

Source§

fn build(&self, builder: &mut FocusBuilder)

Build the focus-structure for the container.
Source§

fn focus(&self) -> FocusFlag

Access to the flag for the rest.
Source§

fn area(&self) -> Rect

Area for mouse focus. Read more
Source§

fn navigable(&self) -> Navigation

Declares how the widget interacts with focus. Read more
Source§

fn id(&self) -> usize

Provide a unique id for the widget.
Source§

fn area_z(&self) -> u16

Z value for the area. Read more
Source§

fn is_focused(&self) -> bool

Focused?
Source§

fn lost_focus(&self) -> bool

Just lost focus.
Source§

fn gained_focus(&self) -> bool

Just gained focus.

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