pub struct WindowFrameState {Show 23 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 can_min: bool,
pub can_max: bool,
pub move_area: Rect,
pub resize_area: Rect,
pub close_area: Rect,
pub min_area: Rect,
pub max_area: Rect,
pub mouse_close: MouseFlags,
pub mouse_min: MouseFlags,
pub mouse_max: 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: RectOuter limit for the window. This will be set by the widget during render. read only
area: Rectthe rendered window-area. change this area to move the window. read+write
arc_area: Rectarchived area. used when switching between maximized and normal size.
widget_area: Rectarea for window content. read only renewed with each render.
top: boolis this the top window? read+write
can_move: boolWindow can be moved. read+write May be overwritten by the widget.
can_resize: boolWindow can be resized. read+write May be overwritten by the widget.
can_close: boolWindow can be closed. read+write May be overwritten by the widget.
can_min: boolWindow can be closed. read+write May be overwritten by the widget.
can_max: boolWindow can be closed. read+write May be overwritten by the widget.
move_area: Rectmove area
resize_area: Rectresize area
close_area: Rectclose area
min_area: Rect§max_area: Rect§mouse_close: MouseFlagsmouse flags for close area
mouse_min: MouseFlags§mouse_max: MouseFlags§mouse_resize: MouseFlagsmouse flags for resize area
start_move: (Rect, Position)window and mouse position at the start of move
mouse_move: MouseFlagsmouse flags for move area
focus: FocusFlagFocus for move/resize
non_exhaustive: NonExhaustiveImplementations§
Source§impl WindowFrameState
impl WindowFrameState
pub fn new() -> Self
Sourcepub fn flip_maximize(&mut self)
pub fn flip_maximize(&mut self)
Switch between maximized and normal size.
Sourcepub fn flip_minimize(&mut self)
pub fn flip_minimize(&mut self)
Switch between minimized and normal state.
Sourcepub fn set_resized_area(&mut self, new_area: Rect) -> WindowFrameOutcome
pub fn set_resized_area(&mut self, new_area: Rect) -> 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.
Sourcepub fn set_moved_area(&mut self, new_area: Rect) -> WindowFrameOutcome
pub fn set_moved_area(&mut self, new_area: Rect) -> 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
impl Debug for WindowFrameState
Source§impl Default for WindowFrameState
impl Default for WindowFrameState
Source§impl HandleEvent<Event, Dialog, WindowFrameOutcome> for WindowFrameState
impl HandleEvent<Event, Dialog, WindowFrameOutcome> for WindowFrameState
Source§impl HasFocus for WindowFrameState
impl HasFocus for WindowFrameState
Source§fn build(&self, builder: &mut FocusBuilder)
fn build(&self, builder: &mut FocusBuilder)
Source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Source§fn lost_focus(&self) -> bool
fn lost_focus(&self) -> bool
Source§fn gained_focus(&self) -> bool
fn gained_focus(&self) -> bool
Auto Trait Implementations§
impl !Freeze for WindowFrameState
impl !RefUnwindSafe for WindowFrameState
impl !Send for WindowFrameState
impl !Sync for WindowFrameState
impl Unpin for WindowFrameState
impl !UnwindSafe for WindowFrameState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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