feat: ability to disable icons rewriting

This commit is contained in:
Oleh Polisan 2024-06-19 15:53:56 +03:00
parent e899b16b21
commit 775ad30643
4 changed files with 14 additions and 9 deletions

View file

@ -531,10 +531,7 @@ export async function createTrayIcon(iconName: string, iconDataURL: string) {
export async function generateTrayIcons() {
// this function generates tray icons as .png's in Vesktop cache for future use
mkdirSync(join(DATA_DIR, "TrayIcons"), { recursive: true });
const trayIconsColor = Settings.store.trayColor ?? "#3DB77F";
const userDefinedIcons = false;
if (userDefinedIcons) {
} else {
if (!Settings.store.trayCustom) {
const Icons = ["speaking", "muted", "deafened", "idle"];
for (const icon of Icons) {
mainWin.webContents.send(IpcEvents.CREATE_TRAY_ICON_REQUEST, icon);

View file

@ -70,6 +70,13 @@ const SettingsOptions: Record<string, Array<BooleanSetting | SettingsComponent>>
],
Behaviour: [
TraySwitch,
{
key: "trayCustom",
title: "Use custom tray icons",
description: "Disable rewriting tray icons at config folder",
defaultValue: false,
invisible: () => Settings.store.tray === false
},
TrayIconPicker,
TrayFillColorSwitch,
{
@ -77,14 +84,14 @@ const SettingsOptions: Record<string, Array<BooleanSetting | SettingsComponent>>
title: "Minimize to tray",
description: "Hitting X will make Vesktop minimize to the tray instead of closing",
defaultValue: true,
invisible: () => isMac,
disabled: () => Settings.store.tray === false
invisible: () => isMac || Settings.store.tray === false
},
{
key: "clickTrayToShowHide",
title: "Hide/Show on tray click",
description: "Left clicking tray icon will toggle the vesktop window visibility.",
defaultValue: false
defaultValue: false,
invisible: () => Settings.store.tray === false
},
{
key: "disableMinSize",

View file

@ -50,7 +50,7 @@ export const TraySwitch: SettingsComponent = ({ settings }) => {
};
export const TrayIconPicker: SettingsComponent = ({ settings }) => {
if (!settings.tray) return null;
if (!settings.tray || settings.trayCustom) return null;
return (
<div className="vcd-tray-settings">
<div className="vcd-tray-container">
@ -75,7 +75,7 @@ export const TrayIconPicker: SettingsComponent = ({ settings }) => {
};
export const TrayFillColorSwitch: SettingsComponent = ({ settings }) => {
if (!settings.tray) return null;
if (!settings.tray || settings.trayCustom) return null;
return (
<div className="vcd-tray-settings">
<div className="vcd-tray-container">

View file

@ -13,6 +13,7 @@ export interface Settings {
tray?: boolean;
trayColor?: string;
trayAutoFill?: "auto" | "white" | "black";
trayCustom?: boolean;
minimizeToTray?: boolean;
openLinksWithElectron?: boolean;
staticTitle?: boolean;