-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set Comfy icons for app and system tray. Developed System Tray Behavior. App no longer quits if window is closed as the python server will continue to run in the background. Clicking the system tray you can bring comfy back up, quit or hide
- Loading branch information
Showing
12 changed files
with
106 additions
and
11 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "comfyui-electron", | ||
"productName": "ComfyUI", | ||
"version": "0.0.3", | ||
"version": "0.0.5", | ||
"description": "The best modular GUI to run AI diffusion models.", | ||
"main": ".vite/build/main.js", | ||
"packageManager": "[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Tray, Menu, BrowserWindow, app } from "electron"; | ||
import path from 'path'; | ||
|
||
export function SetupTray(mainView: BrowserWindow): Tray { | ||
|
||
// Set icon for the tray | ||
// I think there is a way to packaged the icon in so you don't need to reference resourcesPath | ||
const trayImage = path.join(process.resourcesPath, 'UI', process.platform === 'darwin' ? 'Comfy_Logo_x16_BW.png' : 'Comfy_Logo_x32.png'); | ||
let tray = new Tray(trayImage); | ||
|
||
tray.setTitle('ComfyUI'); // Only Macos, can be blank to JUST show icon | ||
tray.setToolTip('ComfyUI - Server is running'); | ||
|
||
// For Mac you can have a separate icon when you press. | ||
// The current design language for Mac Eco System is White or Black icon then when you click it is in color | ||
if (process.platform === "darwin") | ||
{ | ||
tray.setPressedImage(path.join(process.resourcesPath, 'UI','Comfy_Logo_x16.png')); | ||
} | ||
|
||
const contextMenu = Menu.buildFromTemplate([ | ||
{ | ||
label: 'Show Comfy Window', | ||
click: function () { | ||
mainView.show(); | ||
// Mac Only | ||
if (process.platform === 'darwin') { | ||
app.dock.show(); | ||
} | ||
}, | ||
}, | ||
{ | ||
label: 'Quit Comfy', | ||
click() { | ||
app.quit(); | ||
}, | ||
}, | ||
{ | ||
label: 'Hide', | ||
click() { | ||
|
||
mainView.hide(); | ||
// Mac Only | ||
if (process.platform === 'darwin') { | ||
app.dock.hide(); | ||
} | ||
} | ||
}]); | ||
|
||
tray.setContextMenu(contextMenu); | ||
|
||
// If we want to make it more dynamic return tray so we can access it later | ||
return tray; | ||
} |