10
main/tray.js
10
main/tray.js
@@ -4,11 +4,11 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var cp = require('child_process')
|
var cp = require('child_process')
|
||||||
var path = require('path')
|
|
||||||
var electron = require('electron')
|
var electron = require('electron')
|
||||||
|
|
||||||
var app = electron.app
|
var app = electron.app
|
||||||
|
|
||||||
|
var config = require('../config')
|
||||||
var windows = require('./windows')
|
var windows = require('./windows')
|
||||||
|
|
||||||
var trayIcon
|
var trayIcon
|
||||||
@@ -33,7 +33,7 @@ function hasTray () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createTrayIcon () {
|
function createTrayIcon () {
|
||||||
trayIcon = new electron.Tray(path.join(__dirname, '..', 'static', 'WebTorrentSmall.png'))
|
trayIcon = new electron.Tray(getIconPath())
|
||||||
|
|
||||||
// On Windows, left click to open the app, right click for context menu
|
// On Windows, left click to open the app, right click for context menu
|
||||||
// On Linux, any click (right or left) opens the context menu
|
// On Linux, any click (right or left) opens the context menu
|
||||||
@@ -79,3 +79,9 @@ function hideApp () {
|
|||||||
windows.main.hide()
|
windows.main.hide()
|
||||||
windows.main.send('dispatch', 'backToList')
|
windows.main.send('dispatch', 'backToList')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getIconPath () {
|
||||||
|
return process.platform === 'win32'
|
||||||
|
? config.APP_ICON + '.ico'
|
||||||
|
: config.APP_ICON + '.png'
|
||||||
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ function createAboutWindow () {
|
|||||||
show: false,
|
show: false,
|
||||||
center: true,
|
center: true,
|
||||||
resizable: false,
|
resizable: false,
|
||||||
icon: config.APP_ICON + '.png',
|
icon: getIconPath(),
|
||||||
title: process.platform !== 'darwin'
|
title: process.platform !== 'darwin'
|
||||||
? 'About ' + config.APP_WINDOW_TITLE
|
? 'About ' + config.APP_WINDOW_TITLE
|
||||||
: '',
|
: '',
|
||||||
@@ -91,7 +91,7 @@ function createMainWindow () {
|
|||||||
var win = windows.main = new electron.BrowserWindow({
|
var win = windows.main = new electron.BrowserWindow({
|
||||||
backgroundColor: '#1E1E1E',
|
backgroundColor: '#1E1E1E',
|
||||||
darkTheme: true, // Forces dark theme (GTK+3)
|
darkTheme: true, // Forces dark theme (GTK+3)
|
||||||
icon: config.APP_ICON + 'Smaller.png', // Window and Volume Mixer icon.
|
icon: getIconPath(), // Window icon (Windows, Linux)
|
||||||
minWidth: config.WINDOW_MIN_WIDTH,
|
minWidth: config.WINDOW_MIN_WIDTH,
|
||||||
minHeight: config.WINDOW_MIN_HEIGHT,
|
minHeight: config.WINDOW_MIN_HEIGHT,
|
||||||
show: false, // Hide window until renderer sends 'ipcReady' event
|
show: false, // Hide window until renderer sends 'ipcReady' event
|
||||||
@@ -137,3 +137,9 @@ function focusWindow (win) {
|
|||||||
}
|
}
|
||||||
win.show() // shows and gives focus
|
win.show() // shows and gives focus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getIconPath () {
|
||||||
|
return process.platform === 'win32'
|
||||||
|
? config.APP_ICON + '.ico'
|
||||||
|
: config.APP_ICON + '.png'
|
||||||
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
"deep-equal": "^1.0.1",
|
"deep-equal": "^1.0.1",
|
||||||
"dlnacasts": "^0.1.0",
|
"dlnacasts": "^0.1.0",
|
||||||
"drag-drop": "^2.11.0",
|
"drag-drop": "^2.11.0",
|
||||||
"electron-prebuilt": "1.1.1",
|
"electron-prebuilt": "1.2.0",
|
||||||
"fs-extra": "^0.27.0",
|
"fs-extra": "^0.27.0",
|
||||||
"hyperx": "^2.0.2",
|
"hyperx": "^2.0.2",
|
||||||
"iso-639-1": "^1.2.1",
|
"iso-639-1": "^1.2.1",
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
Reference in New Issue
Block a user