2018-07-18 14:16:03 +00:00
|
|
|
import QtQuick 2.9
|
2018-07-19 13:02:06 +00:00
|
|
|
import QtQuick.Controls 2.2
|
|
|
|
import QtQuick.Controls.Material 2.2
|
2018-07-20 14:36:19 +00:00
|
|
|
import QtQuick.Layouts 1.3
|
2018-08-24 05:25:41 +00:00
|
|
|
import Matrique.Settings 0.1
|
2018-07-20 14:36:19 +00:00
|
|
|
|
|
|
|
import "component"
|
2018-07-22 12:31:52 +00:00
|
|
|
import "form"
|
2018-07-18 14:16:03 +00:00
|
|
|
|
2018-07-19 13:02:06 +00:00
|
|
|
Page {
|
2018-07-20 14:36:19 +00:00
|
|
|
property var connection
|
2018-07-19 13:02:06 +00:00
|
|
|
|
2018-08-24 05:25:41 +00:00
|
|
|
Page {
|
2018-07-22 12:31:52 +00:00
|
|
|
id: accountForm
|
|
|
|
parent: null
|
2018-08-24 05:25:41 +00:00
|
|
|
|
|
|
|
padding: 64
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
RowLayout {
|
|
|
|
Layout.preferredHeight: 60
|
|
|
|
|
|
|
|
ImageStatus {
|
|
|
|
Layout.preferredWidth: height
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
source: matriqueController.isLogin ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png"
|
|
|
|
displayText: matriqueController.isLogin && connection.localUser.displayName ? connection.localUser.displayName : ""
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
|
|
|
|
Label {
|
|
|
|
font.pointSize: 18
|
|
|
|
text: matriqueController.isLogin ? connection.localUser.displayName : ""
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
|
|
|
font.pointSize: 12
|
|
|
|
text: matriqueController.isLogin ? connection.localUser.id : ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Button {
|
|
|
|
text: "Logout"
|
|
|
|
highlighted: true
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
matriqueController.logout()
|
|
|
|
Qt.quit()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-07-20 04:14:02 +00:00
|
|
|
}
|
|
|
|
|
2018-08-24 05:25:41 +00:00
|
|
|
Page {
|
2018-08-10 10:58:53 +00:00
|
|
|
id: generalForm
|
|
|
|
parent: null
|
2018-08-24 05:25:41 +00:00
|
|
|
Column {
|
|
|
|
Switch {
|
|
|
|
text: "Lazy load at initial sync"
|
|
|
|
checked: MSettings.lazyLoad
|
|
|
|
onCheckedChanged: MSettings.lazyLoad = checked
|
|
|
|
}
|
2018-09-02 23:13:39 +00:00
|
|
|
|
2018-08-24 05:25:41 +00:00
|
|
|
Switch {
|
|
|
|
text: "Use RichText instead of StyledText"
|
|
|
|
checked: MSettings.richText
|
|
|
|
onCheckedChanged: MSettings.richText = checked
|
|
|
|
}
|
2018-09-02 23:13:39 +00:00
|
|
|
|
2018-08-24 05:25:41 +00:00
|
|
|
Switch {
|
|
|
|
text: "Use press and hold instead of right click"
|
|
|
|
checked: MSettings.pressAndHold
|
|
|
|
onCheckedChanged: MSettings.pressAndHold = checked
|
|
|
|
}
|
|
|
|
}
|
2018-08-10 10:58:53 +00:00
|
|
|
}
|
|
|
|
|
2018-08-24 05:25:41 +00:00
|
|
|
Page {
|
2018-07-22 12:31:52 +00:00
|
|
|
id: appearanceForm
|
|
|
|
parent: null
|
2018-08-24 05:25:41 +00:00
|
|
|
Column {
|
|
|
|
Switch {
|
|
|
|
text: "Dark theme"
|
|
|
|
checked: MSettings.darkTheme
|
|
|
|
onCheckedChanged: MSettings.darkTheme = checked
|
|
|
|
}
|
|
|
|
|
|
|
|
Switch {
|
|
|
|
text: "Mini Room List"
|
|
|
|
checked: MSettings.miniMode
|
|
|
|
onCheckedChanged: MSettings.miniMode = checked
|
|
|
|
}
|
2018-09-02 23:13:39 +00:00
|
|
|
|
|
|
|
Switch {
|
|
|
|
text: "Rearrange rooms by activity"
|
|
|
|
checked: MSettings.rearrangeByActivity
|
|
|
|
onCheckedChanged: MSettings.rearrangeByActivity = checked
|
|
|
|
}
|
2018-08-24 05:25:41 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Page {
|
|
|
|
id: aboutForm
|
|
|
|
parent: null
|
|
|
|
|
|
|
|
padding: 64
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
spacing: 16
|
|
|
|
Image {
|
|
|
|
Layout.preferredWidth: 64
|
|
|
|
Layout.preferredHeight: 64
|
|
|
|
|
|
|
|
source: "qrc:/asset/img/icon.png"
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
text: "Matrique, an IM client for the Matrix protocol."
|
|
|
|
}
|
|
|
|
Label {
|
|
|
|
text: "Released under GNU General Public License, version 3."
|
|
|
|
}
|
|
|
|
}
|
2018-07-22 12:31:52 +00:00
|
|
|
}
|
2018-07-20 04:14:02 +00:00
|
|
|
|
2018-07-22 12:31:52 +00:00
|
|
|
RowLayout {
|
|
|
|
ColumnLayout {
|
|
|
|
Layout.preferredWidth: 240
|
|
|
|
Layout.fillHeight: true
|
2018-07-20 04:14:02 +00:00
|
|
|
|
2018-07-22 12:31:52 +00:00
|
|
|
spacing: 0
|
2018-07-20 14:36:19 +00:00
|
|
|
|
2018-07-22 12:31:52 +00:00
|
|
|
ItemDelegate {
|
|
|
|
Layout.fillWidth: true
|
2018-07-20 14:36:19 +00:00
|
|
|
|
2018-07-22 12:31:52 +00:00
|
|
|
text: "Account"
|
|
|
|
onClicked: pushToStack(accountForm)
|
|
|
|
}
|
2018-07-20 14:36:19 +00:00
|
|
|
|
2018-08-10 10:58:53 +00:00
|
|
|
ItemDelegate {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
text: "General"
|
|
|
|
onClicked: pushToStack(generalForm)
|
|
|
|
}
|
|
|
|
|
2018-07-22 12:31:52 +00:00
|
|
|
ItemDelegate {
|
|
|
|
Layout.fillWidth: true
|
2018-07-20 14:36:19 +00:00
|
|
|
|
2018-07-22 12:31:52 +00:00
|
|
|
text: "Appearance"
|
|
|
|
onClicked: pushToStack(appearanceForm)
|
|
|
|
}
|
2018-07-20 14:36:19 +00:00
|
|
|
|
2018-07-22 12:31:52 +00:00
|
|
|
ItemDelegate {
|
|
|
|
Layout.fillWidth: true
|
2018-07-20 14:36:19 +00:00
|
|
|
|
2018-07-22 12:31:52 +00:00
|
|
|
text: "About"
|
2018-08-24 05:25:41 +00:00
|
|
|
onClicked: pushToStack(aboutForm)
|
2018-07-20 14:36:19 +00:00
|
|
|
}
|
2018-07-20 04:14:02 +00:00
|
|
|
}
|
|
|
|
|
2018-07-22 12:31:52 +00:00
|
|
|
StackView {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
2018-07-20 04:14:02 +00:00
|
|
|
|
2018-07-22 12:31:52 +00:00
|
|
|
id: settingStackView
|
2018-07-20 04:14:02 +00:00
|
|
|
}
|
2018-07-22 12:31:52 +00:00
|
|
|
}
|
2018-07-20 04:14:02 +00:00
|
|
|
|
2018-07-22 12:31:52 +00:00
|
|
|
function pushToStack(item) {
|
|
|
|
settingStackView.clear()
|
|
|
|
settingStackView.push(item)
|
2018-07-19 13:02:06 +00:00
|
|
|
}
|
2018-07-18 14:16:03 +00:00
|
|
|
}
|