mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-08 05:57:02 +09:00
merge
This commit is contained in:
commit
432d6f794f
9 changed files with 40 additions and 33 deletions
29
electron.js
29
electron.js
|
@ -146,7 +146,6 @@ function initTray () {
|
|||
tray = new Tray (trayIcon());
|
||||
|
||||
tray.setToolTip('Anytype');
|
||||
tray.on('click', () => { win.show(); });
|
||||
|
||||
tray.setContextMenu(Menu.buildFromTemplate([
|
||||
{ label: 'Open Anytype', click: () => { win.show(); } },
|
||||
|
@ -402,30 +401,28 @@ function createWindow () {
|
|||
menuInit();
|
||||
};
|
||||
|
||||
function getBgColor () {
|
||||
function getTheme () {
|
||||
let { theme } = config;
|
||||
let light = '#fff';
|
||||
let dark = '#2c2b27';
|
||||
let bg = '';
|
||||
|
||||
switch (theme) {
|
||||
default:
|
||||
bg = light;
|
||||
break;
|
||||
|
||||
case 'dark':
|
||||
bg = dark;
|
||||
break;
|
||||
return theme;
|
||||
|
||||
case 'system':
|
||||
bg = isDarkTheme() ? dark : light;
|
||||
break;
|
||||
return isDarkTheme() ? 'dark' : '';
|
||||
};
|
||||
return bg;
|
||||
};
|
||||
|
||||
function getBgColor () {
|
||||
let theme = getTheme();
|
||||
let bg = {
|
||||
'': '#fff',
|
||||
dark: '#2c2b27',
|
||||
};
|
||||
return bg[theme];
|
||||
};
|
||||
|
||||
function openAboutWindow () {
|
||||
let { theme } = config;
|
||||
let window = new BrowserWindow({
|
||||
backgroundColor: getBgColor(),
|
||||
width: 400,
|
||||
|
@ -439,7 +436,7 @@ function openAboutWindow () {
|
|||
},
|
||||
});
|
||||
|
||||
window.loadURL('file://' + path.join(__dirname, 'electron', `about.html?version=${version}&theme=${theme}`));
|
||||
window.loadURL('file://' + path.join(__dirname, 'electron', `about.html?version=${version}&theme=${getTheme()}`));
|
||||
|
||||
window.once('closed', () => {
|
||||
window = null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue