feat(brand): apply Fabric app + tray icons
- assets/icon.png (512) -> BrowserWindow icon; build/icon.png (1024) for electron-builder (linux uses it directly, mac/win generated from it); package.json build.files += assets/**, build.icon set. - Tray: replace the placeholder base64 data-URL with the designed no-text tray icon (assets/tray.png 22 + tray@2x.png 44) via nativeImage.createFromPath. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
BIN
assets/icon.png
Normal file
BIN
assets/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 268 KiB |
BIN
assets/tray.png
Normal file
BIN
assets/tray.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 867 B |
BIN
assets/tray@2x.png
Normal file
BIN
assets/tray@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
BIN
build/icon.png
Normal file
BIN
build/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 MiB |
5
main.js
5
main.js
@@ -60,6 +60,7 @@ function createWindow() {
|
|||||||
minWidth: 1024,
|
minWidth: 1024,
|
||||||
minHeight: 700,
|
minHeight: 700,
|
||||||
title: 'Fabric Desktop',
|
title: 'Fabric Desktop',
|
||||||
|
icon: path.join(__dirname, 'assets/icon.png'),
|
||||||
autoHideMenuBar: false,
|
autoHideMenuBar: false,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
contextIsolation: true,
|
contextIsolation: true,
|
||||||
@@ -99,9 +100,7 @@ function createWindow() {
|
|||||||
function createTrayIcon() {
|
function createTrayIcon() {
|
||||||
if (tray) return tray
|
if (tray) return tray
|
||||||
|
|
||||||
const iconDataUrl =
|
const icon = nativeImage.createFromPath(path.join(__dirname, 'assets/tray.png'))
|
||||||
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAfElEQVR4AWNw4PjPwMDA8J+BgYHhP4MDA8N/BgYGhv8MDAwM/2dgYGB4R2JgYGB4w8DAwPCfgYGB4R8DAwPDf4aGhob/BgwMDAz/Z2BgYHhHYmBgYHjDwMDA8J+BgYHhHwMDA8N/hoYGhv8GDAwMDP9nYGBgeEdiYGAAAB7RImfVq6X8AAAAAElFTkSuQmCC'
|
|
||||||
const icon = nativeImage.createFromDataURL(iconDataUrl)
|
|
||||||
|
|
||||||
tray = new Tray(icon)
|
tray = new Tray(icon)
|
||||||
tray.setToolTip('Fabric Desktop')
|
tray.setToolTip('Fabric Desktop')
|
||||||
|
|||||||
@@ -33,9 +33,11 @@
|
|||||||
"main.js",
|
"main.js",
|
||||||
"preload.js",
|
"preload.js",
|
||||||
"offline.html",
|
"offline.html",
|
||||||
"package.json"
|
"package.json",
|
||||||
|
"assets/**"
|
||||||
],
|
],
|
||||||
"asar": true,
|
"asar": true,
|
||||||
|
"icon": "build/icon.png",
|
||||||
"linux": {
|
"linux": {
|
||||||
"target": [
|
"target": [
|
||||||
"AppImage",
|
"AppImage",
|
||||||
|
|||||||
Reference in New Issue
Block a user