aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/imageZoom/index.tsx
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-06-30 15:50:56 +0200
committerV <vendicated@riseup.net>2023-06-30 15:50:56 +0200
commitb607eebcb709daee421aba4e19d7729e4766b974 (patch)
tree9beaa5ce04c97e1e6b13f14d9dca6c20bf6606f9 /src/plugins/imageZoom/index.tsx
parent0936ca29856507891397739a92feced62aba5876 (diff)
downloadVencord-b607eebcb709daee421aba4e19d7729e4766b974.tar.gz
Vencord-b607eebcb709daee421aba4e19d7729e4766b974.tar.bz2
Vencord-b607eebcb709daee421aba4e19d7729e4766b974.zip
ImageZoom: Add square lens option
Diffstat (limited to 'src/plugins/imageZoom/index.tsx')
-rw-r--r--src/plugins/imageZoom/index.tsx24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/plugins/imageZoom/index.tsx b/src/plugins/imageZoom/index.tsx
index 00c9eee..71540f2 100644
--- a/src/plugins/imageZoom/index.tsx
+++ b/src/plugins/imageZoom/index.tsx
@@ -23,7 +23,7 @@ import { makeRange } from "@components/PluginSettings/components";
import { Devs } from "@utils/constants";
import { debounce } from "@utils/debounce";
import definePlugin, { OptionType } from "@utils/types";
-import { Menu, React, ReactDOM } from "@webpack/common";
+import { ContextMenu, Menu, React, ReactDOM } from "@webpack/common";
import type { Root } from "react-dom/client";
import { Magnifier, MagnifierProps } from "./components/Magnifier";
@@ -56,6 +56,12 @@ export const settings = definePluginSettings({
default: false,
},
+ square: {
+ type: OptionType.BOOLEAN,
+ description: "Make the lens square",
+ default: false,
+ },
+
zoom: {
description: "Zoom of the lens",
type: OptionType.SLIDER,
@@ -84,9 +90,17 @@ export const settings = definePluginSettings({
const imageContextMenuPatch: NavContextMenuPatchCallback = children => () => {
children.push(
<Menu.MenuGroup id="image-zoom">
- {/* thanks SpotifyControls */}
+ <Menu.MenuCheckboxItem
+ id="vc-square"
+ label="Square Lens"
+ checked={settings.store.square}
+ action={() => {
+ settings.store.square = !settings.store.square;
+ ContextMenu.close();
+ }}
+ />
<Menu.MenuControlItem
- id="zoom"
+ id="vc-zoom"
label="Zoom"
control={(props, ref) => (
<Menu.MenuSliderControl
@@ -100,7 +114,7 @@ const imageContextMenuPatch: NavContextMenuPatchCallback = children => () => {
)}
/>
<Menu.MenuControlItem
- id="size"
+ id="vc-size"
label="Lens Size"
control={(props, ref) => (
<Menu.MenuSliderControl
@@ -114,7 +128,7 @@ const imageContextMenuPatch: NavContextMenuPatchCallback = children => () => {
)}
/>
<Menu.MenuControlItem
- id="zoom-speed"
+ id="vc-zoom-speed"
label="Zoom Speed"
control={(props, ref) => (
<Menu.MenuSliderControl