Have different background for events and messages

This commit is contained in:
miruka 2019-07-02 23:48:36 -04:00
parent c8347647b9
commit 441c9d0c1d
3 changed files with 5 additions and 8 deletions

View File

@ -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 {

View File

@ -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(

View File

@ -17,7 +17,6 @@ Column {
}
function isMessage(item) {
item = item || model
return /^RoomMessage($|[A-Z])/.test(item.eventType)
}