WindowConfig

Struct WindowConfig 

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

Configures various attributes (e.g. size, position, transparency, etc.) of a window.

Implementations§

Source§

impl WindowConfig

Source

pub fn size(self, size: impl Into<Size>) -> Self

Requests the window to be of specific dimensions.

If this is not set, some platform-specific dimensions will be used.

Source

pub fn min_size(self, size: impl Into<Size>) -> Self

Requests the window to be of specific min dimensions.

Source

pub fn max_size(self, size: impl Into<Size>) -> Self

Requests the window to be of specific max dimensions.

Source

pub fn position(self, position: Point) -> Self

Sets a desired initial position for the window.

If this is not set, some platform-specific position will be chosen.

Source

pub fn show_titlebar(self, show_titlebar: bool) -> Self

Sets whether the window should have a title bar.

The default is true.

Source

pub fn undecorated(self, undecorated: bool) -> Self

Sets whether the window should have a border, a title bar, etc.

The default is false.

Source

pub fn undecorated_shadow(self, undecorated_shadow: bool) -> Self

Sets whether the window should have background drop shadow when undecorated.

The default is false.

Source

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

Sets whether the background of the window should be transparent.

The default is false.

Source

pub fn fullscreen(self, fullscreen: Fullscreen) -> Self

Sets whether the window should be put into fullscreen upon creation.

The default is None.

Source

pub fn window_icon(self, window_icon: Icon) -> Self

Sets the window icon.

The default is None.

Source

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

Sets the initial title of the window in the title bar.

The default is "Floem window".

Source

pub fn enabled_buttons(self, enabled_buttons: WindowButtons) -> Self

Sets the enabled window buttons.

The default is WindowButtons::all().

Source

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

Sets whether the window is resizable or not.

The default is true.

Source

pub fn window_level(self, window_level: WindowLevel) -> Self

Sets the window level.

This is just a hint to the OS, and the system could ignore it.

The default is WindowLevel::Normal.

Source

pub fn theme_override(self, theme_override: Theme) -> Self

Set a theme override for the window.

If not provided, the window will follow OS theme.

Source

pub fn apply_default_theme(self, apply: bool) -> Self

.

Source

pub fn font_embolden(self, font_embolden: f32) -> Self

Sets the amount by which fonts are emboldened.

The default is 0.0 except for on macOS where the default is 0.2

Source

pub fn with_mac_os_config( self, f: impl FnMut(MacOSWindowConfig) -> MacOSWindowConfig, ) -> Self

Set up Mac-OS specific configuration. The passed closure will only be called on macOS.

Source

pub fn with_win_os_config( self, f: impl FnMut(WinOSWindowConfig) -> WinOSWindowConfig, ) -> Self

Set up Windows specific configuration. The passed closure will only be called on Windows.

Source

pub fn with_web_config( self, f: impl FnOnce(WebWindowConfig) -> WebWindowConfig, ) -> Self

Set up web specific configuration. The passed closure will only be called on the web.

Trait Implementations§

Source§

impl Default for WindowConfig

Source§

fn default() -> Self

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

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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

Source§

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

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,