@@ -10,7 +10,7 @@ use crate::{
10
10
flavors:: wry:: Wry ,
11
11
manager:: { Args , WindowManager } ,
12
12
tag:: Tag ,
13
- webview:: { Attributes , CustomProtocol } ,
13
+ webview:: { CustomProtocol , WebviewAttributes , WindowBuilder } ,
14
14
window:: PendingWindow ,
15
15
Dispatch , Runtime ,
16
16
} ,
@@ -183,12 +183,23 @@ where
183
183
/// Creates a new webview.
184
184
pub fn create_window < F > ( mut self , label : L , url : WindowUrl , setup : F ) -> Self
185
185
where
186
- F : FnOnce ( <R :: Dispatcher as Dispatch >:: Attributes ) -> <R :: Dispatcher as Dispatch >:: Attributes ,
186
+ F : FnOnce (
187
+ <R :: Dispatcher as Dispatch >:: WindowBuilder ,
188
+ WebviewAttributes ,
189
+ ) -> (
190
+ <R :: Dispatcher as Dispatch >:: WindowBuilder ,
191
+ WebviewAttributes ,
192
+ ) ,
187
193
{
188
- let attributes = setup ( <R :: Dispatcher as Dispatch >:: Attributes :: new ( ) ) ;
189
- self
190
- . pending_windows
191
- . push ( PendingWindow :: new ( attributes, label, url) ) ;
194
+ let ( window_attributes, webview_attributes) = setup (
195
+ <R :: Dispatcher as Dispatch >:: WindowBuilder :: new ( ) ,
196
+ WebviewAttributes :: new ( url) ,
197
+ ) ;
198
+ self . pending_windows . push ( PendingWindow :: new (
199
+ window_attributes,
200
+ webview_attributes,
201
+ label,
202
+ ) ) ;
192
203
self
193
204
}
194
205
@@ -236,9 +247,11 @@ where
236
247
. parse ( )
237
248
. unwrap_or_else ( |_| panic ! ( "bad label found in config: {}" , config. label) ) ;
238
249
239
- self
240
- . pending_windows
241
- . push ( PendingWindow :: with_config ( config, label, url) ) ;
250
+ self . pending_windows . push ( PendingWindow :: with_config (
251
+ config,
252
+ WebviewAttributes :: new ( url) ,
253
+ label,
254
+ ) ) ;
242
255
}
243
256
244
257
manager. initialize_plugins ( ) ?;
0 commit comments