update
parent
82cc79a46f
commit
539a942906
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "top.yutent.sonist",
|
||||
"version": "2.0.0-alpha-2",
|
||||
"version": "2.0.0-alpha-3",
|
||||
"description": "Music Player",
|
||||
"main": "src/main.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -21,7 +21,7 @@ function create(ico = nativeImage.createEmpty()) {
|
|||
return tray
|
||||
}
|
||||
|
||||
exports.ctrlTrayBtn = function(win) {
|
||||
exports.ctrlTrayBtn = function (win) {
|
||||
var next = create(ICON_DICT.next)
|
||||
var play = create(ICON_DICT.pause)
|
||||
var prev = create(ICON_DICT.prev)
|
||||
|
@ -42,11 +42,14 @@ exports.ctrlTrayBtn = function(win) {
|
|||
next.on('click', _ => {
|
||||
win.webContents.send('app', { type: 'tray-next', data: { isPlaying } })
|
||||
})
|
||||
console.log('ready', prev, play, next)
|
||||
|
||||
win.__prev__ = prev
|
||||
win.__play__ = play
|
||||
win.__next__ = next
|
||||
return { prev, play, next }
|
||||
}
|
||||
|
||||
exports.createAppTray = function(win) {
|
||||
exports.createAppTray = function (win) {
|
||||
var tray = create(ICON_DICT.app)
|
||||
var menuList = Menu.buildFromTemplate([
|
||||
{
|
||||
|
@ -65,12 +68,14 @@ exports.createAppTray = function(win) {
|
|||
tray.popUpContextMenu(menuList)
|
||||
})
|
||||
|
||||
win.__tray__ = tray
|
||||
return tray
|
||||
}
|
||||
|
||||
exports.createLrcTray = function(win) {
|
||||
exports.createLrcTray = function (win) {
|
||||
var tray = create()
|
||||
tray.setTitle('这是顶栏歌词, blablablabla...')
|
||||
|
||||
win.__lrc__ = tray
|
||||
return tray
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ const createMenu = require('./menu.js')
|
|||
/**
|
||||
* 应用主窗口
|
||||
*/
|
||||
exports.createMainWindow = function(icon) {
|
||||
exports.createMainWindow = function (icon) {
|
||||
// 创建浏览器窗口
|
||||
let win = new BrowserWindow({
|
||||
title: 'sonist',
|
||||
|
@ -61,7 +61,7 @@ exports.createMainWindow = function(icon) {
|
|||
/**
|
||||
* 应用迷你窗口
|
||||
*/
|
||||
exports.createMiniWindow = function(screen) {
|
||||
exports.createMiniWindow = function (screen) {
|
||||
let win = new BrowserWindow({
|
||||
title: '',
|
||||
width: 320,
|
||||
|
|
Reference in New Issue