fix(ohos): show Robrix launcher icon instead of makepad placeholder - #257
Open
TigerInYourDream wants to merge 1 commit into
Open
fix(ohos): show Robrix launcher icon instead of makepad placeholder#257TigerInYourDream wants to merge 1 commit into
TigerInYourDream wants to merge 1 commit into
Conversation
cargo-makepad's ohos generator scaffolds the DevEco project from its own template (which ships makepad's placeholder icon) and has no hook to use the project's real icon — unlike the Android path, which reads [package.metadata.makepad.android].icons in Cargo.toml. The project is also regenerated under target/ on every `deveco` run, so the icon can't just be committed into the generated tree. Add Robrix's HarmonyOS launcher icon as a proper layered icon — a transparent cube foreground kept inside the Ø192 safe zone over a solid white background, with the system supplying the mask/elevation (no baked-in card or shadow) — plus apply-app-icon.sh to inject it into the generated DevEco project between `deveco` and `build`. Cube artwork derived from resources/robrix_logo_alpha.png. Verified on a real HarmonyOS device: the launcher now shows the Robrix cube.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On HarmonyOS, Robrix shows makepad's generic placeholder icon on the launcher instead of the Robrix logo.
Root cause
cargo makepad ohos ... devecoscaffolds the DevEco project from cargo-makepad's built-in template, which ships makepad's placeholder icon. The ohos generator has no hook to use the project's real icon — unlike the Android path, which reads[package.metadata.makepad.android].iconsinCargo.toml. The generated project also lives undertarget/and is regenerated on everydevecorun, so the icon can't simply be committed into it.(Confirmed by diffing the generated project's media against the cargo-makepad template — they were byte-identical, i.e. the project's icon was never used.)
Fix
packaging/ohos/media/as a proper layered icon: a transparent Robrix cube foreground kept inside the Ø192 safe zone over a solid white background, letting the system supply the mask + elevation (no baked-in card/shadow). Cube artwork derived fromresources/robrix_logo_alpha.png.packaging/ohos/apply-app-icon.shto inject those assets into the generated DevEco project. Run it afterdeveco, beforebuild(documented inpackaging/ohos/README.md).Design
Follows HarmonyOS's layered-icon convention rather than the iOS/desktop "card" style, so it doesn't fight the launcher's own rounded mask and elevation.
foreground.pngbackground.pngapp_icon.pngstartIcon.pngVerification
Built + signed + installed on a real HarmonyOS device — the launcher now shows the Robrix cube (previously the makepad placeholder). App also launches and renders normally.
Follow-up
The proper long-term fix is upstream: teach cargo-makepad's ohos generator to read the project's icon (as the Android path already does), which would make the inject script unnecessary.