mirror of
https://github.com/Vencord/Vesktop.git
synced 2025-02-24 06:05:09 +00:00
removed deprecated references to tray icon setting
This commit is contained in:
parent
02bd04e3a5
commit
a3f38ce205
4 changed files with 2 additions and 80 deletions
|
@ -18,7 +18,7 @@ import { IpcEvents } from "../shared/IpcEvents";
|
|||
import { setBadgeCount } from "./appBadge";
|
||||
import { autoStart } from "./autoStart";
|
||||
import { VENCORD_FILES_DIR, VENCORD_QUICKCSS_FILE, VENCORD_THEMES_DIR } from "./constants";
|
||||
import { mainWin } from "./mainWindow";
|
||||
import { mainWin, getTrayIcon } from "./mainWindow";
|
||||
import { Settings } from "./settings";
|
||||
import { handle, handleSync } from "./utils/ipcWrappers";
|
||||
import { PopoutWindows } from "./utils/popout";
|
||||
|
@ -121,20 +121,6 @@ handle(IpcEvents.SELECT_VENCORD_DIR, async () => {
|
|||
return dir;
|
||||
});
|
||||
|
||||
handle(IpcEvents.SELECT_TRAY_ICON, async () => {
|
||||
const res = await dialog.showOpenDialog(mainWin!, {
|
||||
properties: ["openFile"],
|
||||
filters: [{name: "Image", extensions: ["png", "jpg"]}]
|
||||
});
|
||||
if (!res.filePaths.length) return "cancelled";
|
||||
|
||||
const dir = res.filePaths[0];
|
||||
const image = nativeImage.createFromPath(dir);
|
||||
if(image.isEmpty()) return "invalid";
|
||||
|
||||
return dir;
|
||||
});
|
||||
|
||||
handle(IpcEvents.SET_BADGE_COUNT, (_, count: number) => setBadgeCount(count));
|
||||
|
||||
handle(IpcEvents.CLIPBOARD_COPY_IMAGE, async (_, buf: ArrayBuffer, src: string) => {
|
||||
|
|
|
@ -33,8 +33,7 @@ export const VesktopNative = {
|
|||
},
|
||||
fileManager: {
|
||||
showItemInFolder: (path: string) => invoke<void>(IpcEvents.SHOW_ITEM_IN_FOLDER, path),
|
||||
selectVencordDir: () => invoke<LiteralUnion<"cancelled" | "invalid", string>>(IpcEvents.SELECT_VENCORD_DIR),
|
||||
selectTrayIcon: () => invoke<LiteralUnion<"cancelled" | "invalid", string>>(IpcEvents.SELECT_TRAY_ICON)
|
||||
selectVencordDir: () => invoke<LiteralUnion<"cancelled" | "invalid", string>>(IpcEvents.SELECT_VENCORD_DIR)
|
||||
},
|
||||
settings: {
|
||||
get: () => sendSync<Settings>(IpcEvents.GET_SETTINGS),
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: GPL-3.0
|
||||
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
|
||||
* Copyright (c) 2023 Vendicated and Vencord contributors
|
||||
*/
|
||||
|
||||
import { Button, Forms, Toasts } from "@vencord/types/webpack/common";
|
||||
|
||||
import { SettingsComponent } from "./Settings";
|
||||
|
||||
export const TrayIconImagePicker: SettingsComponent = ({ settings }) => {
|
||||
return (
|
||||
<>
|
||||
<Forms.FormText>
|
||||
Tray icon is currently {" "}
|
||||
{settings.trayIconPath ? (
|
||||
<a
|
||||
href="about:blank"
|
||||
onClick={e => {
|
||||
e.preventDefault();
|
||||
VesktopNative.fileManager.showItemInFolder(settings.trayIconPath!);
|
||||
}}
|
||||
>
|
||||
{settings.trayIconPath}
|
||||
</a>
|
||||
) : (
|
||||
"the default location"
|
||||
)}
|
||||
</Forms.FormText>
|
||||
<div className="vcd-location-btns">
|
||||
<Button
|
||||
size={Button.Sizes.SMALL}
|
||||
onClick={async () => {
|
||||
const choice = await VesktopNative.fileManager.selectTrayIcon();
|
||||
switch (choice) {
|
||||
case "cancelled":
|
||||
return;
|
||||
case "invalid":
|
||||
Toasts.show({
|
||||
message:
|
||||
"Please select a valid .png or .jpg image!",
|
||||
id: Toasts.genId(),
|
||||
type: Toasts.Type.FAILURE
|
||||
});
|
||||
return;
|
||||
}
|
||||
settings.trayIconPath = choice;
|
||||
}}
|
||||
>
|
||||
Change
|
||||
</Button>
|
||||
<Button
|
||||
size={Button.Sizes.SMALL}
|
||||
color={Button.Colors.RED}
|
||||
onClick={() => (settings.trayIconPath = void 0)}
|
||||
>
|
||||
Reset
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
|
@ -24,7 +24,6 @@ export const enum IpcEvents {
|
|||
SET_SETTINGS = "VCD_SET_SETTINGS",
|
||||
|
||||
SELECT_VENCORD_DIR = "VCD_SELECT_VENCORD_DIR",
|
||||
SELECT_TRAY_ICON = "VCD_SELECT_TRAY_ICON",
|
||||
|
||||
UPDATER_GET_DATA = "VCD_UPDATER_GET_DATA",
|
||||
UPDATER_DOWNLOAD = "VCD_UPDATER_DOWNLOAD",
|
||||
|
|
Loading…
Add table
Reference in a new issue