mirror of
https://github.com/samuelthomas2774/nxapi.git
synced 2026-04-26 00:13:08 -05:00
Add menu/tray icon
This commit is contained in:
parent
bb606cfa7b
commit
82e9b82e23
|
|
@ -13,6 +13,8 @@
|
||||||
"dist",
|
"dist",
|
||||||
"!dist/app",
|
"!dist/app",
|
||||||
"!dist/bundle",
|
"!dist/bundle",
|
||||||
|
"resources/cli/**/*",
|
||||||
|
"resources/common/**/*",
|
||||||
"bin"
|
"bin"
|
||||||
],
|
],
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|
@ -85,7 +87,9 @@
|
||||||
"dist/app/bundle",
|
"dist/app/bundle",
|
||||||
"dist/bundle",
|
"dist/bundle",
|
||||||
"!dist/app/package",
|
"!dist/app/package",
|
||||||
"!**/node_modules/**/*"
|
"!**/node_modules/**/*",
|
||||||
|
"resources/app/**/*",
|
||||||
|
"resources/common/**/*"
|
||||||
],
|
],
|
||||||
"asar": false,
|
"asar": false,
|
||||||
"extraMetadata": {
|
"extraMetadata": {
|
||||||
|
|
|
||||||
BIN
resources/app/menu-icon.png
Normal file
BIN
resources/app/menu-icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 655 B |
|
|
@ -1,4 +1,5 @@
|
||||||
import { app, dialog, Menu, Tray, nativeImage, MenuItem } from './electron.js';
|
import { app, dialog, Menu, Tray, nativeImage, MenuItem } from './electron.js';
|
||||||
|
import path from 'node:path';
|
||||||
import createDebug from 'debug';
|
import createDebug from 'debug';
|
||||||
import { askAddNsoAccount, askAddPctlAccount } from './na-auth.js';
|
import { askAddNsoAccount, askAddPctlAccount } from './na-auth.js';
|
||||||
import { App } from './index.js';
|
import { App } from './index.js';
|
||||||
|
|
@ -6,20 +7,21 @@ import { WebService } from '../../api/coral-types.js';
|
||||||
import openWebService from './webservices.js';
|
import openWebService from './webservices.js';
|
||||||
import { SavedToken } from '../../common/auth/nso.js';
|
import { SavedToken } from '../../common/auth/nso.js';
|
||||||
import { SavedMoonToken } from '../../common/auth/moon.js';
|
import { SavedMoonToken } from '../../common/auth/moon.js';
|
||||||
import { dev } from '../../util/product.js';
|
import { dev, dir } from '../../util/product.js';
|
||||||
import { EmbeddedPresenceMonitor, EmbeddedProxyPresenceMonitor } from './monitor.js';
|
import { EmbeddedPresenceMonitor, EmbeddedProxyPresenceMonitor } from './monitor.js';
|
||||||
|
|
||||||
const debug = createDebug('app:main:menu');
|
const debug = createDebug('app:main:menu');
|
||||||
|
|
||||||
|
const icon = nativeImage
|
||||||
|
.createFromPath(path.join(dir, 'resources', 'app', 'menu-icon.png'))
|
||||||
|
.resize({height: 16});
|
||||||
|
|
||||||
|
icon.setTemplateImage(true);
|
||||||
|
|
||||||
export default class MenuApp {
|
export default class MenuApp {
|
||||||
tray: Tray;
|
tray = new Tray(icon);
|
||||||
|
|
||||||
constructor(readonly app: App) {
|
constructor(readonly app: App) {
|
||||||
const icon = nativeImage.createEmpty();
|
|
||||||
|
|
||||||
this.tray = new Tray(icon);
|
|
||||||
|
|
||||||
this.tray.setTitle('nxapi');
|
|
||||||
this.tray.setToolTip('nxapi');
|
this.tray.setToolTip('nxapi');
|
||||||
|
|
||||||
app.store.on('update-nintendo-accounts', () => this.updateMenu());
|
app.store.on('update-nintendo-accounts', () => this.updateMenu());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user