mirror of
https://fastgit.cc/https://github.com/anomalyco/opencode
synced 2026-04-21 05:10:58 +08:00
fix(desktop-electron): match dev dock icon inset on macOS (#19429)
This commit is contained in:
@@ -9,3 +9,6 @@ Here's the process I've been using to create icons:
|
||||
|
||||
The Image2Icon step is necessary as the `icon.icns` generated by `app-icon.png` does not apply the shadow/padding expected by macOS,
|
||||
so app icons appear larger than expected.
|
||||
|
||||
For unpackaged Electron on macOS, `app.dock.setIcon()` should use a PNG. Keep `dock.png` in each channel folder synced with the
|
||||
extracted `icon_128x128@2x.png` from that channel's `icon.icns` so the dev Dock icon matches the packaged app inset.
|
||||
|
||||
BIN
packages/desktop-electron/icons/beta/dock.png
Normal file
BIN
packages/desktop-electron/icons/beta/dock.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
BIN
packages/desktop-electron/icons/dev/dock.png
Normal file
BIN
packages/desktop-electron/icons/dev/dock.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
BIN
packages/desktop-electron/icons/prod/dock.png
Normal file
BIN
packages/desktop-electron/icons/prod/dock.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
@@ -50,7 +50,8 @@ export function setTitlebar(win: BrowserWindow, theme: Partial<TitlebarTheme> =
|
||||
|
||||
export function setDockIcon() {
|
||||
if (process.platform !== "darwin") return
|
||||
app.dock?.setIcon(nativeImage.createFromPath(join(iconsDir(), "128x128@2x.png")))
|
||||
const icon = nativeImage.createFromPath(join(iconsDir(), "dock.png"))
|
||||
if (!icon.isEmpty()) app.dock?.setIcon(icon)
|
||||
}
|
||||
|
||||
export function createMainWindow(globals: Globals) {
|
||||
|
||||
Reference in New Issue
Block a user