diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5d60834..4debfb7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Deprecated
- /
+## [1.7.0] - 2018-01-11
+### Added
+- New Tray icons
+### Changed
+- Removed the splash screen
+- Removed the about screen
+### Removed
+- Old individual tray icons for playing & paused
## [1.6.1] - 2018-09-09
### Added
diff --git a/about.html b/about.html
deleted file mode 100644
index 3dc6938..0000000
--- a/about.html
+++ /dev/null
@@ -1,52 +0,0 @@
-
-
-
-
-
vx.x.x
-
By Simon Fraser
- (https://simonf.co.uk)
- (https://github.com/simon-fraser/MusicTube-Player)
-
-
YouTube, YouTube Music and all logos are trademarks of YouTube, LLC.
-
-
-
diff --git a/assets/icons/menu-standard-dark-paused.png b/assets/icons/menu-standard-dark-paused.png
deleted file mode 100755
index 6740367..0000000
Binary files a/assets/icons/menu-standard-dark-paused.png and /dev/null differ
diff --git a/assets/icons/menu-standard-dark-paused@2x.png b/assets/icons/menu-standard-dark-paused@2x.png
deleted file mode 100755
index a03c2e1..0000000
Binary files a/assets/icons/menu-standard-dark-paused@2x.png and /dev/null differ
diff --git a/assets/icons/menu-standard-dark-playing.png b/assets/icons/menu-standard-dark-playing.png
deleted file mode 100755
index 3d1b24c..0000000
Binary files a/assets/icons/menu-standard-dark-playing.png and /dev/null differ
diff --git a/assets/icons/menu-standard-dark-playing@2x.png b/assets/icons/menu-standard-dark-playing@2x.png
deleted file mode 100755
index 26df7da..0000000
Binary files a/assets/icons/menu-standard-dark-playing@2x.png and /dev/null differ
diff --git a/assets/icons/menu-standard-dark.png b/assets/icons/menu-standard-dark.png
index 0e18479..82ef827 100755
Binary files a/assets/icons/menu-standard-dark.png and b/assets/icons/menu-standard-dark.png differ
diff --git a/assets/icons/menu-standard-dark@2x.png b/assets/icons/menu-standard-dark@2x.png
index 01b02dd..c524672 100755
Binary files a/assets/icons/menu-standard-dark@2x.png and b/assets/icons/menu-standard-dark@2x.png differ
diff --git a/assets/icons/menu-standard-light-paused.png b/assets/icons/menu-standard-light-paused.png
deleted file mode 100755
index ef09f0c..0000000
Binary files a/assets/icons/menu-standard-light-paused.png and /dev/null differ
diff --git a/assets/icons/menu-standard-light-paused@2x.png b/assets/icons/menu-standard-light-paused@2x.png
deleted file mode 100755
index 197cf57..0000000
Binary files a/assets/icons/menu-standard-light-paused@2x.png and /dev/null differ
diff --git a/assets/icons/menu-standard-light-playing.png b/assets/icons/menu-standard-light-playing.png
deleted file mode 100755
index 2e57369..0000000
Binary files a/assets/icons/menu-standard-light-playing.png and /dev/null differ
diff --git a/assets/icons/menu-standard-light-playing@2x.png b/assets/icons/menu-standard-light-playing@2x.png
deleted file mode 100755
index 0af3c54..0000000
Binary files a/assets/icons/menu-standard-light-playing@2x.png and /dev/null differ
diff --git a/assets/icons/menu-standard-light.png b/assets/icons/menu-standard-light.png
index ce84ad9..38317a6 100755
Binary files a/assets/icons/menu-standard-light.png and b/assets/icons/menu-standard-light.png differ
diff --git a/assets/icons/menu-standard-light@2x.png b/assets/icons/menu-standard-light@2x.png
index 412bf3d..d3b5dfe 100755
Binary files a/assets/icons/menu-standard-light@2x.png and b/assets/icons/menu-standard-light@2x.png differ
diff --git a/index.js b/index.js
index 6462df7..adc6768 100644
--- a/index.js
+++ b/index.js
@@ -1,16 +1,13 @@
-const { app, BrowserWindow, globalShortcut, ipcMain, Menu, Tray } = require('electron')
+const { app, BrowserWindow, globalShortcut, ipcMain, systemPreferences, Tray } = require('electron')
const notifier = require('node-notifier')
const path = require('path')
const windowStateKeeper = require('electron-window-state')
-
require('electron-debug')({ enabled: false })
// variables
let winWidth = 440
let winHeight = 620
-let loadingScreen
let mainWindow
-let aboutScreen
let tray
let trayTheme
let status
@@ -23,32 +20,6 @@ let windowParams = {
const isMac = process.platform === 'darwin'
const isWindows = process.platform === 'win32'
-function createAboutWindow () {
- aboutScreen = new BrowserWindow({
- backgroundColor: '#131313',
- frame: true,
- icon: path.join(__dirname, 'assets/musictube.ico'),
- title: 'About MusicTube Player',
- height: 400,
- width: 320
- })
- aboutScreen.loadURL(`file://${__dirname}/about.html`)
-}
-
-function createLoadingWindow () {
- loadingScreen = new BrowserWindow(Object.assign(windowParams, {
- frame: false,
- parent: mainWindow,
- width: winWidth,
- height: winWidth
- }))
- loadingScreen.loadURL(`file://${__dirname}/loading.html`)
- loadingScreen.on('closed', () => { loadingScreen = null })
- loadingScreen.webContents.on('did-finish-load', () => {
- loadingScreen.show()
- })
-}
-
function createWindow () {
let mainWindowState = windowStateKeeper({
defaultWidth: winWidth,
@@ -57,19 +28,11 @@ function createWindow () {
mainWindow = new BrowserWindow(Object.assign(windowParams, {
frame: true,
height: mainWindowState.height,
- show: false,
width: mainWindowState.width,
x: mainWindowState.x,
y: mainWindowState.y
}))
mainWindow.loadURL(`https://music.youtube.com/`)
- mainWindow.hide()
- // Show main window and hide loader
- mainWindow.webContents.on('did-finish-load', () => {
- mainWindowState.manage(mainWindow)
- mainWindow.show()
- if (loadingScreen !== null) loadingScreen.close()
- })
// Close behaviour
mainWindow.on('close', (e) => {
mainWindowState.saveState(mainWindow)
@@ -85,6 +48,7 @@ function createWindow () {
function globalShortcuts () {
// Play,Pause
globalShortcut.register('MediaPlayPause', () => {
+ console.log('play/pause')
mainWindow.webContents.executeJavaScript(`document.querySelector('.play-pause-button').click()`)
})
// Next
@@ -104,35 +68,6 @@ function trayIcon () {
if (mainWindow.isMinimized()) mainWindow.restore()
mainWindow.show()
})
-
- trayContextMenu()
-}
-
-function trayContextMenu () {
- const contextMenu = Menu.buildFromTemplate([
- {
- label: app.getName()
- },
- {
- type: 'separator'
- },
- {
- label: 'About',
- click: () => {
- createAboutWindow()
- }
- },
- {
- label: 'Quit',
- click: () => {
- app.quit()
- }
- }
- ])
- tray.setContextMenu(contextMenu)
- tray.on('right-click', () => {
- tray.popUpContextMenu(contextMenu)
- })
}
function playStatus () {
@@ -151,7 +86,7 @@ function playStatus () {
ipcRenderer.send('player', object)
`)
}
- }, 250)
+ }, 500)
}
function skipOver () {
@@ -163,7 +98,7 @@ function skipOver () {
if (skip) { skip.click() }
`)
}
- }, 250)
+ }, 1000)
// You Still There popup notice
setInterval(() => {
if (mainWindow) {
@@ -172,15 +107,20 @@ function skipOver () {
if (stillThere) { stillThere.click() }
`)
}
- }, 250)
+ }, 1000)
}
// Application ready to run
app.on('ready', () => {
- trayTheme = (isMac) ? 'dark' : 'light'
+ trayTheme = 'light'
+ if (isMac) {
+ trayTheme = 'dark'
+ if (systemPreferences.isDarkMode()) {
+ trayTheme = 'light'
+ }
+ }
app.setName('MusicTube Player')
- createLoadingWindow()
createWindow()
globalShortcuts()
trayIcon()
@@ -216,5 +156,4 @@ ipcMain.on('player', (event, object) => {
}
}
status = JSON.stringify(object)
- tray.setImage(path.join(__dirname, `assets/icons/menu-standard-${trayTheme}-${object.status.toLowerCase()}.png`))
})
diff --git a/loading.html b/loading.html
deleted file mode 100644
index ea25f5e..0000000
--- a/loading.html
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-