pub struct WindowConfig {Show 23 fields
pub title: String,
pub width: u32,
pub height: u32,
pub fullscreen: bool,
pub min_size: Option<(u32, u32)>,
pub max_size: Option<(u32, u32)>,
pub position: Option<(i32, i32)>,
pub maximized: bool,
pub resizable: bool,
pub vsync: bool,
pub multisampling: u8,
pub high_dpi: bool,
pub lazy_loop: bool,
pub transparent: bool,
pub always_on_top: bool,
pub decorations: bool,
pub visible: bool,
pub mouse_passthrough: bool,
pub app_id: String,
pub window_icon_path: Option<PathBuf>,
pub window_icon_data: Option<&'static [u8]>,
pub taskbar_icon_path: Option<PathBuf>,
pub taskbar_icon_data: Option<&'static [u8]>,
}Expand description
Builder configuration for the window options
Fields§
§title: StringWindow’s title
Web: no-op
width: u32Window’s width
height: u32Window’s height
fullscreen: boolStart window in fullscreen mode
Web: no-op
min_size: Option<(u32, u32)>Minimum resizable window’s size
max_size: Option<(u32, u32)>Maximum resizable window’s size
position: Option<(i32, i32)>Window’s x/y start position
maximized: boolStart the window maximized
Web: The canvas will fill the size of the parent of the HtmlCanvasElement
resizable: boolAllow to resize the window
Web: The canvas will resize along with the parent of the HtmlCanvasElement
vsync: boolEnable V-Sync
Web: no-op
multisampling: u8Sets multisampling Setting to 0 disables multisampling
high_dpi: boolEnable High DPI viewport and drawing if the device pixel ratio is higher than 1
This is false by default, enable it could consume more resources and require
a custom way of drawing things. The advice is using it if you know what you’re doing
lazy_loop: boolInner loop will run only after an input event
transparent: boolBackground as transparent
always_on_top: boolWindow will be drawn above others
decorations: boolEnable decorations
Web: Does nothing
visible: boolHide the windows
mouse_passthrough: bool§app_id: StringApp ID On Web use or create the canvas with this id.
window_icon_path: Option<PathBuf>Optinal Window icon filepath
window_icon_data: Option<&'static [u8]>Optinal Window icon filedata
taskbar_icon_path: Option<PathBuf>Optinal Task bar icon filepath
taskbar_icon_data: Option<&'static [u8]>Optinal Task bar icon filedata
Implementations§
Source§impl WindowConfig
impl WindowConfig
Sourcepub fn set_lazy_loop(self, lazy: bool) -> Self
pub fn set_lazy_loop(self, lazy: bool) -> Self
Inner loop will run only after an input event
Sourcepub fn set_fullscreen(self, fullscreen: bool) -> Self
pub fn set_fullscreen(self, fullscreen: bool) -> Self
Enable fullscreen mode
Sourcepub fn set_min_size(self, width: u32, height: u32) -> Self
pub fn set_min_size(self, width: u32, height: u32) -> Self
Sets the window’s minimum size
Sourcepub fn set_max_size(self, width: u32, height: u32) -> Self
pub fn set_max_size(self, width: u32, height: u32) -> Self
Sets the window’s maximum size
Sourcepub fn set_position(self, x: i32, y: i32) -> Self
pub fn set_position(self, x: i32, y: i32) -> Self
Sets the window’s x and y
Sourcepub fn set_maximized(self, maximized: bool) -> Self
pub fn set_maximized(self, maximized: bool) -> Self
Starts the window maximized
Sourcepub fn set_resizable(self, resizable: bool) -> Self
pub fn set_resizable(self, resizable: bool) -> Self
Allow the window to be resizable
Sourcepub fn set_multisampling(self, samples: u8) -> Self
pub fn set_multisampling(self, samples: u8) -> Self
Sets multisampling Setting to 0 disables multisampling
Sourcepub fn set_high_dpi(self, enabled: bool) -> Self
pub fn set_high_dpi(self, enabled: bool) -> Self
Enable High DPI
Sourcepub fn set_transparent(self, transparent: bool) -> Self
pub fn set_transparent(self, transparent: bool) -> Self
Set the background as transparent
Sourcepub fn set_always_on_top(self, always_on_top: bool) -> Self
pub fn set_always_on_top(self, always_on_top: bool) -> Self
Set the background as transparent
Sourcepub fn set_decorations(self, decorations: bool) -> Self
pub fn set_decorations(self, decorations: bool) -> Self
Enable or disable decorations
Sourcepub fn set_visible(self, visible: bool) -> Self
pub fn set_visible(self, visible: bool) -> Self
Hide or show the window
Sourcepub fn set_mouse_passthrough(self, mouse_passthrough: bool) -> Self
pub fn set_mouse_passthrough(self, mouse_passthrough: bool) -> Self
Mouse events pass through window
Sourcepub fn set_app_id(self, app_id: &str) -> Self
pub fn set_app_id(self, app_id: &str) -> Self
Set the App ID On web it will use or create the canvas with this id.
Sourcepub fn set_window_icon(self, window_icon_path: Option<PathBuf>) -> Self
pub fn set_window_icon(self, window_icon_path: Option<PathBuf>) -> Self
Window icon path
Sourcepub fn set_window_icon_data(
self,
window_icon_data: Option<&'static [u8]>,
) -> Self
pub fn set_window_icon_data( self, window_icon_data: Option<&'static [u8]>, ) -> Self
Window icon data
Sourcepub fn set_taskbar_icon(self, taskbar_icon_path: Option<PathBuf>) -> Self
pub fn set_taskbar_icon(self, taskbar_icon_path: Option<PathBuf>) -> Self
Task bar icon path
Sourcepub fn set_taskbar_icon_data(
self,
taskbar_icon_data: Option<&'static [u8]>,
) -> Self
pub fn set_taskbar_icon_data( self, taskbar_icon_data: Option<&'static [u8]>, ) -> Self
Task bar icon data
Trait Implementations§
Source§impl<S, B> BuildConfig<S, B> for WindowConfigwhere
B: Backend,
impl<S, B> BuildConfig<S, B> for WindowConfigwhere
B: Backend,
Source§fn apply(&self, builder: AppBuilder<S, B>) -> AppBuilder<S, B>
fn apply(&self, builder: AppBuilder<S, B>) -> AppBuilder<S, B>
Source§fn late_evaluation(&self) -> bool
fn late_evaluation(&self) -> bool
Source§impl Clone for WindowConfig
impl Clone for WindowConfig
Source§fn clone(&self) -> WindowConfig
fn clone(&self) -> WindowConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.