Struct Window

Source
pub struct Window(/* private fields */);
Expand description

Applcation window.

Implementations§

Source§

impl Window

Source

pub fn builder() -> WindowBuilder

Returns a new builder instance.

Source

pub fn set_title<S>(&mut self, title: S)
where S: Into<String>,

Sets a window title.

§Parameters:
  • title - Window title.
Source

pub fn title(&self) -> String

Returns a window title.

Source

pub fn id(&self) -> WindowId

Returns a window ID.

Source

pub fn set_options(&mut self, options: WindowOptions)

Sets window options.

§Parameters:
  • options - Window options.
Source

pub fn options(&self) -> WindowOptions

Retuns window options.

Source

pub fn show(&mut self, app: &ActiveApplication)

Makes a window visible.

§Parameters:
  • app - Active application.
Source

pub fn show_modal(&mut self, app: &ActiveApplication)

Makes a window visible.

§Parameters:
  • app - Active application.
Source

pub fn toggle_fullscreen(&mut self)

Toggles the fullscreen mode of the window.

Source

pub fn is_fullscreen(&self) -> bool

Returns if a window is in the fullscreen mode.

Source

pub fn set_frame_size(&mut self, size: Size)

Sets a new frame size of the window.

§Parameters:
  • size - Window frame size.
Source

pub fn frame_size(&self) -> PhysicalSize<u32>

Returns a frame size of the window.

Source

pub fn set_position(&mut self, position: Position)

Sets a window origin position.

§Parameters:
  • position - Origin position.
Source

pub fn position(&self) -> PhysicalPosition<i32>

Returns a window origin position.

Source

pub fn set_min_size(&mut self, min_size: Size)

Sets a minimal size of the window frame.

§Parameters:
  • min_size - Minimal window frame size.
Source

pub fn min_size(&self) -> PhysicalSize<u32>

Returns a minimal size of the window frame.

Source

pub fn set_max_size(&mut self, max_size: Size)

Sets a maximal size of the window frame.

§Parameters:
  • max_size - Maximal window frame size.
Source

pub fn max_size(&self) -> PhysicalSize<u32>

Returns a maximal size of the window frame.

Source

pub fn maximize(&mut self)

Switches a window into the maximized mode.

Source

pub fn is_maximized(&self) -> bool

Checks if a window is maximized.

Source

pub fn content_size(&self) -> PhysicalSize<u32>

Returns a content size (inner window size).

Source

pub fn is_visible(&self) -> bool

Checks if a window is visible on the screen.

Source

pub fn close(&mut self)

Closes a window.

Source

pub fn minimize(&mut self)

Switches a window into the minimized mode.

Source

pub fn is_minimized(&self) -> bool

Checks if a window is minimized.

Source

pub fn restore(&mut self)

De-minimizes window.

Source

pub fn scale_factor(&self) -> f64

Window backing scale factor.

Trait Implementations§

Source§

impl Debug for Window

Source§

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

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

impl Drop for Window

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl HasWindowHandler for Window

Source§

fn window_handler(&self) -> WindowHandler

Returns a window handler for the current platform.

Auto Trait Implementations§

§

impl Freeze for Window

§

impl !RefUnwindSafe for Window

§

impl Send for Window

§

impl Sync for Window

§

impl Unpin for Window

§

impl !UnwindSafe for Window

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

impl<T> AutoreleaseSafe for T
where T: ?Sized,