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 } 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: loginScreenB anchors { bottom: parent.bottom left: parent.left } text: qsTr("Login Screen") onClicked: { logout(); } } }