Alisa/native/MainPage.qml
2024-07-11 14:18:39 +02:00

97 lines
2.2 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: ""
signal logout()
Rectangle {
id: s1
anchors {
top: parent.top
left: parent.left
right: parent.right
}
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("Logout")
onClicked: {
logout();
}
}
}
Rectangle{
id: s2
anchors {
top: s1.bottom
left: parent.left
right: parent.right
bottom: parent.bottom
}
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
}
}
}
}
}