This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues/pull-requests.
appcat
/
sonist
Archived
1
0
Fork 0
master
宇天 2020-12-13 21:28:00 +08:00
parent 82cc79a46f
commit 539a942906
3 changed files with 12 additions and 7 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "top.yutent.sonist", "name": "top.yutent.sonist",
"version": "2.0.0-alpha-2", "version": "2.0.0-alpha-3",
"description": "Music Player", "description": "Music Player",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -21,7 +21,7 @@ function create(ico = nativeImage.createEmpty()) {
return tray return tray
} }
exports.ctrlTrayBtn = function(win) { exports.ctrlTrayBtn = function (win) {
var next = create(ICON_DICT.next) var next = create(ICON_DICT.next)
var play = create(ICON_DICT.pause) var play = create(ICON_DICT.pause)
var prev = create(ICON_DICT.prev) var prev = create(ICON_DICT.prev)
@ -42,11 +42,14 @@ exports.ctrlTrayBtn = function(win) {
next.on('click', _ => { next.on('click', _ => {
win.webContents.send('app', { type: 'tray-next', data: { isPlaying } }) 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 } return { prev, play, next }
} }
exports.createAppTray = function(win) { exports.createAppTray = function (win) {
var tray = create(ICON_DICT.app) var tray = create(ICON_DICT.app)
var menuList = Menu.buildFromTemplate([ var menuList = Menu.buildFromTemplate([
{ {
@ -65,12 +68,14 @@ exports.createAppTray = function(win) {
tray.popUpContextMenu(menuList) tray.popUpContextMenu(menuList)
}) })
win.__tray__ = tray
return tray return tray
} }
exports.createLrcTray = function(win) { exports.createLrcTray = function (win) {
var tray = create() var tray = create()
tray.setTitle('这是顶栏歌词, blablablabla...') tray.setTitle('这是顶栏歌词, blablablabla...')
win.__lrc__ = tray
return tray return tray
} }

View File

@ -12,7 +12,7 @@ const createMenu = require('./menu.js')
/** /**
* 应用主窗口 * 应用主窗口
*/ */
exports.createMainWindow = function(icon) { exports.createMainWindow = function (icon) {
// 创建浏览器窗口 // 创建浏览器窗口
let win = new BrowserWindow({ let win = new BrowserWindow({
title: 'sonist', title: 'sonist',
@ -61,7 +61,7 @@ exports.createMainWindow = function(icon) {
/** /**
* 应用迷你窗口 * 应用迷你窗口
*/ */
exports.createMiniWindow = function(screen) { exports.createMiniWindow = function (screen) {
let win = new BrowserWindow({ let win = new BrowserWindow({
title: '', title: '',
width: 320, width: 320,