Skip to content

Commit 1e88157

Browse files
rezbytejgoedde
authored andcommitted
Add 'paste without formatting' to the context menu on desktop
Closes #3018.
1 parent 4f55d91 commit 1e88157

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

src/common/desktop/DesktopContextMenu.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ContextMenuParams, Menu, WebContents } from "electron"
22
import { lang } from "../misc/LanguageViewModel"
33
import { WindowManager } from "./DesktopWindowManager.js"
4+
import { client } from "../misc/ClientDetector.js"
45

56
type Electron = typeof Electron.CrossProcessExports
67

@@ -16,6 +17,12 @@ export class DesktopContextMenu {
1617
click: (_, bw) => this.getWebContents(bw)?.paste(),
1718
enabled: editFlags.canPaste,
1819
})
20+
const pasteWithoutFormattingItem = new this.electron.MenuItem({
21+
label: lang.get("pasteWithoutFormatting_action"),
22+
accelerator: client.isMacOS ? "Cmd+Option+Shift+V" : "Ctrl+Shift+V",
23+
click: (_, bw) => this.getWebContents(bw)?.pasteAndMatchStyle(),
24+
enabled: editFlags.canPaste,
25+
})
1926
const copyItem = new this.electron.MenuItem({
2027
label: lang.get("copy_action"),
2128
accelerator: "CmdOrCtrl+C",
@@ -53,6 +60,7 @@ export class DesktopContextMenu {
5360
menu.append(cutItem)
5461
menu.append(copyLinkItem)
5562
menu.append(pasteItem)
63+
menu.append(pasteWithoutFormattingItem)
5664
menu.append(
5765
new this.electron.MenuItem({
5866
type: "separator",

src/common/misc/TranslationKey.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,7 @@ export type TranslationKeyType =
11251125
| "passwordWrongInvalid_msg"
11261126
| "password_label"
11271127
| "paste_action"
1128+
| "pasteWithoutFormatting_action"
11281129
| "pathAlreadyExists_msg"
11291130
| "payCardContactBankError_msg"
11301131
| "payCardExpiredError_msg"

src/mail-app/translations/de.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,7 @@ export default {
11461146
"passwordWrongInvalid_msg": "Das Passwort ist falsch.",
11471147
"password_label": "Passwort",
11481148
"paste_action": "Einfügen",
1149+
"pasteWithoutFormatting_action": "Einfügen ohne Formatierung",
11491150
"pathAlreadyExists_msg": "Dieser Pfad existiert bereits.",
11501151
"payCardContactBankError_msg": "Leider wurde die Zahlung von deiner Bank abgelehnt. Bitte prüfe, dass die Kreditkartendaten korrekt sind, oder kontaktiere deine Bank.",
11511152
"payCardExpiredError_msg": "Leider ist die Kreditkarte abgelaufen. Bitte aktualisiere deine Zahlungsdaten.",

src/mail-app/translations/de_sie.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,7 @@ export default {
11461146
"passwordWrongInvalid_msg": "Das Passwort ist falsch.",
11471147
"password_label": "Passwort",
11481148
"paste_action": "Einfügen",
1149+
"pasteWithoutFormatting_action": "Einfügen ohne Formatierung",
11491150
"pathAlreadyExists_msg": "Dieser Pfad existiert bereits.",
11501151
"payCardContactBankError_msg": "Leider wurde die Zahlung von Ihrer Bank abgelehnt. Bitte prüfen Sie, dass die Kreditkartendaten korrekt sind, oder kontaktieren Sie Ihre Bank.",
11511152
"payCardExpiredError_msg": "Leider ist die Kreditkarte abgelaufen. Bitte aktualisieren Sie Ihre Zahlungsdaten.",

src/mail-app/translations/en.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,7 @@ export default {
11421142
"passwordWrongInvalid_msg": "Your password is wrong.",
11431143
"password_label": "Password",
11441144
"paste_action": "Paste",
1145+
"pasteWithoutFormatting_action": "Paste without formatting",
11451146
"pathAlreadyExists_msg": "This path already exists.",
11461147
"payCardContactBankError_msg": "Sorry, the payment transaction was rejected by your bank. Please make sure that your credit card details are correct or contact your bank.",
11471148
"payCardExpiredError_msg": "Sorry, the credit card has expired. Please update your payment details.",

0 commit comments

Comments
 (0)