Skip to content

Commit 0f57a2b

Browse files
committed
fix: build issues
1 parent 111031a commit 0f57a2b

File tree

2 files changed

+34
-12
lines changed

2 files changed

+34
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,4 @@
9595
"useTabs": false
9696
},
9797
"packageManager": "[email protected]"
98-
}
98+
}

src/browser_window.rs

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ use tao::{
99
event_loop::EventLoop,
1010
window::{Fullscreen, Icon, ProgressBarState, Window, WindowBuilder},
1111
};
12-
use wry::{http::Request, Rect, WebView, WebViewBuilder, WebViewBuilderExtWindows};
12+
use wry::{http::Request, Rect, WebView, WebViewBuilder};
1313

14-
#[cfg(target_os = "windows")]
15-
use tao::platform::windows::IconExtWindows;
14+
// #[cfg(target_os = "windows")]
15+
// use tao::platform::windows::IconExtWindows;
1616

1717
#[napi]
1818
pub enum FullscreenType {
@@ -225,14 +225,34 @@ impl BrowserWindow {
225225
webview = webview.with_hotkeys_zoom(hotkeys_zoom);
226226
}
227227

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+
}
236256
}
237257

238258
if let Some(user_agent) = options.user_agent {
@@ -501,6 +521,8 @@ impl BrowserWindow {
501521
) -> Result<()> {
502522
#[cfg(target_os = "windows")]
503523
{
524+
use tao::platform::windows::IconExtWindows;
525+
504526
let ico = match icon {
505527
Either::A(bytes) => Icon::from_rgba(bytes, width, height),
506528
Either::B(path) => Icon::from_path(&path, PhysicalSize::new(width, height).into()),

0 commit comments

Comments
 (0)