From 948da868a97495ccc421cbe9948d0dfe5d27d750 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Mon, 26 Nov 2018 18:49:03 +0800 Subject: [PATCH] Wrap
 tag.

---
 imports/Spectral/Panel/RoomListPanel.qml | 9 ++++++++-
 imports/Spectral/Panel/RoomPanel.qml     | 4 ++--
 imports/Spectral/Setting/Setting.qml     | 3 +++
 src/utils.h                              | 2 ++
 4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/imports/Spectral/Panel/RoomListPanel.qml b/imports/Spectral/Panel/RoomListPanel.qml
index 93e3318..1d5b867 100644
--- a/imports/Spectral/Panel/RoomListPanel.qml
+++ b/imports/Spectral/Panel/RoomListPanel.qml
@@ -84,7 +84,7 @@ Rectangle {
     }
 
     Drawer {
-        width: Math.max(root.width, 360)
+        width: Math.max(root.width, 400)
         height: root.height
 
         id: drawer
@@ -466,6 +466,13 @@ Rectangle {
                         onCheckedChanged: MSettings.showTray = checked
                     }
 
+                    Switch {
+                        text: "Enable timeline background"
+                        checked: MSettings.enableTimelineBackground
+
+                        onCheckedChanged: MSettings.enableTimelineBackground = checked
+                    }
+
                     RowLayout {
                         Layout.fillWidth: true
 
diff --git a/imports/Spectral/Panel/RoomPanel.qml b/imports/Spectral/Panel/RoomPanel.qml
index 643c235..44e0679 100644
--- a/imports/Spectral/Panel/RoomPanel.qml
+++ b/imports/Spectral/Panel/RoomPanel.qml
@@ -44,9 +44,9 @@ Item {
     Image {
         anchors.fill: parent
 
-        visible: currentRoom
+        visible: currentRoom && MSettings.enableTimelineBackground
 
-        source: MSettings.darkTheme ? "qrc:/assets/img/roompanel-dark.svg" : "qrc:/assets/img/roompanel.svg"
+        source: MSettings.timelineBackground || MSettings.darkTheme ? "qrc:/assets/img/roompanel-dark.svg" : "qrc:/assets/img/roompanel.svg"
         fillMode: Image.PreserveAspectCrop
     }
 
diff --git a/imports/Spectral/Setting/Setting.qml b/imports/Spectral/Setting/Setting.qml
index f963694..3eb48c1 100644
--- a/imports/Spectral/Setting/Setting.qml
+++ b/imports/Spectral/Setting/Setting.qml
@@ -9,4 +9,7 @@ Settings {
     property bool showTray: true
 
     property bool darkTheme
+
+    property bool enableTimelineBackground: true
+    property string timelineBackground
 }
diff --git a/src/utils.h b/src/utils.h
index 1310f00..6ffdb0a 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -45,6 +45,8 @@ QString eventToString(const BaseEventT& evt,
                                          "");
             pos += userPillRegExp.matchedLength();
           }
+          static const QRegExp codePillRegExp("
(.*)
"); + formattedStr.replace(codePillRegExp, "\\1"); return formattedStr; } if (e.hasFileContent()) {