- Added an icon to the application
This commit is contained in:
Craig Constable 2026-03-06 16:55:31 +10:00
parent c8bd9683dd
commit a68f801812
12 changed files with 89 additions and 14 deletions

38
Cargo.lock generated
View File

@ -46,6 +46,7 @@ dependencies = [
"serde_json",
"ureq",
"windows",
"winres",
]
[[package]]
@ -82,7 +83,7 @@ dependencies = [
"libc",
"option-ext",
"redox_users",
"windows-sys 0.61.2",
"windows-sys",
]
[[package]]
@ -109,7 +110,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
"windows-sys 0.52.0",
"windows-sys",
]
[[package]]
@ -520,7 +521,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.52.0",
"windows-sys",
]
[[package]]
@ -529,7 +530,7 @@ version = "0.1.28"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1"
dependencies = [
"windows-sys 0.61.2",
"windows-sys",
]
[[package]]
@ -654,7 +655,7 @@ dependencies = [
"getrandom 0.4.1",
"once_cell",
"rustix",
"windows-sys 0.52.0",
"windows-sys",
]
[[package]]
@ -687,6 +688,15 @@ dependencies = [
"zerovec",
]
[[package]]
name = "toml"
version = "0.5.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234"
dependencies = [
"serde",
]
[[package]]
name = "unicode-ident"
version = "1.0.24"
@ -866,15 +876,6 @@ dependencies = [
"windows-targets",
]
[[package]]
name = "windows-sys"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
dependencies = [
"windows-targets",
]
[[package]]
name = "windows-sys"
version = "0.61.2"
@ -948,6 +949,15 @@ version = "0.52.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
[[package]]
name = "winres"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
dependencies = [
"toml",
]
[[package]]
name = "wit-bindgen"
version = "0.51.0"

View File

@ -26,6 +26,9 @@ features = [
"Win32_UI_Input_KeyboardAndMouse",
]
[build-dependencies]
winres = "0.1"
[profile.release]
opt-level = "z"
lto = true

View File

@ -15,4 +15,9 @@ fn main() {
let version = version.trim().trim_start_matches('v');
println!("cargo:rustc-env=APP_VERSION={version}");
// Embed the application icon into the executable.
let mut res = winres::WindowsResource::new();
res.set_icon("src/icons/icon.ico");
res.compile().expect("Failed to compile Windows resources");
}

8
src/icons/16.svg Normal file
View File

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none">
<rect x="0.5" y="0.5" width="15" height="15" rx="1" stroke="#D97757" stroke-width="1"></rect>
<rect x="2" y="2" width="5" height="5" rx="1" fill="#D97757"></rect>
<rect x="9" y="2" width="5" height="5" rx="1" fill="#F3D6CC"></rect>
<rect x="2" y="9" width="5" height="5" rx="1" fill="#D97757"></rect>
<rect x="9" y="9" width="5" height="5" rx="1" fill="#F3D6CC"></rect>
<path d="M 10 2 L 11 2 L 11 7 L 10 7 C 9.448 7 9 6.552 9 6 L 9 3 C 9 2.448 9.448 2 10 2 Z" fill="#D97757"></path>
</svg>

After

Width:  |  Height:  |  Size: 575 B

BIN
src/icons/16x16.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

25
src/icons/256.svg Normal file
View File

