Trait tauri_runtime::webview::WindowBuilder
source · pub trait WindowBuilder: WindowBuilderBase {
Show 30 methods
// Required methods
fn new() -> Self;
fn with_config(config: WindowConfig) -> Self;
fn menu(self, menu: Menu) -> Self;
fn center(self) -> Self;
fn position(self, x: f64, y: f64) -> Self;
fn inner_size(self, width: f64, height: f64) -> Self;
fn min_inner_size(self, min_width: f64, min_height: f64) -> Self;
fn max_inner_size(self, max_width: f64, max_height: f64) -> Self;
fn resizable(self, resizable: bool) -> Self;
fn maximizable(self, maximizable: bool) -> Self;
fn minimizable(self, minimizable: bool) -> Self;
fn closable(self, closable: bool) -> Self;
fn title<S: Into<String>>(self, title: S) -> Self;
fn fullscreen(self, fullscreen: bool) -> Self;
fn focused(self, focused: bool) -> Self;
fn maximized(self, maximized: bool) -> Self;
fn visible(self, visible: bool) -> Self;
fn transparent(self, transparent: bool) -> Self;
fn decorations(self, decorations: bool) -> Self;
fn always_on_top(self, always_on_top: bool) -> Self;
fn content_protected(self, protected: bool) -> Self;
fn icon(self, icon: Icon) -> Result<Self>;
fn skip_taskbar(self, skip: bool) -> Self;
fn parent_window(self, parent: *mut c_void) -> Self;
fn title_bar_style(self, style: TitleBarStyle) -> Self;
fn hidden_title(self, hidden: bool) -> Self;
fn tabbing_identifier(self, identifier: &str) -> Self;
fn theme(self, theme: Option<Theme>) -> Self;
fn has_icon(&self) -> bool;
fn get_menu(&self) -> Option<&Menu>;
}
Expand description
A builder for all attributes related to a single webview.
This trait is only meant to be implemented by a custom Runtime
and not by applications.
Required Methods§
sourcefn with_config(config: WindowConfig) -> Self
fn with_config(config: WindowConfig) -> Self
Initializes a new webview builder from a WindowConfig
Sets the menu for the window.
sourcefn inner_size(self, width: f64, height: f64) -> Self
fn inner_size(self, width: f64, height: f64) -> Self
Window size.
sourcefn min_inner_size(self, min_width: f64, min_height: f64) -> Self
fn min_inner_size(self, min_width: f64, min_height: f64) -> Self
Window min inner size.
sourcefn max_inner_size(self, max_width: f64, max_height: f64) -> Self
fn max_inner_size(self, max_width: f64, max_height: f64) -> Self
Window max inner size.
sourcefn resizable(self, resizable: bool) -> Self
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.
sourcefn maximizable(self, maximizable: bool) -> Self
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.
§Platform-specific
- macOS: Disables the “zoom” button in the window titlebar, which is also used to enter fullscreen mode.
- Linux / iOS / Android: Unsupported.
sourcefn minimizable(self, minimizable: bool) -> Self
fn minimizable(self, minimizable: bool) -> Self
Whether the window’s native minimize button is enabled or not.
§Platform-specific
- Linux / iOS / Android: Unsupported.
sourcefn closable(self, closable: bool) -> Self
fn closable(self, closable: bool) -> Self
Whether the window’s native close button is enabled or not.
§Platform-specific
- Linux: “GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible”
- iOS / Android: Unsupported.
sourcefn fullscreen(self, fullscreen: bool) -> Self
fn fullscreen(self, fullscreen: bool) -> Self
Whether to start the window in fullscreen or not.
sourcefn maximized(self, maximized: bool) -> Self
fn maximized(self, maximized: bool) -> Self
Whether the window should be maximized upon creation.
sourcefn visible(self, visible: bool) -> Self
fn visible(self, visible: bool) -> Self
Whether the window should be immediately visible upon creation.
sourcefn transparent(self, transparent: bool) -> Self
Available on non-macOS or crate feature macos-private-api
only.
fn transparent(self, transparent: bool) -> Self
macos-private-api
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.
sourcefn decorations(self, decorations: bool) -> Self
fn decorations(self, decorations: bool) -> Self
Whether the window should have borders and bars.
sourcefn always_on_top(self, always_on_top: bool) -> Self
fn always_on_top(self, always_on_top: bool) -> Self
Whether the window should always be on top of other windows.
sourcefn content_protected(self, protected: bool) -> Self
fn content_protected(self, protected: bool) -> Self
Prevents the window contents from being captured by other apps.
sourcefn skip_taskbar(self, skip: bool) -> Self
fn skip_taskbar(self, skip: bool) -> Self
Sets whether or not the window icon should be added to the taskbar.
sourcefn parent_window(self, parent: *mut c_void) -> Self
fn parent_window(self, parent: *mut c_void) -> Self
Sets a parent to the window to be created.
A child window has the WS_CHILD style and is confined to the client area of its parent window.
For more information, see https://docs.microsoft.com/en-us/windows/win32/winmsg/window-features#child-windows
sourcefn title_bar_style(self, style: TitleBarStyle) -> Self
fn title_bar_style(self, style: TitleBarStyle) -> Self
Hide the titlebar. Titlebar buttons will still be visible.
Hide the window title.
sourcefn tabbing_identifier(self, identifier: &str) -> Self
fn tabbing_identifier(self, identifier: &str) -> Self
Defines the window tabbing identifier for macOS.
Windows with matching tabbing identifiers will be grouped together. If the tabbing identifier is not set, automatic tabbing will be disabled.
sourcefn theme(self, theme: Option<Theme>) -> Self
fn theme(self, theme: Option<Theme>) -> Self
Forces a theme or uses the system settings if None was provided.
Gets the window menu.