mirror of
https://github.com/Tim-Paik/neutauri.git
synced 2024-10-12 23:29:41 +00:00
add windows icon
This commit is contained in:
10
Cargo.lock
generated
10
Cargo.lock
generated
@ -1045,6 +1045,7 @@ dependencies = [
|
|||||||
"bincode",
|
"bincode",
|
||||||
"brotli",
|
"brotli",
|
||||||
"serde",
|
"serde",
|
||||||
|
"winres",
|
||||||
"wry",
|
"wry",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -1845,6 +1846,15 @@ version = "0.4.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winres"
|
||||||
|
version = "0.1.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
|
||||||
|
dependencies = [
|
||||||
|
"toml",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wry"
|
name = "wry"
|
||||||
version = "0.12.2"
|
version = "0.12.2"
|
||||||
|
@ -8,3 +8,6 @@ bincode = "1.3"
|
|||||||
brotli = "3.3"
|
brotli = "3.3"
|
||||||
serde = {version = "1.0", features = ["derive"]}
|
serde = {version = "1.0", features = ["derive"]}
|
||||||
wry = "0.12"
|
wry = "0.12"
|
||||||
|
|
||||||
|
[target.'cfg(windows)'.build-dependencies]
|
||||||
|
winres = "0.1"
|
||||||
|
12
neutauri_runtime/build.rs
Normal file
12
neutauri_runtime/build.rs
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#[cfg(windows)]
|
||||||
|
extern crate winres;
|
||||||
|
|
||||||
|
#[cfg(windows)]
|
||||||
|
fn main() {
|
||||||
|
let mut res = winres::WindowsResource::new();
|
||||||
|
res.set_icon("wry.ico");
|
||||||
|
res.compile().unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
|
fn main() {}
|
@ -35,7 +35,7 @@ fn custom_protocol_uri_to_path<T: Into<String>>(protocol: T, uri: T) -> wry::Res
|
|||||||
fn main() -> wry::Result<()> {
|
fn main() -> wry::Result<()> {
|
||||||
let res = match data::load(std::env::current_exe()?.as_path()) {
|
let res = match data::load(std::env::current_exe()?.as_path()) {
|
||||||
Ok(data) => data,
|
Ok(data) => data,
|
||||||
Err(_) => data::load("app.neu")?,
|
Err(_) => data::load("data.neu")?,
|
||||||
};
|
};
|
||||||
let event_loop = EventLoop::new();
|
let event_loop = EventLoop::new();
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ fn main() -> wry::Result<()> {
|
|||||||
),
|
),
|
||||||
};
|
};
|
||||||
let path = std::env::current_exe()?;
|
let path = std::env::current_exe()?;
|
||||||
let path = path.file_name().unwrap_or_else(|| "neutauri_app".as_ref());
|
let path = path.file_stem().unwrap_or_else(|| "neutauri_app".as_ref());
|
||||||
let mut web_context = if cfg!(windows) {
|
let mut web_context = if cfg!(windows) {
|
||||||
let config_path = std::env::var("APPDATA").unwrap_or_else(|_| ".".into());
|
let config_path = std::env::var("APPDATA").unwrap_or_else(|_| ".".into());
|
||||||
let config_path = path::Path::new(&config_path).join(path);
|
let config_path = path::Path::new(&config_path).join(path);
|
||||||
|
BIN
neutauri_runtime/wry.ico
Normal file
BIN
neutauri_runtime/wry.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
Reference in New Issue
Block a user