Spectral/qml/Setting.qml

89 lines
2.1 KiB
QML
Raw Normal View History

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
import "component"
2018-07-19 13:02:06 +00:00
Page {
2018-07-20 04:14:02 +00:00
property alias darkTheme: themeSwitch.checked
property alias miniMode: miniModeSwitch.checked
2018-07-20 14:36:19 +00:00
property var connection
2018-07-19 13:02:06 +00:00
header: TabBar {
id: tabBar
width: parent.width
currentIndex: settingView.currentIndex
TabButton {
2018-07-20 14:36:19 +00:00
text: "Account"
2018-07-19 13:02:06 +00:00
}
TabButton {
2018-07-20 14:36:19 +00:00
text: "Appearance"
2018-07-19 13:02:06 +00:00
}
TabButton {
2018-07-20 14:36:19 +00:00
text: "About"
2018-07-20 04:14:02 +00:00
}
}
SwipeView {
id: settingView
currentIndex: tabBar.currentIndex
anchors.fill: parent
Item {
id: accountPage
2018-07-20 14:36:19 +00:00
RowLayout {
height: 80
ImageStatus {
Layout.preferredWidth: height
Layout.fillHeight: true
source: connection ? connection.localUser && connection.localUser.avatarUrl ? "image://mxc/" + connection.localUser.avatarUrl : "" : "qrc:/asset/img/avatar.png"
displayText: connection && connection.localUser.displayName ? connection.localUser.displayName : "N"
opaqueBackground: false
}
ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
Label {
font.pointSize: 24
text: connection ? connection.localUser.displayName : ""
}
Label {
font.pointSize: 16
text: "No text."
}
}
}
2018-07-20 04:14:02 +00:00
}
Item {
id: appearancePage
Column {
Switch {
id: themeSwitch
text: "Dark theme"
}
Switch {
id: miniModeSwitch
text: "Mini Room List"
}
}
}
Item {
id: thirdPage
2018-07-19 13:02:06 +00:00
}
}
}