aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-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
}
});