mirror of
https://gitlab.com/ryzen-controller-team/ryzen-controller.git
synced 2024-12-22 18:13:28 +07:00
Added icon management for linux.
This commit is contained in:
parent
cb98987073
commit
6a459ba060
BIN
assets/icon.png
Normal file
BIN
assets/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
12
main.js
12
main.js
@ -29,13 +29,21 @@ let mainWindow
|
|||||||
let tray
|
let tray
|
||||||
|
|
||||||
function createWindow () {
|
function createWindow () {
|
||||||
|
let appIcon = '';
|
||||||
|
if (require('os').platform() === 'win32') {
|
||||||
|
appIcon = __dirname + '/assets/icon.ico';
|
||||||
|
} else {
|
||||||
|
appIcon = __dirname + '/assets/icon.png';
|
||||||
|
}
|
||||||
|
|
||||||
// Create the browser window.
|
// Create the browser window.
|
||||||
mainWindow = new BrowserWindow({
|
mainWindow = new BrowserWindow({
|
||||||
width: 800,
|
width: 800,
|
||||||
height: 720,
|
height: 720,
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
nodeIntegration: true
|
nodeIntegration: true
|
||||||
}
|
},
|
||||||
|
icon: appIcon
|
||||||
})
|
})
|
||||||
|
|
||||||
mainWindow.setOpacity(0.95);
|
mainWindow.setOpacity(0.95);
|
||||||
@ -77,7 +85,7 @@ function createWindow () {
|
|||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
tray = new Tray(__dirname + '/assets/icon.ico');
|
tray = new Tray(appIcon);
|
||||||
tray.setContextMenu(contextMenu);
|
tray.setContextMenu(contextMenu);
|
||||||
tray.setIgnoreDoubleClickEvents(true);
|
tray.setIgnoreDoubleClickEvents(true);
|
||||||
tray.on('click', function() {
|
tray.on('click', function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user