diff options
author | V <vendicated@riseup.net> | 2023-05-11 19:00:18 +0200 |
---|---|---|
committer | V <vendicated@riseup.net> | 2023-05-11 19:00:18 +0200 |
commit | 622e8dc3e06e99d3cba83766e2e4d92c3189ec7f (patch) | |
tree | 62928496f16314186323e9cb77b31ada6838283f | |
parent | a8b6aea26fb93134dced904bd24f110c2941d2a7 (diff) | |
download | Vencord-622e8dc3e06e99d3cba83766e2e4d92c3189ec7f.tar.gz Vencord-622e8dc3e06e99d3cba83766e2e4d92c3189ec7f.tar.bz2 Vencord-622e8dc3e06e99d3cba83766e2e4d92c3189ec7f.zip |
[skip ci] Translate: Shift/Right click shortcut
-rw-r--r-- | src/plugins/translate/TranslateIcon.tsx | 11 | ||||
-rw-r--r-- | src/plugins/translate/settings.ts | 2 |
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 } }); |