mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-20 02:31:23 +00:00
fix two tray on windows
This commit is contained in:
8
main.js
8
main.js
@@ -232,6 +232,10 @@ function openIt() {
|
||||
ipc.on('openUrl', function(event, arg) {
|
||||
console.log('openUrl', arg);
|
||||
|
||||
// if (appIcon) {
|
||||
// appIcon.destroy()
|
||||
// }
|
||||
|
||||
arg.webPreferences = arg.webPreferences === undefined ? {} : arg.webPreferences;
|
||||
arg.webPreferences.nodeIntegration = true;
|
||||
arg.webPreferences.contextIsolation = false;
|
||||
@@ -268,6 +272,8 @@ function openIt() {
|
||||
}
|
||||
}
|
||||
|
||||
// tray只要实例化一次
|
||||
// tray在windows下可能会有两个, 原因不明, 当注销后再启动
|
||||
var trayShowed = false;
|
||||
ipc.on('show-tray', function(event, arg) {
|
||||
if (trayShowed) {
|
||||
@@ -279,6 +285,8 @@ function openIt() {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('show tray')
|
||||
|
||||
appIcon = new Tray(__dirname + '/public/images/tray/' + ( process.platform == 'darwin' ? 'trayTemplate.png' : 'tray.png'))
|
||||
var contextMenu = Menu.buildFromTemplate([
|
||||
{
|
||||
|
@@ -1409,6 +1409,9 @@ function showLocalAccountWarning() {
|
||||
function initPage(initedCallback) {
|
||||
console.log('init page');
|
||||
|
||||
// 不要显示顶部菜单
|
||||
gui.Menu.setApplicationMenu(null)
|
||||
|
||||
// 笔记本, 事件, menu初始化
|
||||
Notebook.init();
|
||||
// 笔记
|
||||
|
@@ -1579,7 +1579,7 @@ function isMac() {
|
||||
function getMainWinParams() {
|
||||
if(isMac()) {
|
||||
return {
|
||||
"icon": "/public/images/logo/leanote.png",
|
||||
// "icon": "/public/images/logo/leanote.png",
|
||||
frame: false,
|
||||
transparent: false,
|
||||
width: 258,
|
||||
@@ -1589,7 +1589,7 @@ function getMainWinParams() {
|
||||
};
|
||||
}
|
||||
return {
|
||||
"icon": "/public/images/logo/leanote.png",
|
||||
// "icon": "/public/images/logo/leanote.png",
|
||||
frame: true,
|
||||
transparent: false,
|
||||
width: 1100,
|
||||
|
Reference in New Issue
Block a user