Skip to content

Commit cc72689

Browse files
authored
Fix cross-platform icon compatibility (#19)
- Add cross-platform icon handling for Linux/macOS support - Convert Windows .ico to .png for non-Windows platforms - Update tray and thumbar icons to use platform-appropriate format Fixes application crashes on Linux due to unsupported .ico format Authored-by: BP602 <BP602@pontet.eu>
1 parent b4f8d7f commit cc72689

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

resources/icons/KickTalk_v1.png

5.34 KB
Loading

src/main/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import dotenv from "dotenv";
99
dotenv.config();
1010

1111
const isDev = process.env.NODE_ENV === "development";
12-
const iconPath = join(__dirname, "../../resources/icons/win/KickTalk_v1.ico");
12+
const iconPath = process.platform === "win32"
13+
? join(__dirname, "../../resources/icons/win/KickTalk_v1.ico")
14+
: join(__dirname, "../../resources/icons/KickTalk_v1.png");
1315

1416
const authStore = new Store({
1517
fileExtension: "env",
@@ -451,7 +453,7 @@ const createWindow = () => {
451453

452454
mainWindow.setThumbarButtons([
453455
{
454-
icon: join(__dirname, "../../resources/icons/win/KickTalk_v1.ico"),
456+
icon: iconPath,
455457
click: () => {
456458
mainWindow.show();
457459
},
@@ -653,7 +655,7 @@ const setupLocalShortcuts = () => {
653655
// initialization and is ready to create browser windows.
654656
// Some APIs can only be used after this event occurs.
655657
app.whenReady().then(() => {
656-
tray = new Tray(join(__dirname, "../../resources/icons/win/KickTalk_v1.ico"));
658+
tray = new Tray(iconPath);
657659
tray.setToolTip("KickTalk");
658660

659661
// Set the icon for the app

0 commit comments

Comments
 (0)