@@ -9,10 +9,10 @@ use tao::{
9
9
event_loop:: EventLoop ,
10
10
window:: { Fullscreen , Icon , ProgressBarState , Window , WindowBuilder } ,
11
11
} ;
12
- use wry:: { http:: Request , Rect , WebView , WebViewBuilder , WebViewBuilderExtWindows } ;
12
+ use wry:: { http:: Request , Rect , WebView , WebViewBuilder } ;
13
13
14
- #[ cfg( target_os = "windows" ) ]
15
- use tao:: platform:: windows:: IconExtWindows ;
14
+ // #[cfg(target_os = "windows")]
15
+ // use tao::platform::windows::IconExtWindows;
16
16
17
17
#[ napi]
18
18
pub enum FullscreenType {
@@ -225,14 +225,34 @@ impl BrowserWindow {
225
225
webview = webview. with_hotkeys_zoom ( hotkeys_zoom) ;
226
226
}
227
227
228
- if let Some ( theme) = options. theme {
229
- let theme = match theme {
230
- JsTheme :: Light => wry:: Theme :: Light ,
231
- JsTheme :: Dark => wry:: Theme :: Dark ,
232
- _ => wry:: Theme :: Auto ,
233
- } ;
234
-
235
- webview = webview. with_theme ( theme)
228
+ {
229
+ #[ cfg( target_os = "windows" ) ]
230
+ use wry:: WebViewBuilderExtWindows ;
231
+
232
+ #[ cfg( any( target_os = "macos" , target_os = "ios" , ) ) ]
233
+ use wry:: WebViewBuilderExtDarwin ;
234
+
235
+ #[ cfg( target_os = "android" ) ]
236
+ use wry:: WebViewBuilderExtAndroid ;
237
+
238
+ #[ cfg( any(
239
+ target_os = "linux" ,
240
+ target_os = "dragonfly" ,
241
+ target_os = "freebsd" ,
242
+ target_os = "netbsd" ,
243
+ target_os = "openbsd" ,
244
+ ) ) ]
245
+ use wry:: WebViewBuilderExtUnix ;
246
+
247
+ if let Some ( theme) = options. theme {
248
+ let theme = match theme {
249
+ JsTheme :: Light => wry:: Theme :: Light ,
250
+ JsTheme :: Dark => wry:: Theme :: Dark ,
251
+ _ => wry:: Theme :: Auto ,
252
+ } ;
253
+
254
+ webview = webview. with_theme ( theme)
255
+ }
236
256
}
237
257
238
258
if let Some ( user_agent) = options. user_agent {
@@ -501,6 +521,8 @@ impl BrowserWindow {
501
521
) -> Result < ( ) > {
502
522
#[ cfg( target_os = "windows" ) ]
503
523
{
524
+ use tao:: platform:: windows:: IconExtWindows ;
525
+
504
526
let ico = match icon {
505
527
Either :: A ( bytes) => Icon :: from_rgba ( bytes, width, height) ,
506
528
Either :: B ( path) => Icon :: from_path ( & path, PhysicalSize :: new ( width, height) . into ( ) ) ,
0 commit comments