Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text appearing grey while printing in dark mode #7948

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app-ios/calendar/Sources/IosMobileSystemFacade.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Contacts
import StoreKit
import Foundation
import StoreKit
import TutanotaSharedFramework
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/LaunchHtml.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export async function renderHtml(scripts, env) {
<meta itemprop="name" content="Turn ON Privacy">
<meta itemprop="description" content="Get a free email account with quantum-safe encryption and best privacy on all your devices. Green, secure &amp; no ads!">
<meta itemprop="image" content="https://tuta.com/images/share_image.png">
<meta name="apple-itunes-app" content="app-id=id922429609, affiliate-data=10lSfb">
<meta name="apple-itunes-app" content="app-id=922429609, app-argument=https://app.tuta.com">
</head>
<body style="background-color:transparent">
<noscript>This site requires javascript to be enabled. Please activate it in the settings of your browser.</noscript>
Expand Down
2 changes: 2 additions & 0 deletions src/common/api/worker/invoicegen/InvoiceTexts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default {
yourVatId: "Your VAT identification number:",
netPricesNoVatInGermany: "All prices are net prices and not subject to value added tax in Germany.",
noVatInGermany: "Prices are not subject to value added tax in Germany.",
reverseChargeAffiliate: "All prices are net prices. We are liable for VAT under the reverse charge mechanism",

paymentInvoiceDue1: "The payment is due 7 days after the invoice date without any deduction. Please",
paymentInvoiceDue2: "transfer the grand total with reference to the invoice number to our account:",
Expand Down Expand Up @@ -102,6 +103,7 @@ export default {
yourVatId: "Ihre Umsatzsteuer-Identifikationsnummer:",
netPricesNoVatInGermany: "Alle Beträge sind netto und werden nicht in Deutschland versteuert.",
noVatInGermany: "Beträge werden nicht in Deutschland versteuert.",
reverseChargeAffiliate: "Alle Beträge sind netto. Die Steuerschuldnerschaft geht auf uns als Leistungsempfänger über.",

quantity: "Menge",
item: "Item",
Expand Down
19 changes: 16 additions & 3 deletions src/common/api/worker/invoicegen/PdfInvoiceGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const enum VatType {
ADD_VAT = "1",
VAT_INCLUDED_SHOWN = "2",
VAT_INCLUDED_HIDDEN = "3",
NO_VAT_REVERSE_CHARGE = "4",
NO_VAT_CHARGE_TUTAO = "4",
}

const enum InvoiceType {
Expand Down Expand Up @@ -223,7 +223,8 @@ export class PdfInvoiceGenerator {
"",
"",
InvoiceTexts[this.languageCode].grandTotal,
this.formatInvoiceCurrency(this.invoice.grandTotal),
// in case of NO_VAT_CHARGE_TUTAO we must not show the VAT in the invoice, but we pay the taxes ourselves, so they need to be existing on the invoice
this.formatInvoiceCurrency(this.invoice.vatType == VatType.NO_VAT_CHARGE_TUTAO ? this.invoice.subTotal : this.invoice.grandTotal),
])
}

Expand All @@ -239,7 +240,6 @@ export class PdfInvoiceGenerator {
case VatType.VAT_INCLUDED_SHOWN:
break
case VatType.NO_VAT:
case VatType.NO_VAT_REVERSE_CHARGE:
if (this.invoice.vatIdNumber != null) {
this.doc
.addText(InvoiceTexts[this.languageCode].reverseChargeVatIdNumber1)
Expand All @@ -253,6 +253,19 @@ export class PdfInvoiceGenerator {
this.doc.addText(InvoiceTexts[this.languageCode].netPricesNoVatInGermany)
}
break
case VatType.NO_VAT_CHARGE_TUTAO:
this.doc
.addText(InvoiceTexts[this.languageCode].reverseChargeAffiliate)
.addLineBreak()
.addText(InvoiceTexts[this.languageCode].reverseChargeVatIdNumber2)
if (this.invoice.vatIdNumber != null) {
this.doc
.addLineBreak()
.addText(`${InvoiceTexts[this.languageCode].yourVatId} `)
.changeFont(PDF_FONTS.BOLD, 11)
.addText(`${this.invoice.vatIdNumber}`)
}
break
case VatType.VAT_INCLUDED_HIDDEN:
this.doc.addText(InvoiceTexts[this.languageCode].noVatInGermany)
break
Expand Down
8 changes: 8 additions & 0 deletions src/common/desktop/DesktopContextMenu.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { ContextMenuParams, Menu, WebContents } from "electron"
import { lang } from "../misc/LanguageViewModel"
import { WindowManager } from "./DesktopWindowManager.js"
import { client } from "../misc/ClientDetector.js"

type Electron = typeof Electron.CrossProcessExports

Expand All @@ -16,6 +17,12 @@ export class DesktopContextMenu {
click: (_, bw) => this.getWebContents(bw)?.paste(),
enabled: editFlags.canPaste,
})
const pasteWithoutFormattingItem = new this.electron.MenuItem({
label: lang.get("pasteWithoutFormatting_action"),
accelerator: client.isMacOS ? "Cmd+Option+Shift+V" : "Ctrl+Shift+V",
click: (_, bw) => this.getWebContents(bw)?.pasteAndMatchStyle(),
enabled: editFlags.canPaste,
})
const copyItem = new this.electron.MenuItem({
label: lang.get("copy_action"),
accelerator: "CmdOrCtrl+C",
Expand Down Expand Up @@ -53,6 +60,7 @@ export class DesktopContextMenu {
menu.append(cutItem)
menu.append(copyLinkItem)
menu.append(pasteItem)
menu.append(pasteWithoutFormattingItem)
menu.append(
new this.electron.MenuItem({
type: "separator",
Expand Down
4 changes: 4 additions & 0 deletions src/common/gui/main-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { getContentButtonIconBackground, getElevatedBackground, getNavigationMen
import { stateBgActive, stateBgFocus, stateBgHover, stateBgLike } from "./builtinThemes.js"
import { FontIcons } from "./base/icons/FontIcons.js"
import { DefaultAnimationTime } from "./animation/Animations.js"
import { locator } from "../api/main/CommonLocator.js"

assertMainOrNode()

Expand Down Expand Up @@ -35,6 +36,7 @@ const searchBarShadow = "0px 2px 4px rgb(0, 0, 0, 0.12)"

const scrollbarWidthHeight = px(18)
styles.registerStyle("main", () => {
const lightTheme = locator.themeController.getBaseTheme("light")
return {
"#link-tt": isElectronClient()
? {
Expand Down Expand Up @@ -2486,6 +2488,8 @@ styles.registerStyle("main", () => {
"html, body": {
position: "initial",
overflow: "visible !important",
color: lightTheme.content_fg,
"background-color": `${lightTheme.content_bg} !important`,
},
// overwrite position "fixed" otherwise only one page will be printed.
".header-nav": {
Expand Down
1 change: 1 addition & 0 deletions src/common/misc/TranslationKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,7 @@ export type TranslationKeyType =
| "passwordWrongInvalid_msg"
| "password_label"
| "paste_action"
| "pasteWithoutFormatting_action"
| "pathAlreadyExists_msg"
| "payCardContactBankError_msg"
| "payCardExpiredError_msg"
Expand Down
1 change: 1 addition & 0 deletions src/mail-app/translations/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ export default {
"passwordWrongInvalid_msg": "Das Passwort ist falsch.",
"password_label": "Passwort",
"paste_action": "Einfügen",
"pasteWithoutFormatting_action": "Einfügen ohne Formatierung",
"pathAlreadyExists_msg": "Dieser Pfad existiert bereits.",
"payCardContactBankError_msg": "Leider wurde die Zahlung von deiner Bank abgelehnt. Bitte prüfe, dass die Kreditkartendaten korrekt sind, oder kontaktiere deine Bank.",
"payCardExpiredError_msg": "Leider ist die Kreditkarte abgelaufen. Bitte aktualisiere deine Zahlungsdaten.",
Expand Down
1 change: 1 addition & 0 deletions src/mail-app/translations/de_sie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ export default {
"passwordWrongInvalid_msg": "Das Passwort ist falsch.",
"password_label": "Passwort",
"paste_action": "Einfügen",
"pasteWithoutFormatting_action": "Einfügen ohne Formatierung",
"pathAlreadyExists_msg": "Dieser Pfad existiert bereits.",
"payCardContactBankError_msg": "Leider wurde die Zahlung von Ihrer Bank abgelehnt. Bitte prüfen Sie, dass die Kreditkartendaten korrekt sind, oder kontaktieren Sie Ihre Bank.",
"payCardExpiredError_msg": "Leider ist die Kreditkarte abgelaufen. Bitte aktualisieren Sie Ihre Zahlungsdaten.",
Expand Down
9 changes: 8 additions & 1 deletion src/mail-app/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,7 @@ export default {
"passwordWrongInvalid_msg": "Your password is wrong.",
"password_label": "Password",
"paste_action": "Paste",
"pasteWithoutFormatting_action": "Paste without formatting",
"pathAlreadyExists_msg": "This path already exists.",
"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.",
"payCardExpiredError_msg": "Sorry, the credit card has expired. Please update your payment details.",
Expand Down Expand Up @@ -1831,6 +1832,12 @@ export default {
"yourCalendars_label": "Your calendars",
"yourFolders_action": "YOUR FOLDERS",
"yourMessage_label": "Your message",
"you_label": "You"
"you_label": "You",
"ratingHowAreWeDoing_title": "How are we doing?",
"ratingExplanation_msg": "Whether you love us or feel we could be doing better, let us know!",
"ratingLoveIt_label": "Love it!",
"dontAskAgain_label": "Don't ask again",
"ratingNeedsWork_label": "Needs work",
"notNow_label": "Not now"
}
}
Loading