summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/src/domain/mime/partmodel.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/framework/src/domain/mime/partmodel.cpp b/framework/src/domain/mime/partmodel.cpp
index df63f5e9..de6c89c3 100644
--- a/framework/src/domain/mime/partmodel.cpp
+++ b/framework/src/domain/mime/partmodel.cpp
@@ -116,15 +116,19 @@ QModelIndex PartModel::index(int row, int column, const QModelIndex &parent) con
116 116
117static QString addCss(const QString &s) 117static QString addCss(const QString &s)
118{ 118{
119 //Get the default font from QApplication
120 static const auto fontFamily = QFont{}.family();
119 //overflow:hidden ensures no scrollbars are ever shown. 121 //overflow:hidden ensures no scrollbars are ever shown.
120 const auto css = "<style>\n" 122 static const auto css = QString("<style>\n"
121 "body {\n" 123 "body {\n"
122 " overflow:hidden;\n" 124 " overflow:hidden;\n"
123 " font-family: \"Noto Sans\" ! important;\n" 125 " font-family: \"%1\" ! important;\n"
124 " color: #31363b ! important;\n" 126 " color: #31363b ! important;\n"
125 " background-color: #fcfcfc ! important\n" 127 " background-color: #fcfcfc ! important\n"
126 "}\n" 128 "}\n"
127 "</style>"; 129 "</style>")
130 .arg(fontFamily);
131
128 const auto header = QLatin1String("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n" 132 const auto header = QLatin1String("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n"
129 "<html><head><title></title>") 133 "<html><head><title></title>")
130 + css + QLatin1String("</head>\n<body>\n"); 134 + css + QLatin1String("</head>\n<body>\n");