Skip to main content

WindowEvent

Enum WindowEvent 

Source
pub enum WindowEvent {
    Focus,
    Move {
        dx: i32,
        dy: i32,
    },
    Resize {
        edge: WindowEdge,
        dx: i32,
        dy: i32,
    },
    Minimize,
    ToggleMaximize,
    Close,
    Dropped,
}
Expand description

What the pointer did to a Window, sent through Window::on_event.

Deltas count cells since the last message of the same drag, so an application adds them to the window’s rectangle as they come. What it allows (a smallest size, staying on screen) is its own decision; the window reports the pointer, not a new rectangle.

Variants§

§

Focus

A press anywhere in a window that is not focused, sent before whatever else the press does: raise the window and give it focus.

§

Move

The window was dragged by its title, or with alt and the left button anywhere, by dx columns and dy rows.

Fields

§dx: i32

Columns to the right; negative is to the left.

§dy: i32

Rows down; negative is up.

§

Resize

An edge or a corner was dragged: the right column or bottom row of the body, their corner, or with alt and the right button the edge or corner nearest to the press.

Fields

§edge: WindowEdge

The edge or corner that moves.

§dx: i32

Columns the edge’s side moves to the right; 0 for the top and bottom edges.

§dy: i32

Rows the edge’s side moves down; 0 for the left and right edges.

§

Minimize

The minimize mark was clicked.

§

ToggleMaximize

The maximize mark was clicked, or the title double-clicked.

§

Close

The close mark was clicked.

§

Dropped

A move or a resize ended: the button came up after at least one WindowEvent::Move or WindowEvent::Resize. This is where snapping to an edge and a ghost drag land, and where a size is saved.

Trait Implementations§

Source§

impl Clone for WindowEvent

Source§

fn clone(&self) -> WindowEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for WindowEvent

Source§

impl Debug for WindowEvent

Source§

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

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

impl Eq for WindowEvent

Source§

impl PartialEq for WindowEvent

Source§

fn eq(&self, other: &WindowEvent) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for WindowEvent

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.