1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 05:12:40 +03:00

Embed icon into windows executable and titlebar

This also applies to X11 when using the glutin frontend
This commit is contained in:
Wez Furlong 2019-03-24 19:06:03 -07:00
parent 1980e738c7
commit a56f37598c
6 changed files with 24 additions and 1 deletions

View File

@ -8,6 +8,9 @@ build = "build.rs"
[build-dependencies]
vergen = "3"
[target.'cfg(windows)'.build-dependencies]
embed-resource = "1.1"
[dependencies]
base91 = { path = "base91" }
bitflags = "1.0"
@ -20,7 +23,7 @@ failure_derive = "0.1"
foreign-types = "0.3"
freetype = { path = "deps/freetype" }
gl = "0.11"
glium = { version = "0.23", default-features = false, features = ["glutin"]}
glium = { version = "0.23", default-features = false, features = ["glutin", "icon_loading"]}
harfbuzz = { path = "deps/harfbuzz" }
lazy_static = "1.3"
leb128 = "0.2"

View File

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<dpiAwareness>PerMonitorV2, unaware</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

View File

@ -0,0 +1,5 @@
#define IDI_ICON 0x101
IDI_ICON ICON "terminal.ico"
#define RT_MANIFEST 24
#define APP_MANIFEST 1
APP_MANIFEST RT_MANIFEST manifest.manifest

View File

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 84 KiB

View File

@ -7,4 +7,7 @@ fn main() {
// Generate the 'cargo:' key output
generate_cargo_keys(ConstantsFlags::all()).expect("Unable to generate the cargo keys!");
#[cfg(windows)]
embed_resource::compile("assets/windows/resource.rc");
}

View File

@ -214,6 +214,9 @@ impl GliumTerminalWindow {
.with_pixel_format(24, 8);
let window = glutin::WindowBuilder::new()
.with_dimensions(logical_size)
.with_window_icon(Some(glutin::Icon::from_bytes(include_bytes!(
"../../../assets/icon/terminal.png"
))?))
.with_title("wezterm");
let mut_loop = event_loop.event_loop.borrow_mut();