Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions desktop/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ const createMainWindow = () => {
minHeight: 450,
maximizable: false,
fullscreenable: false,
frame: false,
titleBarStyle: 'hidden-inset',
// Only go frameless on macOS
frame: process.platform !== 'darwin',
titleBarStyle: 'hidden-inset', // darwin only
autoHideMenuBar: true,
backgroundColor: '#000000',
});
Expand Down Expand Up @@ -93,6 +94,10 @@ app.on('ready', () => {
const page = mainWindow.webContents;

ipcMain.on('settingsUpdated', (_event, settings) => {
// app.dock is macOS only
if ((process.platform !== 'darwin') || (app.dock === undefined)) {
return;
}
if (settings.dockItemVisible) {
if (!app.dock.isVisible()) {
app.dock.show();
Expand Down
17 changes: 17 additions & 0 deletions desktop/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,23 @@ const createMenu = (app, mainWindow) => {
role: 'front',
},
];
} else {
// linux/windows
template.unshift({
label: 'File',
submenu: [
{
label: 'Preferences…',
accelerator: 'CmdOrCtrl+,',
click() {
mainWindow.webContents.send('showSettings');
},
},
{ type: 'separator' },
{ role: 'close' },
{ role: 'quit' },
],
});
}

const menu = Menu.buildFromTemplate(template);
Expand Down
15 changes: 13 additions & 2 deletions desktop/tray.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';
import electron from 'electron';
import { ipcMain } from 'electron';

import { ipcRenderer } from 'electron';
import config from './config';

const app = electron.app;
Expand All @@ -12,8 +12,15 @@ const newTray = win => {

const contextMenu = electron.Menu.buildFromTemplate([
{
role: 'quit',
label: 'Preferences…',
accelerator: 'CmdOrCtrl+,',
click() {
win.webContents.send('showSettings');
win.show();
},
},
{ type: 'separator' },
{ role: 'quit' },
]);

tray = new electron.Tray(
Expand All @@ -23,6 +30,7 @@ const newTray = win => {
// https://github.com/electron/electron/issues/1825
tray.setHighlightMode(false);
tray.setToolTip(`${app.getName()}`);
tray.setContextMenu(contextMenu);
tray.on('click', e => {
// Not sure why right click event doesn't work for me so doing manually
if (e.ctrlKey) {
Expand All @@ -31,6 +39,7 @@ const newTray = win => {
toggleWin();
}
});
// macOS Windows
tray.on('right-click', () => tray.popUpContextMenu(contextMenu));
tray.on('double-click', () => toggleWin());
return tray;
Expand All @@ -43,8 +52,10 @@ const create = (app, mainWindow) => {
if (tray) {
if (config.get('priceSetting')) {
tray.setTitle(change);
tray.setToolTip(`${app.getName()} ` + change);
} else {
tray.setTitle('');
tray.setToolTip(`${app.getName()}`);
}
}
});
Expand Down
22 changes: 18 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,21 @@
},
"build": {
"appId": "com.jorilallo.lionshare",
"icon": "src/assets/icons/appicon.icns",
"icon": "src/assets/icons/icon.icns",
"files": "!dist/*",
"mac": {
"target": "zip"
},
"linux": {
"target": "snap"
},
"snap": {
"plugs": [
"default"
],
"after": [
"desktop-gtk2"
]
}
},
"author": "Jori Lallo <jori@coinbase.com>, Ben Jennings <ben@coinbase.com>, Maksim Stepanenko <maksim@coinbase.com>",
Expand All @@ -45,7 +56,9 @@
"babel-preset-stage-0": "^6.5.0",
"chart.js": "^2.4",
"classnames": "^2.2.5",
"electron": "^1.4.15",
"electron-config": "^0.2.1",
"electron-is-dev": "^0.1.2",
"electron-machine-id": "^1.0.9",
"lodash": "^4.17.2",
"mobx": "^2.2.2",
"mobx-react": "^4.0.3",
Expand All @@ -63,7 +76,8 @@
"cross-env": "^1.0.7",
"css-loader": "^0.23.1",
"dotenv": "^2.0.0",
"electron-builder": "^12.3.1",
"electron": "^1.4.15",
"electron-builder": "^19.50.0",
"electron-config": "^0.2.1",
"electron-is-dev": "^0.1.2",
"electron-machine-id": "^1.0.9",
Expand All @@ -83,7 +97,7 @@
"node-sass": "^3.4.2",
"node-static": "^0.7.7",
"pre-commit": "^1.2.2",
"prettier": "git+ssh://git@github.com/prettier/prettier.git",
"prettier": "https://github.com/prettier/prettier.git",
"rebass": "^0.2.6",
"resolve-url": "^0.2.1",
"resolve-url-loader": "^1.4.3",
Expand Down
Binary file added src/assets/icons/icon.icns
Binary file not shown.