From b88cc6964da9a27b143f80a80af4717fc900247c Mon Sep 17 00:00:00 2001 From: Black Hat Date: Fri, 2 Mar 2018 23:05:32 +0800 Subject: [PATCH] Rename components. --- qml/Contact.qml | 20 +++++++++++++++++++ qml/Room.qml | 2 +- qml/component/ImageStatus.qml | 3 +++ .../{RoomDetailForm.qml => DetailForm.qml} | 0 qml/form/{RoomListForm.qml => ListForm.qml} | 0 qml/main.qml | 16 +++++++++++++++ res.qrc | 5 +++-- 7 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 qml/Contact.qml rename qml/form/{RoomDetailForm.qml => DetailForm.qml} (100%) rename qml/form/{RoomListForm.qml => ListForm.qml} (100%) diff --git a/qml/Contact.qml b/qml/Contact.qml new file mode 100644 index 0000000..4fb5113 --- /dev/null +++ b/qml/Contact.qml @@ -0,0 +1,20 @@ +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import "qrc:/qml/form" + +Page { + property var contactListModel + + ListForm { + id: roomListForm + height: parent.height + width: 320 + listModel: roomListModel + } + + DetailForm { + id: detailForm + anchors.fill: parent + anchors.leftMargin: roomListForm.width + } +} diff --git a/qml/Room.qml b/qml/Room.qml index 2580cc1..1602757 100644 --- a/qml/Room.qml +++ b/qml/Room.qml @@ -5,7 +5,7 @@ import "qrc:/qml/form" Page { property var roomListModel - RoomListForm { + ListForm { id: roomListForm height: parent.height width: 320 diff --git a/qml/component/ImageStatus.qml b/qml/component/ImageStatus.qml index d38cb5a..3619d9e 100644 --- a/qml/component/ImageStatus.qml +++ b/qml/component/ImageStatus.qml @@ -3,6 +3,8 @@ import QtQuick.Controls 2.3 import QtGraphicalEffects 1.0 Image { + property bool statusIndicator + id: avatar mipmap: true @@ -30,5 +32,6 @@ Image { color: "transparent" border.color: "#4caf50" border.width: 4 + visible: statusIndicator } } diff --git a/qml/form/RoomDetailForm.qml b/qml/form/DetailForm.qml similarity index 100% rename from qml/form/RoomDetailForm.qml rename to qml/form/DetailForm.qml diff --git a/qml/form/RoomListForm.qml b/qml/form/ListForm.qml similarity index 100% rename from qml/form/RoomListForm.qml rename to qml/form/ListForm.qml diff --git a/qml/main.qml b/qml/main.qml index 493c472..af02e75 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -51,6 +51,7 @@ ApplicationWindow { height: parent.width source: "qrc:/asset/img/avatar.png" anchors.horizontalCenter: parent.horizontalCenter + statusIndicator: true } page: Room { @@ -80,6 +81,21 @@ ApplicationWindow { } } + ButtonDelegate { + contentItem: Text { + text: "\ue5d2" + font.pointSize: 16 + font.family: materialFont.name + color: "white" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + + page: Contact { + id: contactPage + } + } + ButtonDelegate { contentItem: Text { text: "\ue8b8" diff --git a/res.qrc b/res.qrc index cced5d8..3101981 100644 --- a/res.qrc +++ b/res.qrc @@ -11,8 +11,9 @@ qml/component/ImageStatus.qml qml/component/SideNav.qml qml/form/RoomForm.qml - qml/form/RoomListForm.qml qml/Room.qml - qml/form/RoomDetailForm.qml + qml/form/DetailForm.qml + qml/form/ListForm.qml + qml/Contact.qml