mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 13:17:02 +00:00
This commit is contained in:
parent
50d135b20f
commit
985d250898
5
.changes/fix-window-builder-export.md
Normal file
5
.changes/fix-window-builder-export.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Fixes the `WindowBuilder` export.
|
||||
@ -211,7 +211,7 @@ pub use {
|
||||
},
|
||||
self::manager::Asset,
|
||||
self::runtime::{
|
||||
webview::{WebviewAttributes, WindowBuilder},
|
||||
webview::WebviewAttributes,
|
||||
window::{
|
||||
dpi::{LogicalPosition, LogicalSize, PhysicalPosition, PhysicalSize, Pixel, Position, Size},
|
||||
FileDropEvent,
|
||||
@ -224,7 +224,7 @@ pub use {
|
||||
config::{Config, WindowUrl},
|
||||
Env, PackageInfo,
|
||||
},
|
||||
self::window::{Monitor, Window},
|
||||
self::window::{Monitor, Window, WindowBuilder},
|
||||
scope::*,
|
||||
};
|
||||
|
||||
|
||||
@ -17,14 +17,16 @@ fn main() {
|
||||
println!("got 'clicked' event on window '{}'", label);
|
||||
});
|
||||
})
|
||||
.create_window(
|
||||
"Rust".to_string(),
|
||||
tauri::WindowUrl::App("index.html".into()),
|
||||
|window_builder, webview_attributes| {
|
||||
(window_builder.title("Tauri - Rust"), webview_attributes)
|
||||
},
|
||||
)
|
||||
.unwrap() // safe to unwrap: window label is valid
|
||||
.setup(|app| {
|
||||
WindowBuilder::new(
|
||||
app,
|
||||
"Rust".to_string(),
|
||||
tauri::WindowUrl::App("index.html".into()),
|
||||
)
|
||||
.title("Tauri - Rust")
|
||||
.build()?;
|
||||
Ok(())
|
||||
})
|
||||
.run(tauri::generate_context!(
|
||||
"../../examples/multiwindow/tauri.conf.json"
|
||||
))
|
||||
|
||||
@ -9,14 +9,14 @@
|
||||
|
||||
#[cfg(any(windows, target_os = "macos"))]
|
||||
use tauri::Manager;
|
||||
use tauri::{command, window, AppHandle, WindowBuilder, WindowUrl};
|
||||
use tauri::{command, window::WindowBuilder, AppHandle, WindowUrl};
|
||||
|
||||
#[command]
|
||||
fn create_child_window(id: String, app: AppHandle) {
|
||||
#[cfg(any(windows, target_os = "macos"))]
|
||||
let main = app.get_window("main").unwrap();
|
||||
|
||||
let child = window::WindowBuilder::new(&app, id, WindowUrl::default())
|
||||
let child = WindowBuilder::new(&app, id, WindowUrl::default())
|
||||
.title("Child")
|
||||
.inner_size(400.0, 300.0);
|
||||
|
||||
@ -37,17 +37,13 @@ fn main() {
|
||||
});
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![create_child_window])
|
||||
.create_window(
|
||||
"main".to_string(),
|
||||
WindowUrl::default(),
|
||||
|window_builder, webview_attributes| {
|
||||
(
|
||||
window_builder.title("Main").inner_size(600.0, 400.0),
|
||||
webview_attributes,
|
||||
)
|
||||
},
|
||||
)
|
||||
.unwrap() // safe to unwrap: window label is valid
|
||||
.setup(|app| {
|
||||
WindowBuilder::new(app, "main".to_string(), WindowUrl::default())
|
||||
.title("Main")
|
||||
.inner_size(600.0, 400.0)
|
||||
.build()?;
|
||||
Ok(())
|
||||
}) // safe to unwrap: window label is valid
|
||||
.run(tauri::generate_context!(
|
||||
"../../examples/parent-window/tauri.conf.json"
|
||||
))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user