Skip to main content

DynWindowBuilder

Struct DynWindowBuilder 

Source
pub struct DynWindowBuilder { /* private fields */ }
Expand description

A WindowBuilder for DynRuntime.

The concrete window builder type is only known when the runtime creates the window, so this builder records the requested attributes and replays them on the runtime’s builder at that point (see DynWindowBuilder::apply).

Implementations§

Source§

impl DynWindowBuilder

Source

pub fn customize<F: Fn(&mut dyn Any) + Send + Sync + 'static>( self, f: F, ) -> Self

Registers a callback that customizes the runtime’s window builder when this builder is applied.

The callback receives the runtime’s window builder as a dyn Any, which must be downcast to the builder type of the runtime in use. This is how runtime-specific builder APIs are reached through the type-erased runtime.

Source

pub fn apply<B: WindowBuilder>(self) -> Result<B>

Replays the recorded attributes on a window builder of the concrete runtime.

Trait Implementations§

Source§

impl Clone for DynWindowBuilder

Source§

fn clone(&self) -> DynWindowBuilder

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 Debug for DynWindowBuilder

Source§

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

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

impl Default for DynWindowBuilder

Source§

fn default() -> DynWindowBuilder

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

impl Send for DynWindowBuilder

Source§

impl WindowBuilder for DynWindowBuilder

Source§

fn new() -> Self

Initializes a new window attributes builder.
Source§

fn with_config(config: &WindowConfig) -> Self

Initializes a new window builder from a WindowConfig
Source§

fn center(self) -> Self

Show window in the center of the screen.
Source§

fn position(self, x: f64, y: f64) -> Self

The initial position of the window in logical pixels.
Source§

fn inner_size(self, width: f64, height: f64) -> Self

Window size in logical pixels.
Source§

fn min_inner_size(self, min_width: f64, min_height: f64) -> Self

Window min inner size in logical pixels.
Source§

fn max_inner_size(self, max_width: f64, max_height: f64) -> Self

Window max inner size in logical pixels.
Source§

fn inner_size_constraints(self, constraints: WindowSizeConstraints) -> Self

Window inner size constraints.
Source§

fn prevent_overflow(self) -> Self

Prevent the window from overflowing the working area (e.g. monitor size - taskbar size) on creation Read more
Source§

fn prevent_overflow_with_margin(self, margin: Size) -> Self

Prevent the window from overflowing the working area (e.g. monitor size - taskbar size) on creation with a margin Read more
Source§

fn resizable(self, resizable: bool) -> Self

Whether the window is resizable or not. When resizable is set to false, native window’s maximize button is automatically disabled.
Source§

fn maximizable(self, maximizable: bool) -> Self

Whether the window’s native maximize button is enabled or not. If resizable is set to false, this setting is ignored. Read more
Source§

fn minimizable(self, minimizable: bool) -> Self

Whether the window’s native minimize button is enabled or not. Read more
Source§

fn closable(self, closable: bool) -> Self

Whether the window’s native close button is enabled or not. Read more
Source§

fn title<S: Into<String>>(self, title: S) -> Self

The title of the window in the title bar.
Source§

fn fullscreen(self, fullscreen: bool) -> Self

Whether to start the window in fullscreen or not.
Source§

fn focused(self, focused: bool) -> Self

Whether the window will be initially focused or not.
Source§

fn focusable(self, focusable: bool) -> Self

Whether the window will be focusable or not.
Source§

fn maximized(self, maximized: bool) -> Self

Whether the window should be maximized upon creation.
Source§

fn visible(self, visible: bool) -> Self

Whether the window should be immediately visible upon creation.
Source§

fn transparent(self, transparent: bool) -> Self

Available on crate feature macos-private-api or non-macOS only.
Whether the window should be transparent. If this is true, writing colors with alpha values different than 1.0 will produce a transparent window. Read more
Source§

fn decorations(self, decorations: bool) -> Self

Whether the window should have borders and bars.
Source§

fn always_on_bottom(self, always_on_bottom: bool) -> Self

Whether the window should always be below other windows.
Source§

fn always_on_top(self, always_on_top: bool) -> Self

Whether the window should always be on top of other windows.
Source§

fn visible_on_all_workspaces(self, visible_on_all_workspaces: bool) -> Self

Whether the window should be visible on all workspaces or virtual desktops.
Source§

fn content_protected(self, protected: bool) -> Self

Prevents the window contents from being captured by other apps.
Source§

fn icon(self, icon: Icon<'_>) -> Result<Self>

Sets the window icon.
Source§

fn skip_taskbar(self, skip: bool) -> Self

Sets whether or not the window icon should be added to the taskbar.
Source§

fn background_color(self, color: Color) -> Self

Set the window background color.
Source§

fn shadow(self, enable: bool) -> Self

Sets whether or not the window has shadow. Read more
Source§

fn transient_for(self, parent: *mut c_void) -> Self

Available on DragonFly BSD or FreeBSD or Linux or NetBSD or OpenBSD only.
Sets the window to be created transient for parent. Read more
Source§

fn theme(self, theme: Option<Theme>) -> Self

Forces a theme or uses the system settings if None was provided.
Source§

fn has_icon(&self) -> bool

Whether the icon was set or not.
Source§

fn get_theme(&self) -> Option<Theme>

Source§

fn window_classname<S: Into<String>>(self, window_classname: S) -> Self

Sets custom name for Windows’ window class. Windows only.
Source§

fn no_redirection_bitmap(self, enable: bool) -> Self

This sets WS_EX_NOREDIRECTIONBITMAP. Read more
Source§

impl WindowBuilderBase for DynWindowBuilder

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

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,