summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-06-05 01:22:59 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-06-08 22:21:29 +0200
commit1da3f2e1da67923adae2decb5a0891056d23a256 (patch)
tree2615dac2938c00f769c26f77fcdabbdf765edf17 /resources/qml
parentRefactor to use Instantiator instead of doing it manually (diff)
downloadnheko-1da3f2e1da67923adae2decb5a0891056d23a256.tar.xz
Add ugly borders to tables
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/delegates/TextMessage.qml19
1 files changed, 18 insertions, 1 deletions
diff --git a/resources/qml/delegates/TextMessage.qml b/resources/qml/delegates/TextMessage.qml
index f65eda79..cd46f8ca 100644
--- a/resources/qml/delegates/TextMessage.qml
+++ b/resources/qml/delegates/TextMessage.qml
@@ -9,7 +9,24 @@ MatrixText {
     property string formatted: model.data.formattedBody
     property string copyText: selectedText ? getText(selectionStart, selectionEnd) : model.data.body
 
-    text: "<style type=\"text/css\">a { color:" + Nheko.colors.link + ";}\ncode { background-color: " + Nheko.colors.alternateBase + ";}</style>" + formatted.replace("<pre>", "<pre style='white-space: pre-wrap; background-color: " + Nheko.colors.alternateBase + "'>").replace("<del>", "<s>").replace("</del>", "</s>").replace("<strike>", "<s>").replace("</strike>", "</s>")
+    // table border-collapse doesn't seem to work
+    text: "
+    <style type=\"text/css\">
+    a { color:" + Nheko.colors.link + ";}
+    code { background-color: " + Nheko.colors.alternateBase + ";}
+    table {
+        border-width: 1px;
+        border-collapse: collapse;
+        border-style: solid;
+    }
+    table th,
+    table td {
+        bgcolor: " + Nheko.colors.alternateBase + ";
+        border-collapse: collapse;
+        border: 1px solid " + Nheko.colors.text + ";
+    }
+    </style>
+    " + formatted.replace("<pre>", "<pre style='white-space: pre-wrap; background-color: " + Nheko.colors.alternateBase + "'>").replace("<del>", "<s>").replace("</del>", "</s>").replace("<strike>", "<s>").replace("</strike>", "</s>")
     width: parent ? parent.width : undefined
     height: isReply ? Math.round(Math.min(timelineView.height / 8, implicitHeight)) : undefined
     clip: isReply