2018-02-23 14:39:14 +00:00
|
|
|
import QtQuick 2.10
|
|
|
|
import QtQuick.Controls 2.3
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import QtQuick.Controls.Material 2.2
|
|
|
|
import QtGraphicalEffects 1.0
|
|
|
|
import Qt.labs.settings 1.0
|
|
|
|
|
|
|
|
import "qrc:/qml/component"
|
|
|
|
import "qrc:/qml/form"
|
|
|
|
|
|
|
|
import Matrique 0.1
|
|
|
|
|
|
|
|
ApplicationWindow {
|
|
|
|
id: window
|
|
|
|
visible: true
|
|
|
|
width: 960
|
|
|
|
height: 640
|
|
|
|
title: qsTr("Matrique")
|
|
|
|
|
2018-02-27 11:07:50 +00:00
|
|
|
Controller {
|
2018-03-02 08:56:36 +00:00
|
|
|
id: matrixController
|
|
|
|
connection: m_connection
|
2018-02-26 12:41:20 +00:00
|
|
|
}
|
2018-02-23 14:39:14 +00:00
|
|
|
|
2018-03-02 11:58:55 +00:00
|
|
|
RoomListModel {
|
|
|
|
id: roomListModel
|
|
|
|
connection: m_connection
|
|
|
|
}
|
2018-02-23 14:39:14 +00:00
|
|
|
|
2018-03-02 11:58:55 +00:00
|
|
|
Settings {
|
|
|
|
id: settings
|
|
|
|
|
|
|
|
property alias userID: matrixController.userID
|
|
|
|
property alias token: matrixController.token
|
|
|
|
}
|
2018-02-23 14:39:14 +00:00
|
|
|
|
|
|
|
FontLoader { id: materialFont; source: "qrc:/asset/font/material.ttf" }
|
|
|
|
|
|
|
|
SideNav {
|
|
|
|
id: sideNav
|
|
|
|
width: 80
|
|
|
|
height: window.height
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
anchors.fill: parent
|
|
|
|
spacing: 0
|
|
|
|
|
|
|
|
ButtonDelegate {
|
|
|
|
contentItem: ImageStatus {
|
|
|
|
width: parent.width
|
|
|
|
height: parent.width
|
|
|
|
source: "qrc:/asset/img/avatar.png"
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2018-03-02 15:05:32 +00:00
|
|
|
statusIndicator: true
|
2018-02-23 14:39:14 +00:00
|
|
|
}
|
2018-03-01 11:15:04 +00:00
|
|
|
|
|
|
|
page: Room {
|
|
|
|
id: roomPage
|
2018-03-02 11:58:55 +00:00
|
|
|
roomListModel: roomListModel
|
2018-03-01 11:15:04 +00:00
|
|
|
}
|
2018-02-23 14:39:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
color: "transparent"
|
|
|
|
Layout.fillHeight: true
|
|
|
|
}
|
|
|
|
|
|
|
|
ButtonDelegate {
|
|
|
|
contentItem: Text {
|
|
|
|
text: "\ue853"
|
|
|
|
font.pointSize: 16
|
|
|
|
font.family: materialFont.name
|
|
|
|
color: "white"
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
|
2018-03-01 11:15:04 +00:00
|
|
|
page: Login {
|
|
|
|
id: loginPage
|
2018-03-02 08:56:36 +00:00
|
|
|
controller: matrixController
|
2018-03-01 11:15:04 +00:00
|
|
|
}
|
2018-03-02 15:05:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ButtonDelegate {
|
|
|
|
contentItem: Text {
|
|
|
|
text: "\ue5d2"
|
|
|
|
font.pointSize: 16
|
|
|
|
font.family: materialFont.name
|
|
|
|
color: "white"
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
|
|
|
|
page: Contact {
|
|
|
|
id: contactPage
|
|
|
|
}
|
2018-03-01 11:15:04 +00:00
|
|
|
}
|
2018-02-23 14:39:14 +00:00
|
|
|
|
|
|
|
ButtonDelegate {
|
|
|
|
contentItem: Text {
|
|
|
|
text: "\ue8b8"
|
|
|
|
font.pointSize: 16
|
|
|
|
font.family: materialFont.name
|
|
|
|
color: "white"
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
2018-03-01 11:15:04 +00:00
|
|
|
|
|
|
|
page: Setting {
|
|
|
|
|
|
|
|
}
|
2018-02-23 14:39:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
ButtonDelegate {
|
|
|
|
contentItem: Text {
|
|
|
|
text: "\ue879"
|
|
|
|
font.pointSize: 16
|
|
|
|
font.family: materialFont.name
|
|
|
|
color: "white"
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
}
|
|
|
|
|
|
|
|
onClicked: Qt.quit()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-01 11:15:04 +00:00
|
|
|
StackView {
|
|
|
|
id: stackView
|
2018-02-23 14:39:14 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
anchors.leftMargin: sideNav.width
|
2018-03-01 11:15:04 +00:00
|
|
|
initialItem: roomPage
|
2018-02-23 14:39:14 +00:00
|
|
|
}
|
|
|
|
}
|