Have different background for events and messages
This commit is contained in:
parent
c8347647b9
commit
441c9d0c1d
@ -25,8 +25,8 @@ QtObject {
|
|||||||
property int radius: 5
|
property int radius: 5
|
||||||
|
|
||||||
readonly property QtObject colors: QtObject {
|
readonly property QtObject colors: QtObject {
|
||||||
property color background0: Qt.hsla(0, 0, 0.8, 0.5)
|
property color background0: Qt.hsla(0, 0, 0.9, 0.5)
|
||||||
property color background1: Qt.hsla(0, 0, 0.8, 0.7)
|
property color background1: Qt.hsla(0, 0, 0.9, 0.7)
|
||||||
property color foreground: "black"
|
property color foreground: "black"
|
||||||
property color foregroundDim: Qt.hsla(0, 0, 0.2, 1)
|
property color foregroundDim: Qt.hsla(0, 0, 0.2, 1)
|
||||||
property color foregroundError: Qt.hsla(0.95, 0.64, 0.32, 1)
|
property color foregroundError: Qt.hsla(0.95, 0.64, 0.32, 1)
|
||||||
@ -79,10 +79,7 @@ QtObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
readonly property QtObject event: QtObject {
|
readonly property QtObject event: QtObject {
|
||||||
property color background: colors.background1
|
property color background: Qt.darker(colors.background1, 1.1)
|
||||||
property real saturation: 0.22
|
|
||||||
property real lightness: 0.24
|
|
||||||
property color date: colors.foregroundDim
|
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property QtObject daybreak: QtObject {
|
readonly property QtObject daybreak: QtObject {
|
||||||
|
@ -22,7 +22,8 @@ Row {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: HStyle.chat.message.background
|
color: isMessage(model) ?
|
||||||
|
HStyle.chat.message.background : HStyle.chat.event.background
|
||||||
|
|
||||||
//width: nameLabel.implicitWidth
|
//width: nameLabel.implicitWidth
|
||||||
width: Math.min(
|
width: Math.min(
|
||||||
|
@ -17,7 +17,6 @@ Column {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isMessage(item) {
|
function isMessage(item) {
|
||||||
item = item || model
|
|
||||||
return /^RoomMessage($|[A-Z])/.test(item.eventType)
|
return /^RoomMessage($|[A-Z])/.test(item.eventType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user