pub struct WindowConfig { /* private fields */ }Expand description
Configures various attributes (e.g. size, position, transparency, etc.) of a window.
Implementations§
Source§impl WindowConfig
impl WindowConfig
Sourcepub fn size(self, size: impl Into<Size>) -> Self
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.
Sourcepub fn min_size(self, size: impl Into<Size>) -> Self
pub fn min_size(self, size: impl Into<Size>) -> Self
Requests the window to be of specific min dimensions.
Sourcepub fn max_size(self, size: impl Into<Size>) -> Self
pub fn max_size(self, size: impl Into<Size>) -> Self
Requests the window to be of specific max dimensions.
Sourcepub fn position(self, position: Point) -> Self
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.
Sourcepub fn show_titlebar(self, show_titlebar: bool) -> Self
pub fn show_titlebar(self, show_titlebar: bool) -> Self
Sets whether the window should have a title bar.
The default is true.
Sourcepub fn undecorated(self, undecorated: bool) -> Self
pub fn undecorated(self, undecorated: bool) -> Self
Sets whether the window should have a border, a title bar, etc.
The default is false.
Sourcepub fn undecorated_shadow(self, undecorated_shadow: bool) -> Self
pub fn undecorated_shadow(self, undecorated_shadow: bool) -> Self
Sets whether the window should have background drop shadow when undecorated.
The default is false.
Sourcepub fn with_transparent(self, transparent: bool) -> Self
pub fn with_transparent(self, transparent: bool) -> Self
Sets whether the background of the window should be transparent.
The default is false.
Sourcepub fn fullscreen(self, fullscreen: Fullscreen) -> Self
pub fn fullscreen(self, fullscreen: Fullscreen) -> Self
Sets whether the window should be put into fullscreen upon creation.
The default is None.
Sourcepub fn window_icon(self, window_icon: Icon) -> Self
pub fn window_icon(self, window_icon: Icon) -> Self
Sets the window icon.
The default is None.
Sourcepub fn title(self, title: impl Into<String>) -> Self
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".
Sets the enabled window buttons.
The default is WindowButtons::all().
Sourcepub fn resizable(self, resizable: bool) -> Self
pub fn resizable(self, resizable: bool) -> Self
Sets whether the window is resizable or not.
The default is true.
Sourcepub fn window_level(self, window_level: WindowLevel) -> Self
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.
Sourcepub fn theme_override(self, theme_override: Theme) -> Self
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.
Sourcepub fn apply_default_theme(self, apply: bool) -> Self
pub fn apply_default_theme(self, apply: bool) -> Self
.
Sourcepub fn font_embolden(self, font_embolden: f32) -> Self
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
Sourcepub fn with_mac_os_config(
self,
f: impl FnMut(MacOSWindowConfig) -> MacOSWindowConfig,
) -> Self
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.
Sourcepub fn with_win_os_config(
self,
f: impl FnMut(WinOSWindowConfig) -> WinOSWindowConfig,
) -> Self
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.
Sourcepub fn with_web_config(
self,
f: impl FnOnce(WebWindowConfig) -> WebWindowConfig,
) -> Self
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§
Auto Trait Implementations§
impl Freeze for WindowConfig
impl !RefUnwindSafe for WindowConfig
impl Send for WindowConfig
impl Sync for WindowConfig
impl Unpin for WindowConfig
impl !UnwindSafe for WindowConfig
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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