mirror of https://github.com/Tim-Paik/neutauri.git
update deps ,dev mode now available
This commit is contained in:
parent
2f9e3b80ba
commit
638ba99d04
File diff suppressed because it is too large
Load Diff
|
@ -3,7 +3,3 @@ members = [
|
|||
"neutauri_runtime",
|
||||
"neutauri_bundler",
|
||||
]
|
||||
|
||||
[neutauri_bundler.profile.release.package.wry]
|
||||
debug = true
|
||||
debug-assertions = true
|
||||
|
|
|
@ -7,8 +7,8 @@ version = "0.1.0"
|
|||
bincode = "1.3"
|
||||
brotli = "3.3"
|
||||
gumdrop = "0.8"
|
||||
image = "0.23"
|
||||
image = "0.24"
|
||||
new_mime_guess = "4.0"
|
||||
serde = {version = "1.0", features = ["derive"]}
|
||||
toml = "0.5"
|
||||
wry = "0.12"
|
||||
wry = {version = "0.15", features = ["devtools"]}
|
||||
|
|
|
@ -7,7 +7,7 @@ use wry::{
|
|||
event_loop::{ControlFlow, EventLoop},
|
||||
window::{Fullscreen, Icon, Window, WindowBuilder},
|
||||
},
|
||||
webview::{RpcRequest, WebContext, WebViewBuilder},
|
||||
webview::{WebContext, WebViewBuilder},
|
||||
};
|
||||
|
||||
use crate::data;
|
||||
|
@ -109,7 +109,7 @@ pub fn dev(config_path: String) -> wry::Result<()> {
|
|||
false => webview_builder
|
||||
.with_visible(false)
|
||||
.with_initialization_script(
|
||||
r#"window.addEventListener('load', function(event) { rpc.call('show_window'); });"#,
|
||||
r#"window.addEventListener('load', function(event) { window.ipc.postMessage('show_window'); });"#,
|
||||
),
|
||||
};
|
||||
let path = std::env::current_exe()?;
|
||||
|
@ -172,14 +172,14 @@ pub fn dev(config_path: String) -> wry::Result<()> {
|
|||
}
|
||||
wry::http::ResponseBuilder::new().mimetype(&mime).body(data)
|
||||
})
|
||||
.with_rpc_handler(|window: &Window, req: RpcRequest| {
|
||||
match req.method.as_str() {
|
||||
.with_ipc_handler(|window: &Window, req: String| {
|
||||
match req.as_str() {
|
||||
"show_window" => window.set_visible(true),
|
||||
"ping" => println!("recived a ping"),
|
||||
_ => (),
|
||||
};
|
||||
None
|
||||
})
|
||||
.with_devtools(true)
|
||||
.build()?;
|
||||
|
||||
event_loop.run(move |event, _, control_flow| {
|
||||
|
|
|
@ -7,7 +7,7 @@ version = "0.1.0"
|
|||
bincode = "1.3"
|
||||
brotli = "3.3"
|
||||
serde = {version = "1.0", features = ["derive"]}
|
||||
wry = "0.12"
|
||||
wry = "0.15"
|
||||
|
||||
[target.'cfg(windows)'.build-dependencies]
|
||||
winres = "0.1"
|
||||
|
|
|
@ -9,7 +9,7 @@ use wry::{
|
|||
event_loop::{ControlFlow, EventLoop},
|
||||
window::{Fullscreen, Icon, Window, WindowBuilder},
|
||||
},
|
||||
webview::{RpcRequest, WebContext, WebViewBuilder},
|
||||
webview::{WebContext, WebViewBuilder},
|
||||
};
|
||||
mod data;
|
||||
|
||||
|
@ -109,7 +109,7 @@ fn main() -> wry::Result<()> {
|
|||
false => webview_builder
|
||||
.with_visible(false)
|
||||
.with_initialization_script(
|
||||
r#"window.addEventListener('load', function(event) { rpc.call('show_window'); });"#,
|
||||
r#"window.addEventListener('load', function(event) { window.ipc.postMessage('show_window'); });"#,
|
||||
),
|
||||
};
|
||||
let path = std::env::current_exe()?;
|
||||
|
@ -161,14 +161,14 @@ fn main() -> wry::Result<()> {
|
|||
.mimetype(&file.mimetype())
|
||||
.body(file.decompressed_data()?)
|
||||
})
|
||||
.with_rpc_handler(|window: &Window, req: RpcRequest| {
|
||||
match req.method.as_str() {
|
||||
.with_ipc_handler(|window: &Window, req: String| {
|
||||
match req.as_str() {
|
||||
"show_window" => window.set_visible(true),
|
||||
"ping" => println!("recived a ping"),
|
||||
_ => (),
|
||||
};
|
||||
None
|
||||
})
|
||||
.with_devtools(false)
|
||||
.build()?;
|
||||
|
||||
event_loop.run(move |event, _, control_flow| {
|
||||
|
|
Loading…
Reference in New Issue