From 441c9d0c1d2142f3dba918f55edecdaa263bf8a0 Mon Sep 17 00:00:00 2001 From: miruka Date: Tue, 2 Jul 2019 23:48:36 -0400 Subject: [PATCH] Have different background for events and messages --- src/qml/Base/HStyle.qml | 9 +++------ src/qml/Chat/Timeline/EventContent.qml | 3 ++- src/qml/Chat/Timeline/EventDelegate.qml | 1 - 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/qml/Base/HStyle.qml b/src/qml/Base/HStyle.qml index 293a3948..b222ad5f 100644 --- a/src/qml/Base/HStyle.qml +++ b/src/qml/Base/HStyle.qml @@ -25,8 +25,8 @@ QtObject { property int radius: 5 readonly property QtObject colors: QtObject { - property color background0: Qt.hsla(0, 0, 0.8, 0.5) - property color background1: Qt.hsla(0, 0, 0.8, 0.7) + property color background0: Qt.hsla(0, 0, 0.9, 0.5) + property color background1: Qt.hsla(0, 0, 0.9, 0.7) property color foreground: "black" property color foregroundDim: Qt.hsla(0, 0, 0.2, 1) property color foregroundError: Qt.hsla(0.95, 0.64, 0.32, 1) @@ -79,10 +79,7 @@ QtObject { } readonly property QtObject event: QtObject { - property color background: colors.background1 - property real saturation: 0.22 - property real lightness: 0.24 - property color date: colors.foregroundDim + property color background: Qt.darker(colors.background1, 1.1) } readonly property QtObject daybreak: QtObject { diff --git a/src/qml/Chat/Timeline/EventContent.qml b/src/qml/Chat/Timeline/EventContent.qml index b55ae6db..606cb553 100644 --- a/src/qml/Chat/Timeline/EventContent.qml +++ b/src/qml/Chat/Timeline/EventContent.qml @@ -22,7 +22,8 @@ Row { } Rectangle { - color: HStyle.chat.message.background + color: isMessage(model) ? + HStyle.chat.message.background : HStyle.chat.event.background //width: nameLabel.implicitWidth width: Math.min( diff --git a/src/qml/Chat/Timeline/EventDelegate.qml b/src/qml/Chat/Timeline/EventDelegate.qml index 9aaaf51a..82e0a0fb 100644 --- a/src/qml/Chat/Timeline/EventDelegate.qml +++ b/src/qml/Chat/Timeline/EventDelegate.qml @@ -17,7 +17,6 @@ Column { } function isMessage(item) { - item = item || model return /^RoomMessage($|[A-Z])/.test(item.eventType) }