Skip to content

Build your personal knowledge base with Trilium Notes

fix(desktop): center DMG icons on the background pedestals

Elian Doran1f26f2591cbd
diff --git a/apps/desktop/electron-forge/dmg-background/README.md b/apps/desktop/electron-forge/dmg-background/README.md
index bcf3912f54..63d93f6f77 100644
--- a/apps/desktop/electron-forge/dmg-background/README.md
+++ b/apps/desktop/electron-forge/dmg-background/README.md
@@ -41,7 +41,8 @@ reads `background.png`/`@2x`). Kept reproducible from source so it isn't a myste
`forge.config.ts`. Those coordinates use a **top-left** origin, y increasing downward, with `(x, y)`
being the icon center — Finder's `.DS_Store` `Iloc` convention (confirmed by appdmg's own example,
where `y: 344` sits near the *bottom* of the window). So for a pedestal centered at `y` from the top,
- the `contents` entry should also be `y` from the top — not `windowHeight - y`.
+ the `contents` entry is also `y` from the top — not `windowHeight - y`. The pedestals are centered at
+ **y = 215** (`top: 140 + height: 150 / 2`), so `contents` uses `y = 215` to match.
- **No baked text beyond the "Trilium Notes" wordmark** (a brand name, not translated). The DMG ships
one image for every locale, so there is no localized instruction line — the arrow conveys the action,
and Finder draws the app name and "Applications" labels under the real icons.
@@ -49,7 +50,6 @@ reads `background.png`/`@2x`). Kept reproducible from source so it isn't a myste
## Output contract
- 640 × 400 pt window; `background.png` is 640 × 400, `[email protected]` is 1280 × 800.
-- `iconSize` 128; app icon centered at (180, 185), Applications at (460, 185) in **top-left** coords —
- keep these in sync with the platform positions in `background.html` and the `contents` in the maker config.
- Note the pedestals in `background.html` are centered at **y = 215** from the top (`top: 140 + height: 150 / 2`),
- so `contents` at `y = 185` currently lands the icons ~30 px **above** the pedestals; align them to fix.
+- `iconSize` 128; app icon centered at (180, 215), Applications at (460, 215) in **top-left** coords,
+ matching the pedestal centers in `background.html` (`top: 140 + height: 150 / 2`) — keep these in sync
+ with the platform positions in `background.html` and the `contents` in the maker config.
diff --git a/apps/desktop/electron-forge/dmg-background/preview.mjs b/apps/desktop/electron-forge/dmg-background/preview.mjs
index 82da4cc5c5..ff5f439350 100644
--- a/apps/desktop/electron-forge/dmg-background/preview.mjs
+++ b/apps/desktop/electron-forge/dmg-background/preview.mjs
@@ -33,8 +33,8 @@ const MARGIN = 44; // transparent padding around the window for its drop shadow
// Icon CENTERS in Finder's top-left content coordinates. Same values as the `contents`
// entries in forge.config.ts — these are what a real build writes into .DS_Store.
-const APP = { x: 180, y: 185, label: "Trilium Notes" };
-const APPS = { x: 460, y: 185, label: "Applications" };
+const APP = { x: 180, y: 215, label: "Trilium Notes" };
+const APPS = { x: 460, y: 215, label: "Applications" };
const bgHref = pathToFileURL(path.join(DMG_DIR, "background.png")).href;
const APPLICATIONS_ICNS = "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/ApplicationsFolderIcon.icns";
diff --git a/apps/desktop/electron-forge/dmg-background/preview.png b/apps/desktop/electron-forge/dmg-background/preview.png
index 3a9b728fb2..f73fec4b74 100644
Binary files a/apps/desktop/electron-forge/dmg-background/preview.png and b/apps/desktop/electron-forge/dmg-background/preview.png differ
diff --git a/apps/desktop/electron-forge/forge.config.ts b/apps/desktop/electron-forge/forge.config.ts
index c13741b31f..9b2244d9a6 100644
--- a/apps/desktop/electron-forge/forge.config.ts
+++ b/apps/desktop/electron-forge/forge.config.ts
@@ -160,12 +160,12 @@ const config: ForgeConfig = {
additionalDMGOptions: {
window: { size: { width: 640, height: 400 } }
},
- // Icon CENTERS in a bottom-left coordinate space, matched to the platforms in
- // background.html. These need a macOS test-build to fine-tune: the DMG can only
- // be built and visually verified there (appdmg is darwin-only).
+ // Icon CENTERS in Finder's .DS_Store Iloc coordinate space: top-left origin,
+ // y increasing downward. y=215 matches the platform centers in background.html
+ // (top:140 + height:150/2). Verify on a macOS build (appdmg is darwin-only).
contents: (opts: { appPath: string }) => [
- { x: 180, y: 185, type: "file", path: opts.appPath },
- { x: 460, y: 185, type: "link", path: "/Applications" }
+ { x: 180, y: 215, type: "file", path: opts.appPath },
+ { x: 460, y: 215, type: "link", path: "/Applications" }
]
}
},