Add the Arena Tracker logo and embed its Windows application icon
Ticket #16. The logo is a gold ring around a crown: the Arena seen from above and a top 1, without text. The Windows icon derived from it is embedded in the executable as icon resource 1 by a build script, which is the resource GPUI loads for the window: File Explorer, the window and the taskbar show it with no loose file next to the executable. embed-resource was already in Cargo.lock as a build dependency of GPUI. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit was merged in pull request #26.
This commit is contained in:
1 parent
03ad0ec90a
commit
7c7e667c57
7 files changed
+37
No files matched your search
Generated
+1
@@ -207,6 +207,7 @@ name = "arena-tracker"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arena-tracker-core",
|
"arena-tracker-core",
|
||||||
|
"embed-resource",
|
||||||
"gpui-kit",
|
"gpui-kit",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,14 @@ Depuis WSL, à la racine du dépôt :
|
|||||||
|
|
||||||
La première compilation de GPUI prend plusieurs minutes.
|
La première compilation de GPUI prend plusieurs minutes.
|
||||||
|
|
||||||
|
## Icône
|
||||||
|
|
||||||
|
Le logo est `crates/app/assets/logo.svg`. L'icône Windows `crates/app/assets/icon.ico` en est dérivée et est intégrée à l'exécutable à la compilation (`crates/app/build.rs`) : l'Explorateur, la fenêtre et la barre des tâches l'affichent sans fichier à côté de l'exécutable. Après une modification du logo, régénérer l'icône avec ImageMagick, depuis `crates/app/assets` :
|
||||||
|
|
||||||
|
```
|
||||||
|
magick -background none -density 384 logo.svg -resize 1024x1024 -define icon:auto-resize=256,64,48,40,32,24,20,16 icon.ico
|
||||||
|
```
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
L'application lit `%APPDATA%\arena-tracker\config.toml`, en dehors du dépôt. Le fichier est facultatif : au premier lancement, l'application demande la clé API Riot (à demander sur le portail développeur Riot), l'enregistre dans ce fichier et la prend en compte sans redémarrage. La clé se change ensuite dans `Paramètres`. Exemple de fichier, avec des valeurs fictives :
|
L'application lit `%APPDATA%\arena-tracker\config.toml`, en dehors du dépôt. Le fichier est facultatif : au premier lancement, l'application demande la clé API Riot (à demander sur le portail développeur Riot), l'enregistre dans ce fichier et la prend en compte sans redémarrage. La clé se change ensuite dans `Paramètres`. Exemple de fichier, avec des valeurs fictives :
|
||||||
|
|||||||
@@ -7,3 +7,6 @@ version.workspace = true
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
arena-tracker-core = { path = "../core" }
|
arena-tracker-core = { path = "../core" }
|
||||||
gpui-kit = "=0.9.1"
|
gpui-kit = "=0.9.1"
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
embed-resource = "3.0.12"
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
// GPUI loads icon resource 1 for the window and its taskbar entry; File Explorer shows it too.
|
||||||
|
1 ICON "icon.ico"
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
@@ -0,0 +1,7 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" width="256" height="256">
|
||||||
|
<!-- The Arena seen from above: a ring. The gold rim keeps the disc visible on dark backgrounds. -->
|
||||||
|
<circle cx="128" cy="128" r="124" fill="#f5b83d"/>
|
||||||
|
<circle cx="128" cy="128" r="100" fill="#161b2e"/>
|
||||||
|
<!-- A top 1: a crown, in one solid shape so that it survives at 16 pixels. -->
|
||||||
|
<path fill="#f5b83d" d="M68 186 L52 86 L98 126 L128 66 L158 126 L204 86 L188 186 Z"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 474 B |
@@ -0,0 +1,16 @@
|
|||||||
|
//! Embeds the application icon in the Windows executable, so that File Explorer, the window
|
||||||
|
//! and the taskbar show it without any loose file next to the executable.
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
|
println!("cargo:rerun-if-changed=assets/app.rc");
|
||||||
|
println!("cargo:rerun-if-changed=assets/icon.ico");
|
||||||
|
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() == Ok("windows") {
|
||||||
|
embed_resource::compile(
|
||||||
|
"assets/app.rc",
|
||||||
|
embed_resource::ParamsIncludeDirs(["assets"]),
|
||||||
|
)
|
||||||
|
.manifest_required()
|
||||||
|
.expect("Failed to embed the application icon");
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user