Skip to content

fix(ohos): show Robrix launcher icon instead of makepad placeholder - #257

Open
TigerInYourDream wants to merge 1 commit into
mainfrom
fix/ohos-app-icon
Open

fix(ohos): show Robrix launcher icon instead of makepad placeholder#257
TigerInYourDream wants to merge 1 commit into
mainfrom
fix/ohos-app-icon

Conversation

@TigerInYourDream

Copy link
Copy Markdown

Problem

On HarmonyOS, Robrix shows makepad's generic placeholder icon on the launcher instead of the Robrix logo.

Root cause

cargo makepad ohos ... deveco scaffolds 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].icons in Cargo.toml. The generated project also lives under target/ and is regenerated on every deveco run, 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

  • Add Robrix's HarmonyOS launcher icon under 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 from resources/robrix_logo_alpha.png.
  • Add packaging/ohos/apply-app-icon.sh to inject those assets into the generated DevEco project. Run it after deveco, before build (documented in packaging/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.

icon size content
foreground.png 288×288 transparent cube, Ø192 safe zone
background.png 288×288 solid white
app_icon.png 216×216 cube on white
startIcon.png 288×288 cube on white

Verification

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant