Struct tauri_sys::window::WebviewWindowBuilder
source · pub struct WebviewWindowBuilder<'a> { /* private fields */ }
Implementations§
source§impl<'a> WebviewWindowBuilder<'a>
impl<'a> WebviewWindowBuilder<'a>
pub fn new(label: &'a str) -> Self
sourcepub fn set_url(&mut self, url: &'a str) -> &mut Self
pub fn set_url(&mut self, url: &'a str) -> &mut Self
Remote URL or local file path to open.
- URL such as
https://github.com/tauri-apps
is opened directly on a Tauri window. - data: URL such as
data:text/html,<html>...
is only supported with thewindow-data-url
Cargo feature for thetauri
dependency. - local file path or route such as
/path/to/page.html
or/users
is appended to the application URL (the devServer URL on development, ortauri://localhost/
andhttps://tauri.localhost/
on production).
sourcepub fn set_center(&mut self, center: bool) -> &mut Self
pub fn set_center(&mut self, center: bool) -> &mut Self
Show window in the center of the screen.
sourcepub fn set_position(&mut self, position: PhysicalPosition) -> &mut Self
pub fn set_position(&mut self, position: PhysicalPosition) -> &mut Self
The initial position.
sourcepub fn set_size(&mut self, size: PhysicalSize) -> &mut Self
pub fn set_size(&mut self, size: PhysicalSize) -> &mut Self
The initial size.
sourcepub fn set_min_size(&mut self, min_size: PhysicalSize) -> &mut Self
pub fn set_min_size(&mut self, min_size: PhysicalSize) -> &mut Self
Minimum window size.
sourcepub fn set_max_size(&mut self, max_size: PhysicalSize) -> &mut Self
pub fn set_max_size(&mut self, max_size: PhysicalSize) -> &mut Self
Maximum window size.
sourcepub fn set_resizable(&mut self, resizable: bool) -> &mut Self
pub fn set_resizable(&mut self, resizable: bool) -> &mut Self
Whether the window is resizable or not.
sourcepub fn set_fullscreen(&mut self, fullscreen: bool) -> &mut Self
pub fn set_fullscreen(&mut self, fullscreen: bool) -> &mut Self
Whether the window is in fullscreen mode or not.
sourcepub fn set_focus(&mut self, focus: bool) -> &mut Self
pub fn set_focus(&mut self, focus: bool) -> &mut Self
Whether the window will be initially focused or not.
sourcepub fn set_transparent(&mut self, transparent: bool) -> &mut Self
pub fn set_transparent(&mut self, transparent: bool) -> &mut Self
Whether the window is transparent or not.
Note that on macOS
this requires the macos-private-api
feature flag, enabled under tauri.conf.json > tauri > macOSPrivateApi
.
WARNING: Using private APIs on macOS
prevents your application from being accepted to the App Store
.
sourcepub fn set_maximized(&mut self, maximized: bool) -> &mut Self
pub fn set_maximized(&mut self, maximized: bool) -> &mut Self
Whether the window should be maximized upon creation or not.
sourcepub fn set_visible(&mut self, visible: bool) -> &mut Self
pub fn set_visible(&mut self, visible: bool) -> &mut Self
Whether the window should be immediately visible upon creation or not.
sourcepub fn set_decorations(&mut self, decorations: bool) -> &mut Self
pub fn set_decorations(&mut self, decorations: bool) -> &mut Self
Whether the window should have borders and bars or not.
sourcepub fn set_always_on_top(&mut self, always_on_top: bool) -> &mut Self
pub fn set_always_on_top(&mut self, always_on_top: bool) -> &mut Self
Whether the window should always be on top of other windows or not.
sourcepub fn set_skip_taskbar(&mut self, skip_taskbar: bool) -> &mut Self
pub fn set_skip_taskbar(&mut self, skip_taskbar: bool) -> &mut Self
Whether or not the window icon should be added to the taskbar.
sourcepub fn set_file_drop_enabled(&mut self, file_drop_enabled: bool) -> &mut Self
pub fn set_file_drop_enabled(&mut self, file_drop_enabled: bool) -> &mut Self
Whether the file drop is enabled or not on the webview. By default it is enabled.
Disabling it is required to use drag and drop on the frontend on Windows.
sourcepub fn set_theme(&mut self, theme: Theme) -> &mut Self
pub fn set_theme(&mut self, theme: Theme) -> &mut Self
The initial window theme. Defaults to the system theme.
Only implemented on Windows and macOS 10.14+.
sourcepub fn set_title_bar_style(
&mut self,
title_bar_style: TitleBarStyle,
) -> &mut Self
pub fn set_title_bar_style( &mut self, title_bar_style: TitleBarStyle, ) -> &mut Self
The style of the macOS title bar.
If true
, sets the window title to be hidden on macOS.
sourcepub fn set_accept_first_mouse(&mut self, accept_first_mouse: bool) -> &mut Self
pub fn set_accept_first_mouse(&mut self, accept_first_mouse: bool) -> &mut Self
Whether clicking an inactive window also clicks through to the webview.
sourcepub fn set_tabbing_identifier(
&mut self,
tabbing_identifier: &'a str,
) -> &mut Self
pub fn set_tabbing_identifier( &mut self, tabbing_identifier: &'a str, ) -> &mut Self
Defines the window tabbing identifier on macOS.
Windows with the same tabbing identifier will be grouped together. If the tabbing identifier is not set, automatic tabbing will be disabled.
sourcepub fn set_user_agent(&mut self, user_agent: &'a str) -> &mut Self
pub fn set_user_agent(&mut self, user_agent: &'a str) -> &mut Self
The user agent for the webview.
sourcepub async fn build(&self) -> Result<WebviewWindow, Error>
pub async fn build(&self) -> Result<WebviewWindow, Error>
Creates a new webview window.
Requires allowlist > window > create
to be enabled.
Trait Implementations§
source§impl<'a> Clone for WebviewWindowBuilder<'a>
impl<'a> Clone for WebviewWindowBuilder<'a>
source§fn clone(&self) -> WebviewWindowBuilder<'a>
fn clone(&self) -> WebviewWindowBuilder<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for WebviewWindowBuilder<'a>
impl<'a> Debug for WebviewWindowBuilder<'a>
source§impl<'a> Default for WebviewWindowBuilder<'a>
impl<'a> Default for WebviewWindowBuilder<'a>
source§fn default() -> WebviewWindowBuilder<'a>
fn default() -> WebviewWindowBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for WebviewWindowBuilder<'a>
impl<'a> RefUnwindSafe for WebviewWindowBuilder<'a>
impl<'a> Send for WebviewWindowBuilder<'a>
impl<'a> Sync for WebviewWindowBuilder<'a>
impl<'a> Unpin for WebviewWindowBuilder<'a>
impl<'a> UnwindSafe for WebviewWindowBuilder<'a>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)