diff --git a/qml/Contact.qml b/qml/Contact.qml index 4fb5113..6901d75 100644 --- a/qml/Contact.qml +++ b/qml/Contact.qml @@ -9,7 +9,7 @@ Page { id: roomListForm height: parent.height width: 320 - listModel: roomListModel + listModel: contactListModel } DetailForm { diff --git a/qml/component/ImageStatus.qml b/qml/component/ImageStatus.qml index 5bb3950..77f216b 100644 --- a/qml/component/ImageStatus.qml +++ b/qml/component/ImageStatus.qml @@ -3,7 +3,8 @@ import QtQuick.Controls 2.3 import QtGraphicalEffects 1.0 Item { - property bool statusIndicator + property bool statusIndicator: false + property bool opaqueBackground: false property alias source: avatar.source Rectangle { @@ -11,6 +12,7 @@ Item { height: parent.width radius: parent.width / 2 color: "white" + visible: opaqueBackground } Image { @@ -21,6 +23,8 @@ Item { mipmap: true layer.enabled: true fillMode: Image.PreserveAspectCrop + sourceSize.width: parent.width + sourceSize.height: parent.width layer.effect: OpacityMask { maskSource: Item { diff --git a/qml/form/ListForm.qml b/qml/form/ListForm.qml index a241c57..b41b128 100644 --- a/qml/form/ListForm.qml +++ b/qml/form/ListForm.qml @@ -114,7 +114,8 @@ Item { ImageStatus { width: parent.height height: parent.height - source: "image://mxc/" + avatar + source: avatar == null ? "qrc:/asset/img/avatar.png" : "image://mxc/" + avatar + opaqueBackground: true } Column { diff --git a/qml/main.qml b/qml/main.qml index af02e75..7e29b38 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -52,6 +52,7 @@ ApplicationWindow { source: "qrc:/asset/img/avatar.png" anchors.horizontalCenter: parent.horizontalCenter statusIndicator: true + opaqueBackground: false } page: Room { @@ -93,6 +94,7 @@ ApplicationWindow { page: Contact { id: contactPage + contactListModel: roomListModel } }