@ -0,0 +1,25 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none">
<rect x="4" y="36" width="248" height="184" rx="16" stroke="#D97757" stroke-width="8"></rect>
<rect x="15" y="72" width="19" height="48" rx="4" fill="#D97757"></rect>
<rect x="38" y="72" width="19" height="48" rx="4" fill="#D97757"></rect>
<rect x="61" y="72" width="19" height="48" rx="4" fill="#D97757"></rect>
<rect x="84" y="72" width="19" height="48" rx="4" fill="#D97757"></rect>
<rect x="107" y="72" width="19" height="48" rx="4" fill="#D97757"></rect>
<rect x="130" y="72" width="19" height="48" rx="4" fill="#F3D6CC"></rect>
<rect x="153" y="72" width="19" height="48" rx="4" fill="#F3D6CC"></rect>
<rect x="176" y="72" width="19" height="48" rx="4" fill="#F3D6CC"></rect>
<rect x="199" y="72" width="19" height="48" rx="4" fill="#F3D6CC"></rect>
<rect x="222" y="72" width="19" height="48" rx="4" fill="#F3D6CC"></rect>
<rect x="15" y="136" width="19" height="48" rx="4" fill="#D97757"></rect>
<rect x="38" y="136" width="19" height="48" rx="4" fill="#D97757"></rect>
<rect x="61" y="136" width="19" height="48" rx="4" fill="#D97757"></rect>
<rect x="84" y="136" width="19" height="48" rx="4" fill="#F3D6CC"></rect>
<rect x="107" y="136" width="19" height="48" rx="4" fill="#F3D6CC"></rect>
<rect x="130" y="136" width="19" height="48" rx="4" fill="#F3D6CC"></rect>
<rect x="153" y="136" width="19" height="48" rx="4" fill="#F3D6CC"></rect>
<rect x="176" y="136" width="19" height="48" rx="4" fill="#F3D6CC"></rect>
<rect x="199" y="136" width="19" height="48" rx="4" fill="#F3D6CC"></rect>
<rect x="222" y="136" width="19" height="48" rx="4" fill="#F3D6CC"></rect>
<path d="M 134 72 L 143 72 L 143 120 L 134 120 C 131.791 120 130 118.209 130 116 L 130 76 C 130 73.791 131.791 72 134 72 Z" fill="#D97757"></path>
<path d="M 88 136 L 89 136 L 89 184 L 88 184 C 85.791 184 84 182.209 84 180 L 84 140 C 84 137.791 85.791 136 88 136 Z" fill="#D97757"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

BIN
src/icons/256x256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

10
src/icons/32.svg Normal file
View File

@ -0,0 +1,10 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="none">
<rect x="1" y="1" width="30" height="30" rx="4" stroke="#D97757" stroke-width="2"></rect>
<rect x="3" y="4" width="8" height="11" rx="2" fill="#D97757"></rect>
<rect x="12" y="4" width="8" height="11" rx="2" fill="#D97757"></rect>
<rect x="21" y="4" width="8" height="11" rx="2" fill="#F3D6CC"></rect>
<path d="M 23 4 L 25 4 L 25 15 L 23 15 C 21.895 15 21 14.18 21 13.167 L 21 5.833 C 21 4.82 21.895 4 23 4 Z" fill="#D97757"></path>
<rect x="3" y="17" width="8" height="11" rx="2" fill="#D97757"></rect>
<rect x="12" y="17" width="8" height="11" rx="2" fill="#D97757"></rect>
<rect x="21" y="17" width="8" height="11" rx="2" fill="#F3D6CC"></rect>
</svg>

After

Width:  |  Height:  |  Size: 743 B

BIN
src/icons/32x32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 B

14
src/icons/48.svg Normal file
View File

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" fill="none">
<rect x="2" y="2" width="44" height="44" rx="6" stroke="#D97757" stroke-width="4"></rect>
<rect x="7" y="10" width="6" height="12" rx="2" fill="#D97757"></rect>
<rect x="14" y="10" width="6" height="12" rx="2" fill="#D97757"></rect>
<rect x="21" y="10" width="6" height="12" rx="2" fill="#D97757"></rect>
<rect x="28" y="10" width="6" height="12" rx="2" fill="#F3D6CC"></rect>
<path d="M 30 10 L 31 10 L 31 22 L 30 22 C 28.895 22 28 21.105 28 20 L 28 12 C 28 10.895 28.895 10 30 10 Z" fill="#D97757"></path>
<rect x="35" y="10" width="6" height="12" rx="2" fill="#F3D6CC"></rect>
<rect x="7" y="26" width="6" height="12" rx="2" fill="#D97757"></rect>
<rect x="14" y="26" width="6" height="12" rx="2" fill="#D97757"></rect>
<rect x="21" y="26" width="6" height="12" rx="2" fill="#F3D6CC"></rect>
<rect x="28" y="26" width="6" height="12" rx="2" fill="#F3D6CC"></rect>
<rect x="35" y="26" width="6" height="12" rx="2" fill="#F3D6CC"></rect>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

BIN
src/icons/48x48.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

BIN
src/icons/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB