1
0
mirror of https://github.com/Tim-Paik/neutauri.git synced 2024-10-12 23:29:41 +00:00

update deps
Some checks reported errors
continuous-integration/drone/push Build encountered an error

This commit is contained in:
2022-07-02 01:20:37 +08:00
parent ed45c5dcd5
commit 8962b3d80b
7 changed files with 329 additions and 432 deletions

View File

@ -58,12 +58,15 @@ fn main() -> wry::Result<()> {
)?)),
None => window_builder,
};
let monitor_size = event_loop.primary_monitor().unwrap_or_else(|| {
event_loop
.available_monitors()
.next()
.expect("no monitor found")
}).size();
let monitor_size = event_loop
.primary_monitor()
.unwrap_or_else(|| {
event_loop
.available_monitors()
.next()
.expect("no monitor found")
})
.size();
let window_builder = match res.window_attr.inner_size {
Some(size) => window_builder.with_inner_size(get_size(size, monitor_size)),
None => window_builder,
@ -141,7 +144,9 @@ fn main() -> wry::Result<()> {
.with_visible(res.window_attr.visible)
.with_transparent(res.window_attr.transparent)
.with_web_context(&mut web_context)
.with_initialization_script(r#"window.oncontextmenu = (event) => { event.preventDefault(); }"#)
.with_initialization_script(
r#"window.oncontextmenu = (event) => { event.preventDefault(); }"#,
)
.with_custom_protocol(PROTOCOL.to_string(), move |request| {
let path = custom_protocol_uri_to_path(PROTOCOL, request.uri())?;
let mut file = match res.open(path) {
@ -177,9 +182,7 @@ fn main() -> wry::Result<()> {
event: WindowEvent::CloseRequested,
..
} => *control_flow = ControlFlow::Exit,
_ => {
let _ = webview.resize();
}
_ => (),
}
});
}