aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-05-11 19:00:18 +0200
committerV <vendicated@riseup.net>2023-05-11 19:00:18 +0200
commit622e8dc3e06e99d3cba83766e2e4d92c3189ec7f (patch)
tree62928496f16314186323e9cb77b31ada6838283f
parenta8b6aea26fb93134dced904bd24f110c2941d2a7 (diff)
downloadVencord-622e8dc3e06e99d3cba83766e2e4d92c3189ec7f.tar.gz
Vencord-622e8dc3e06e99d3cba83766e2e4d92c3189ec7f.tar.bz2
Vencord-622e8dc3e06e99d3cba83766e2e4d92c3189ec7f.zip
[skip ci] Translate: Shift/Right click shortcut
-rw-r--r--src/plugins/translate/TranslateIcon.tsx11
-rw-r--r--src/plugins/translate/settings.ts2
2 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/translate/TranslateIcon.tsx b/src/plugins/translate/TranslateIcon.tsx
index af97a53..bdec127 100644
--- a/src/plugins/translate/TranslateIcon.tsx
+++ b/src/plugins/translate/TranslateIcon.tsx
@@ -43,6 +43,8 @@ export function TranslateChatBarIcon({ slateProps }: { slateProps: { type: { ana
if (slateProps.type.analyticsName !== "normal")
return null;
+ const toggle = () => settings.store.autoTranslate = !autoTranslate;
+
return (
<Tooltip text="Open Translate Modal">
{({ onMouseEnter, onMouseLeave }) => (
@@ -55,11 +57,14 @@ export function TranslateChatBarIcon({ slateProps }: { slateProps: { type: { ana
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}
innerClassName={ButtonWrapperClasses.button}
- onClick={() =>
+ onClick={e => {
+ if (e.shiftKey) return toggle();
+
openModal(props => (
<TranslateModal rootProps={props} />
- ))
- }
+ ));
+ }}
+ onContextMenu={() => toggle()}
style={{ padding: "0 4px" }}
>
<div className={ButtonWrapperClasses.buttonWrapper}>
diff --git a/src/plugins/translate/settings.ts b/src/plugins/translate/settings.ts
index 13e6540..aa4f633 100644
--- a/src/plugins/translate/settings.ts
+++ b/src/plugins/translate/settings.ts
@@ -46,7 +46,7 @@ export const settings = definePluginSettings({
},
autoTranslate: {
type: OptionType.BOOLEAN,
- description: "Automatically translate your messages before sending",
+ description: "Automatically translate your messages before sending. You can also shift/right click the translate button to toggle this",
default: false
}
});