130 lines
3.1 KiB
QML
130 lines
3.1 KiB
QML
import QtQuick 2.15
|
|
import QtQuick.Window 2.15
|
|
import QtQuick.Layouts 2.15
|
|
import QtQuick.Controls 2.15
|
|
|
|
Rectangle {
|
|
SystemPalette { id: activeColors; colorGroup: SystemPalette.Active }
|
|
SystemPalette { id: inactiveColors; colorGroup: SystemPalette.Inactive }
|
|
SystemPalette { id: disabledColors; colorGroup: SystemPalette.Disabled }
|
|
|
|
function getColors() {
|
|
return root.active ? activeColors : inactiveColors;
|
|
}
|
|
|
|
property string authToken: ""
|
|
|
|
Rectangle {
|
|
id: s1
|
|
anchors {
|
|
top: parent.top
|
|
left: parent.left
|
|
right: parent.right
|
|
}
|
|
radius: 0
|
|
height: 50
|
|
color: getColors().midlight
|
|
|
|
TextField {
|
|
anchors{
|
|
verticalCenter: s1.verticalCenter
|
|
rightMargin: 5
|
|
right: loginB.left
|
|
}
|
|
|
|
placeholderText: qsTr("Search")
|
|
|
|
}
|
|
|
|
Button{
|
|
id: loginB
|
|
anchors{
|
|
verticalCenter: s1.verticalCenter
|
|
rightMargin: 10
|
|
right: s1.right
|
|
}
|
|
text: qsTr("Login")
|
|
|
|
onClicked: {
|
|
var component = Qt.createComponent("LoginScreen.qml")
|
|
var window = component.createObject(root)
|
|
window.show()
|
|
}
|
|
}
|
|
}
|
|
|
|
Rectangle{
|
|
id: s2
|
|
anchors {
|
|
top: s1.bottom
|
|
left: parent.left
|
|
right: parent.right
|
|
bottom: parent.bottom
|
|
}
|
|
radius: 0
|
|
color: getColors().window
|
|
|
|
TableView {
|
|
anchors {
|
|
topMargin: 5
|
|
fill: s2
|
|
}
|
|
columnSpacing: 0
|
|
rowSpacing: 1
|
|
clip: true
|
|
boundsBehavior: Flickable.StopAtBounds
|
|
|
|
model: Data {}
|
|
delegate: Rectangle {
|
|
id: r
|
|
anchors{
|
|
}
|
|
color: getColors().base
|
|
implicitWidth: 100
|
|
implicitHeight: 50
|
|
border.width: 0
|
|
|
|
Text {
|
|
anchors {
|
|
horizontalCenter: r.horizontalCenter
|
|
verticalCenter: r.verticalCenter
|
|
}
|
|
text: display
|
|
color: getColors().text
|
|
anchors.centerIn: parent
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
Button {
|
|
id: testB
|
|
anchors {
|
|
bottom: parent.bottom
|
|
left: parent.left
|
|
}
|
|
text: qsTr("Test Window")
|
|
|
|
onClicked: {
|
|
var component = Qt.createComponent("Test.qml")
|
|
var window = component.createObject(root)
|
|
window.show()
|
|
}
|
|
}
|
|
Button {
|
|
id: loginScreenB
|
|
anchors {
|
|
left: testB.right
|
|
bottom: parent.bottom
|
|
|
|
|
|
}
|
|
text: qsTr("Login Screen")
|
|
onClicked: {
|
|
var component = Qt.createComponent("LoginScreen.qml")
|
|
var window = component.createObject(root)
|
|
window.show()
|
|
}
|
|
}
|
|
}
|