1
0
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:
2022-02-04 01:08:15 +08:00
parent 4fc4504057
commit a242b1b12d
5 changed files with 27 additions and 2 deletions

View File

@ -8,3 +8,6 @@ bincode = "1.3"
brotli = "3.3"
serde = {version = "1.0", features = ["derive"]}
wry = "0.12"
[target.'cfg(windows)'.build-dependencies]
winres = "0.1"

12
neutauri_runtime/build.rs Normal file
View 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() {}

View File

@ -35,7 +35,7 @@ fn custom_protocol_uri_to_path<T: Into<String>>(protocol: T, uri: T) -> wry::Res
fn main() -> wry::Result<()> {
let res = match data::load(std::env::current_exe()?.as_path()) {
Ok(data) => data,
Err(_) => data::load("app.neu")?,
Err(_) => data::load("data.neu")?,
};
let event_loop = EventLoop::new();
@ -113,7 +113,7 @@ fn main() -> wry::Result<()> {
),
};
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 config_path = std::env::var("APPDATA").unwrap_or_else(|_| ".".into());
let config_path = path::Path::new(&config_path).join(path);

BIN
neutauri_runtime/wry.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB