mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Add experimental Discord AC theme
This commit is contained in:
parent
c5368da0ca
commit
495a813af1
2 changed files with 59 additions and 34 deletions
|
@ -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.",
|
||||||
|
|
90
src/tray.ts
90
src/tray.ts
|
@ -1,38 +1,60 @@
|
||||||
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 () => {
|
||||||
tray = new Tray(path.join(__dirname, "../", "/assets/ac_plug.png"));
|
if (await getConfig("windowStyle") == "discord") {
|
||||||
const contextMenu = Menu.buildFromTemplate([
|
tray = new Tray(path.join(__dirname, "../", "/assets/ac_plug.png"));
|
||||||
{
|
const contextMenu = Menu.buildFromTemplate([
|
||||||
label: "Open ArmCord",
|
{
|
||||||
click: function () {
|
label: "Open ArmCord",
|
||||||
mainWindow.show();
|
click: function () {
|
||||||
|
mainWindow.show();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Quit ArmCord",
|
||||||
|
click: function () {
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
]);
|
||||||
{
|
|
||||||
label: "Open Settings",
|
|
||||||
click: function () {
|
|
||||||
createSettingsWindow();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Support Discord Server",
|
|
||||||
click: function () {
|
|
||||||
mainWindow.show();
|
|
||||||
mainWindow.loadURL("https://discord.gg/TnhxcqynZ2");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "Quit ArmCord",
|
|
||||||
click: function () {
|
|
||||||
app.quit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
tray.setToolTip("ArmCord " + app.getVersion());
|
tray.setToolTip("Discord");
|
||||||
tray.setContextMenu(contextMenu);
|
tray.setContextMenu(contextMenu);
|
||||||
|
} else {
|
||||||
|
tray = new Tray(path.join(__dirname, "../", "/assets/ac_plug.png"));
|
||||||
|
const contextMenu = Menu.buildFromTemplate([
|
||||||
|
{
|
||||||
|
label: "Open ArmCord",
|
||||||
|
click: function () {
|
||||||
|
mainWindow.show();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Open Settings",
|
||||||
|
click: function () {
|
||||||
|
createSettingsWindow();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Support Discord Server",
|
||||||
|
click: function () {
|
||||||
|
mainWindow.show();
|
||||||
|
mainWindow.loadURL("https://discord.gg/TnhxcqynZ2");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Quit ArmCord",
|
||||||
|
click: function () {
|
||||||
|
app.quit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
tray.setToolTip("ArmCord " + app.getVersion());
|
||||||
|
tray.setContextMenu(contextMenu);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue