Commit 06b0ce83 authored by Black Hat's avatar Black Hat

More currentroom fune tunings.

parent 93667a07
......@@ -8,139 +8,167 @@ import "qrc:/qml/component"
Item {
property Item currentRoom: null
ColumnLayout {
Pane {
anchors.fill: parent
spacing: 0
padding: 0
Pane {
z: 10
padding: 16
Layout.fillWidth: true
Layout.preferredHeight: 80
background: Rectangle {
background: Item {
anchors.fill: parent
visible: currentRoom == null
Rectangle {
anchors.fill: parent
color: "#eaeaea"
}
Row {
anchors.fill: parent
spacing: 16
Text {
z: 10
text: "Please choose a room."
color: "#424242"
anchors.centerIn: parent
visible: listView.count === 0
}
}
ImageStatus {
width: parent.height
height: parent.height
source: "image://mxc/" + currentRoom.myData.avatar
ColumnLayout {
anchors.fill: parent
spacing: 0
visible: currentRoom != null
Pane {
z: 10
padding: 16
Layout.fillWidth: true
Layout.preferredHeight: 80
background: Rectangle {
color: "#eaeaea"
}
Column {
height: parent.height
Text {
text: currentRoom.myData.name
font.pointSize: 18
color: "#424242"
elide: Text.ElideRight
wrapMode: Text.NoWrap
RowLayout {
anchors.fill: parent
spacing: 16
ImageStatus {
Layout.preferredWidth: parent.height
Layout.fillHeight: true
source: "image://mxc/" + currentRoom.myData.avatar
}
Text {
text: currentRoom.myData.topic
color: "#424242"
elide: Text.ElideRight
wrapMode: Text.NoWrap
ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
Text {
Layout.fillWidth: true
text: currentRoom.myData.name
font.pointSize: 18
color: "#424242"
elide: Text.ElideRight
wrapMode: Text.NoWrap
}
Text {
Layout.fillWidth: true
text: currentRoom.myData.topic
color: "#424242"
elide: Text.ElideRight
wrapMode: Text.NoWrap
}
}
}
}
}
ListView {
id: messageListView
Layout.fillWidth: true
Layout.fillHeight: true
Layout.leftMargin: 16
Layout.rightMargin: 16
displayMarginBeginning: 40
displayMarginEnd: 40
verticalLayoutDirection: ListView.BottomToTop
spacing: 12
model: 10
delegate: Row {
readonly property bool sentByMe: index % 2 == 0
id: messageRow
height: 40
anchors.right: sentByMe ? parent.right : undefined
spacing: 6
Rectangle {
id: avatar
width: height
height: parent.height
color: "grey"
visible: !sentByMe
}
ListView {
id: messageListView
Layout.fillWidth: true
Layout.fillHeight: true
Layout.leftMargin: 16
Layout.rightMargin: 16
displayMarginBeginning: 40
displayMarginEnd: 40
verticalLayoutDirection: ListView.BottomToTop
spacing: 12
model: 10
delegate: Row {
readonly property bool sentByMe: index % 2 == 0
id: messageRow
height: 40
anchors.right: sentByMe ? parent.right : undefined
spacing: 6
Rectangle {
id: avatar
width: height
height: parent.height
color: "grey"
visible: !sentByMe
}
Rectangle {
width: Math.min(messageText.implicitWidth + 24,
messageListView.width - (!sentByMe ? avatar.width + messageRow.spacing : 0))
height: parent.height
color: sentByMe ? "lightgrey" : Material.accent
Label {
id: messageText
text: index
color: sentByMe ? "black" : "white"
anchors.fill: parent
anchors.margins: 12
wrapMode: Label.Wrap
Rectangle {
width: Math.min(messageText.implicitWidth + 24,
messageListView.width - (!sentByMe ? avatar.width + messageRow.spacing : 0))
height: parent.height
color: sentByMe ? "lightgrey" : Material.accent
Label {
id: messageText
text: index
color: sentByMe ? "black" : "white"
anchors.fill: parent
anchors.margins: 12
wrapMode: Label.Wrap
}
}
}
}
ScrollBar.vertical: ScrollBar { anchors.left: messageListView.right }
}
ScrollBar.vertical: ScrollBar { anchors.left: messageListView.right }
}
Pane {
z: 10
padding: 16
Pane {
z: 10
padding: 16
Layout.fillWidth: true
Layout.preferredHeight: 80
Layout.fillWidth: true
Layout.preferredHeight: 80
RowLayout {
anchors.fill: parent
spacing: 0
RowLayout {
anchors.fill: parent
spacing: 0
ItemDelegate {
Layout.preferredWidth: height
Layout.fillHeight: true
ItemDelegate {
Layout.preferredWidth: height
Layout.fillHeight: true
contentItem: MaterialIcon { icon: "\ue226"; color: "black" }
}
contentItem: MaterialIcon { icon: "\ue226"; color: "black" }
}
TextField {
Layout.fillWidth: true
Layout.fillHeight: true
placeholderText: "Send a Message"
leftPadding: 16
topPadding: 0
bottomPadding: 0
selectByMouse: true
background: Rectangle {
color: "#eaeaea"
TextField {
Layout.fillWidth: true
Layout.fillHeight: true
placeholderText: "Send a Message"
leftPadding: 16
topPadding: 0
bottomPadding: 0
selectByMouse: true
background: Rectangle {
color: "#eaeaea"
}
}
}
ItemDelegate {
Layout.preferredWidth: height
Layout.fillHeight: true
ItemDelegate {
Layout.preferredWidth: height
Layout.fillHeight: true
contentItem: MaterialIcon { icon: "\ue24e"; color: "black" }
contentItem: MaterialIcon { icon: "\ue24e"; color: "black" }
background: Rectangle {
color: "#eaeaea"
background: Rectangle {
color: "#eaeaea"
}
}
}
}
......
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