Add experimental Discord AC theme

This commit is contained in:
smartfrigde 2022-04-20 21:50:23 +02:00
parent c5368da0ca
commit 495a813af1
2 changed files with 59 additions and 34 deletions

View file

@ -23,6 +23,9 @@ app.whenReady().then(async () => {
case "native": case "native":
createNativeWindow(); createNativeWindow();
break; break;
case "discord":
createNativeWindow();
break;
case "glasstron": case "glasstron":
dialog.showErrorBox( dialog.showErrorBox(
"Glasstron is unsupported.", "Glasstron is unsupported.",

View file

@ -1,9 +1,30 @@
import {app, Menu, Tray} from "electron"; import { app, Menu, Tray } from "electron";
import {mainWindow} from "./window"; import { mainWindow } from "./window";
import { getConfig } from "./utils";
import * as path from "path"; import * as path from "path";
import {createSettingsWindow} from "./settings/main"; import { createSettingsWindow } from "./settings/main";
let tray = null; let tray: any = null;
app.whenReady().then(() => { app.whenReady().then(async () => {
if (await getConfig("windowStyle") == "discord") {
tray = new Tray(path.join(__dirname, "../", "/assets/ac_plug.png"));
const contextMenu = Menu.buildFromTemplate([
{
label: "Open ArmCord",
click: function () {
mainWindow.show();
}
},
{
label: "Quit ArmCord",
click: function () {
app.quit();
}
}
]);
tray.setToolTip("Discord");
tray.setContextMenu(contextMenu);
} else {
tray = new Tray(path.join(__dirname, "../", "/assets/ac_plug.png")); tray = new Tray(path.join(__dirname, "../", "/assets/ac_plug.png"));
const contextMenu = Menu.buildFromTemplate([ const contextMenu = Menu.buildFromTemplate([
{ {
@ -35,4 +56,5 @@ app.whenReady().then(() => {
tray.setToolTip("ArmCord " + app.getVersion()); tray.setToolTip("ArmCord " + app.getVersion());
tray.setContextMenu(contextMenu); tray.setContextMenu(contextMenu);
}
}); });