TF-3410 Update color, dimensions and alignments in EmailView

Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
dab246
2025-01-08 16:07:00 +07:00
committed by Dat H. Pham
parent d9def92781
commit b3aaef83a5
16 changed files with 92 additions and 58 deletions
+11 -2
View File
@@ -94,7 +94,9 @@ class HtmlUtils {
String? styleCSS,
String? javaScripts,
bool hideScrollBar = true,
TextDirection? direction
bool useDefaultFont = false,
TextDirection? direction,
double? contentPadding,
}) {
return '''
<!DOCTYPE html>
@@ -103,6 +105,13 @@ class HtmlUtils {
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
${useDefaultFont ? '''
body {
font-family: Arial, 'Inter', sans-serif; /* Fall back to sans-serif if fonts aren't available */
font-size: 16pt;
line-height: 24pt;
}
''' : ''}
.tmail-content {
min-height: ${minHeight ?? 0}px;
min-width: ${minWidth ?? 0}px;
@@ -120,7 +129,7 @@ class HtmlUtils {
${styleCSS ?? ''}
</style>
</head>
<body ${direction == TextDirection.rtl ? 'dir="rtl"' : ''} style = "overflow-x: hidden">
<body ${direction == TextDirection.rtl ? 'dir="rtl"' : ''} style = "overflow-x: hidden; ${contentPadding != null ? 'margin: $contentPadding;' : ''}";>
<div class="tmail-content">$content</div>
${javaScripts ?? ''}
</body>