Commit 93667a07 authored by Black Hat's avatar Black Hat

Add current room name & topic.

parent 307ae14e
......@@ -39,6 +39,8 @@ Page {
Layout.fillWidth: true
Layout.fillHeight: true
currentRoom: roomListForm.currentItem
}
}
}
......@@ -10,7 +10,7 @@ import "qrc:/qml/component"
Item {
property alias listModel: delegateModel.model
property alias currentIndex: listView.currentIndex
property alias currentItem: listView.currentItem
readonly property bool mini: width <= 80 // Used as an indicator of whether the listform should be displayed as "Mini mode".
DelegateModel {
......@@ -23,6 +23,8 @@ Item {
filterOnGroup: "filterGroup"
delegate: ItemDelegate {
property variant myData: model
width: parent.width
height: 80
onClicked: listView.currentIndex = index
......@@ -35,7 +37,7 @@ Item {
ImageStatus {
width: parent.height
height: parent.height
source: avatar == null || avatar == "" ? "qrc:/qml/asset/img/avatar.png" : "image://mxc/" + avatar
source: model.avatar == null || model.avatar == "" ? "qrc:/qml/asset/img/avatar.png" : "image://mxc/" + model.avatar
opaqueBackground: true
}
......@@ -45,7 +47,7 @@ Item {
Text {
width: parent.width
text: name === "" ? id : name
text: model.name === "" ? id : model.name
color: "#424242"
font.pointSize: 16
elide: Text.ElideRight
......@@ -53,7 +55,7 @@ Item {
}
Text {
width: parent.width
text: topic === "" ? "No topic yet." : topic
text: model.topic === "" ? "No topic yet." : model.topic
color: "#424242"
elide: Text.ElideRight
wrapMode: Text.NoWrap
......
......@@ -6,7 +6,7 @@ import QtGraphicalEffects 1.0
import "qrc:/qml/component"
Item {
property var currentRoom: null
property Item currentRoom: null
ColumnLayout {
anchors.fill: parent
......@@ -30,20 +30,20 @@ Item {
ImageStatus {
width: parent.height
height: parent.height
source: "qrc:/qml/asset/img/avatar.png"
source: "image://mxc/" + currentRoom.myData.avatar
}
Column {
height: parent.height
Text {
text: "Astolfo"
text: currentRoom.myData.name
font.pointSize: 18
color: "#424242"
elide: Text.ElideRight
wrapMode: Text.NoWrap
}
Text {
text: "Rider of Black"
text: currentRoom.myData.topic
color: "#424242"
elide: Text.ElideRight
wrapMode: Text.NoWrap
......
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