Commit 307ae14e authored by Black Hat's avatar Black Hat

Improve chat interface.

parent 09ee28b0
......@@ -53,8 +53,12 @@ Item {
}
ListView {
id: messageListView
Layout.fillWidth: true
Layout.fillHeight: true
Layout.leftMargin: 16
Layout.rightMargin: 16
displayMarginBeginning: 40
displayMarginEnd: 40
verticalLayoutDirection: ListView.BottomToTop
......@@ -63,6 +67,9 @@ Item {
delegate: Row {
readonly property bool sentByMe: index % 2 == 0
id: messageRow
height: 40
anchors.right: sentByMe ? parent.right : undefined
spacing: 6
......@@ -75,19 +82,23 @@ Item {
}
Rectangle {
width: 80
height: 40
color: sentByMe ? "lightgrey" : "steelblue"
width: Math.min(messageText.implicitWidth + 24,
messageListView.width - (!sentByMe ? avatar.width + messageRow.spacing : 0))
height: parent.height
color: sentByMe ? "lightgrey" : Material.accent
Label {
anchors.centerIn: parent
id: messageText
text: index
color: sentByMe ? "black" : "white"
anchors.fill: parent
anchors.margins: 12
wrapMode: Label.Wrap
}
}
}
ScrollBar.vertical: ScrollBar {}
ScrollBar.vertical: ScrollBar { anchors.left: messageListView.right }
}
Pane {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment