pub struct MacFrameState {Show 21 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 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: 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
min_area: Rect
§max_area: Rect
§mouse_close: MouseFlags
mouse flags for close area
mouse_min: MouseFlags
§mouse_max: MouseFlags
§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 MacFrameState
impl MacFrameState
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,
arc: bool,
) -> WindowFrameOutcome
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.
Sourcepub fn set_moved_area(
&mut self,
new_area: Rect,
arc: bool,
) -> WindowFrameOutcome
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 MacFrameState
impl Debug for MacFrameState
Source§impl Default for MacFrameState
impl Default for MacFrameState
Source§impl HandleEvent<Event, Dialog, WindowFrameOutcome> for MacFrameState
impl HandleEvent<Event, Dialog, WindowFrameOutcome> for MacFrameState
Source§impl HasFocus for MacFrameState
impl HasFocus for MacFrameState
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 MacFrameState
impl !RefUnwindSafe for MacFrameState
impl !Send for MacFrameState
impl !Sync for MacFrameState
impl Unpin for MacFrameState
impl !UnwindSafe for MacFrameState
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