mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Add dynamic icon option
This commit is contained in:
parent
7822317d3a
commit
7463856b63
5 changed files with 21 additions and 2 deletions
|
@ -123,6 +123,7 @@
|
|||
useLegacyCapturer: false,
|
||||
inviteWebsocket: true,
|
||||
mobileMode: false,
|
||||
dynamicIcon: false,
|
||||
trayIcon: "default",
|
||||
startMinimized: false,
|
||||
performanceMode: "none"
|
||||
|
@ -157,6 +158,7 @@
|
|||
performanceMode: "none",
|
||||
useLegacyCapturer: false,
|
||||
alternativePaste: false,
|
||||
dynamicIcon: false,
|
||||
disableAutogain: false,
|
||||
startMinimized: false,
|
||||
trayIcon: "default",
|
||||
|
@ -175,6 +177,7 @@
|
|||
mobileMode: false,
|
||||
disableAutogain: false,
|
||||
mods: "none",
|
||||
dynamicIcon: false,
|
||||
useLegacyCapturer: false,
|
||||
startMinimized: false,
|
||||
alternativePaste: false,
|
||||
|
|
|
@ -104,6 +104,14 @@
|
|||
</div>
|
||||
<br />
|
||||
|
||||
<div class="switch acDynamicIcon">
|
||||
<label class="header" data-string="settings-dynamicIcon"></label>
|
||||
<input id="dynamicIcon" class="tgl tgl-light left" data-setting="dynamicIcon" type="checkbox" />
|
||||
<label class="tgl-btn left" for="dynamicIcon"></label>
|
||||
<p class="description" data-string="settings-dynamicIcon-desc"></p>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<div class="switch acChannel">
|
||||
<select name="channel" data-setting="channel" class="left dropdown">
|
||||
<option value="stable" selected>Stable</option>
|
||||
|
|
|
@ -50,6 +50,7 @@ export function setup() {
|
|||
skipSplash: false,
|
||||
inviteWebsocket: true,
|
||||
startMinimized: false,
|
||||
dynamicIcon: false,
|
||||
disableAutogain: false,
|
||||
useLegacyCapturer: false,
|
||||
mobileMode: false,
|
||||
|
@ -241,6 +242,7 @@ export interface Settings {
|
|||
automaticPatches: boolean;
|
||||
alternativePaste: boolean;
|
||||
mods: string;
|
||||
dynamicIcon: boolean;
|
||||
mobileMode: boolean;
|
||||
skipSplash: boolean;
|
||||
performanceMode: string;
|
||||
|
|
|
@ -140,7 +140,7 @@ async function doAfterDefiningTheWindow() {
|
|||
(_, callback) => callback({cancel: true})
|
||||
);
|
||||
|
||||
if ((await getConfig("trayIcon")) == "default") {
|
||||
if ((await getConfig("trayIcon")) == "default" || (await getConfig("dynamicIcon"))) {
|
||||
mainWindow.webContents.on("page-favicon-updated", async (event) => {
|
||||
var faviconBase64 = await mainWindow.webContents.executeJavaScript(`
|
||||
var getFavicon = function(){
|
||||
|
@ -164,7 +164,11 @@ async function doAfterDefiningTheWindow() {
|
|||
trayPath = trayPath.resize({height: 22});
|
||||
if (process.platform === "win32" && trayPath.getSize().height > 32)
|
||||
trayPath = trayPath.resize({height: 32});
|
||||
tray.setImage(trayPath);
|
||||
if ((await getConfig("trayIcon")) == "default") {
|
||||
tray.setImage(trayPath);
|
||||
} else if (await getConfig("dynamicIcon")) {
|
||||
mainWindow.setIcon(trayPath);
|
||||
}
|
||||
});
|
||||
}
|
||||
const userDataPath = app.getPath("userData");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue