windows: display icon (#9571)
Now `Zed` can display icons. The image below shows the icon of the `zed.exe` file and the icon in the right-click properties.  I used the `crates\zed\resources\app-icon@2x.png` file to generate the `.ico` file. Due to some blank space around the logo in the original file, the logo appears slightly smaller on Windows compared to other software.  The current `.ico` file contains logo files of multiple sizes: 16x16, 24x24, 32x32, 48x48, 64x64, 96x96, 128x128, 256x256, 512x512. Release Notes: - N/A
This commit is contained in:
parent
f179158913
commit
3fd62a2313
4 changed files with 28 additions and 5 deletions
|
@ -50,15 +50,18 @@ fn main() {
|
|||
println!("cargo:rustc-link-arg=/stack:{}", 8 * 1024 * 1024);
|
||||
|
||||
let manifest = std::path::Path::new("resources/windows/manifest.xml");
|
||||
let icon = std::path::Path::new("resources/windows/app-icon.ico");
|
||||
println!("cargo:rerun-if-changed={}", manifest.display());
|
||||
println!("cargo:rustc-link-arg-bins=/MANIFEST:EMBED");
|
||||
println!("cargo:rerun-if-changed={}", icon.display());
|
||||
|
||||
println!("cargo:rustc-link-arg-bins=/MANIFEST:EMBED");
|
||||
println!(
|
||||
"cargo:rustc-link-arg-bins=/MANIFESTINPUT:{}",
|
||||
manifest.canonicalize().unwrap().display()
|
||||
);
|
||||
|
||||
let res = winresource::WindowsResource::new();
|
||||
let mut res = winresource::WindowsResource::new();
|
||||
res.set_icon(icon.to_str().unwrap());
|
||||
if let Err(e) = res.compile() {
|
||||
eprintln!("{}", e);
|
||||
std::process::exit(1);
|
||||
|
|
BIN
crates/zed/resources/windows/app-icon.ico
Normal file
BIN
crates/zed/resources/windows/app-icon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 577 KiB |
Loading…
Add table
Add a link
Reference in a new issue