display several chat logs; style then a bit, make it scrollable

This commit is contained in:
Iuri Matias 2020-05-14 14:24:38 -04:00
parent 9e5f2456cf
commit 531383c207
1 changed files with 125 additions and 58 deletions

View File

@ -236,6 +236,8 @@ SplitView {
Layout.fillHeight: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Component {
id: chatLogViewDelegate
Rectangle {
id: chatBox
height: 140
@ -243,6 +245,7 @@ SplitView {
border.color: "#00000000"
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.fillWidth: true
width: chatLogView.width
Image {
id: chatImage
@ -258,7 +261,7 @@ SplitView {
TextEdit {
id: chatName
text: qsTr("Slushy Welltodo Woodborer")
text: username
anchors.top: parent.top
anchors.topMargin: 22
anchors.left: chatImage.right
@ -266,12 +269,13 @@ SplitView {
font.bold: true
font.pixelSize: 14
readOnly: true
wrapMode: Text.WordWrap
selectByMouse: true
}
TextEdit {
id: chatText
text: qsTr("Im generally against putting too many rules on social interaction because it makes interaction anything but social, but technical specifics on how to get on board or participate in a team are I think generally useful, especially if they prevent maintainers from pasting the same response to every PR / issue.")
text: message
font.family: "Inter"
wrapMode: Text.WordWrap
anchors.right: parent.right
@ -283,13 +287,14 @@ SplitView {
font.pixelSize: 14
readOnly: true
selectByMouse: true
Layout.fillWidth: true
}
TextEdit {
id: chatTime
color: Theme.darkGrey
font.family: "Inter"
text: qsTr("7:30 AM")
text: timestamp
anchors.bottom: parent.bottom
anchors.bottomMargin: 16
anchors.right: parent.right
@ -301,6 +306,68 @@ SplitView {
}
}
// ScrollView {
// id: chatScrollView
// anchors.fill: parent
// Layout.fillWidth: true
// Layout.fillHeight: true
ListView {
id: chatLogView
// anchors.topMargin: 24
anchors.fill: parent
// model: chatLogModel
Layout.fillWidth: true
Layout.fillHeight: true
model: ListModel {
ListElement {
username: "Bill Smith"
message: "First Message - Im generally against putting too many rules on social interaction because it makes interaction anything but social, but technical specifics on how to get on board or participate in a team are I think generally useful, especially if they prevent maintainers from pasting the same response to every PR / issue."
timestamp: "7:30 AM"
}
ListElement {
username: qsTr("Slushy Welltodo Woodborer")
message: "Lorem ipsum ion anything but social, but technical specifics on how to get on board or participate in a team are I think generally useful, especially if they prevent maintainers from pasting the same response to every PR / issue."
timestamp: "7:31 AM"
}
ListElement {
username: "Bill Smith"
message: "Im generally against putting too many rules on social interaction because it makes interaction anything but social, but technical specifics on how to get on board or participate in a team are I think generally useful, especially if they prevent maintainers from pasting the same response to every PR / issue."
timestamp: "7:32 AM"
}
ListElement {
username: qsTr("Slushy Welltodo Woodborer")
message: "Lorem ipsum ion anything but social, but technical specifics on how to get on board or participate in a team are I think generally useful, especially if they prevent maintainers from pasting the same response to every PR / issue."
timestamp: "7:33 AM"
}
ListElement {
username: "Bill Smith"
message: "Im generally against putting too many rules on social interaction because it makes interaction anything but social, but technical specifics on how to get on board or participate in a team are I think generally useful, especially if they prevent maintainers from pasting the same response to every PR / issue."
timestamp: "7:34 AM"
}
ListElement {
username: qsTr("Slushy Welltodo Woodborer")
message: "Lorem ipsum ion anything but social, but technical specifics on how to get on board or participate in a team are I think generally useful, especially if they prevent maintainers from pasting the same response to every PR / issue."
timestamp: "7:35 AM"
}
ListElement {
username: "Bill Smith"
message: "Im generally against putting too many rules on social interaction because it makes interaction anything but social, but technical specifics on how to get on board or participate in a team are I think generally useful, especially if they prevent maintainers from pasting the same response to every PR / issue."
timestamp: "7:36 AM"
}
ListElement {
username: qsTr("Slushy Welltodo Woodborer")
message: "Last Message - Lorem ipsum ion anything but social, but technical specifics on how to get on board or participate in a team are I think generally useful, especially if they prevent maintainers from pasting the same response to every PR / issue."
timestamp: "7:36 AM"
}
}
delegate: chatLogViewDelegate
onCountChanged: {
chatLogView.positionViewAtEnd()
}
}
// }
}
// RowLayout {
// id: separator
// height: 16
@ -435,6 +502,6 @@ SplitView {
}
/*##^##
Designer {
D{i:0;formeditorZoom:0.5;height:770;width:1152}
D{i:0;height:770;width:1152}
}
##^##*/