From b0299596abf3a1b4ae3ee8332a66d7629edf5ffea9d826e31f90e5656021d918 Mon Sep 17 00:00:00 2001 From: Daniel Stoppek Date: Wed, 13 Nov 2024 12:50:27 +0100 Subject: [PATCH] Changed CustomerTable --- gui/AddCustomer.qml | 22 ++-------------------- gui/CustomerTables.qml | 35 ++++++++++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 25 deletions(-) diff --git a/gui/AddCustomer.qml b/gui/AddCustomer.qml index afdfefe..375f07a 100644 --- a/gui/AddCustomer.qml +++ b/gui/AddCustomer.qml @@ -253,28 +253,10 @@ ColumnLayout Layout.fillWidth: true } - Label - { - text: qsTr("Info") - Layout.alignment: Qt.AlignRight | Qt.AlignTop - } - ScrollView - { - Layout.fillWidth: true - Layout.preferredHeight: 100 - TextArea - { - id: contactInfo - background: Rectangle - { - color: contactInfo.palette.base - border.color: contactInfo.activeFocus? contactInfo.palette.highlight: contactInfo.palette.base - } - } - } + Item { - height: birthday.height + height: birthday.height + customerInfo.height } } } diff --git a/gui/CustomerTables.qml b/gui/CustomerTables.qml index 4cf81f6..1b37d12 100644 --- a/gui/CustomerTables.qml +++ b/gui/CustomerTables.qml @@ -7,6 +7,7 @@ Item { anchors.fill: parent //color: "lightslategrey" property var availableFilters: ["Name", "Adresse", "PLZ", "Ort"] + id: test SearchBar { @@ -71,9 +72,27 @@ Item { { id: horizontalHeader Layout.fillWidth: true + implicitHeight: 40 movableColumns: true syncView: testTable + delegate: Rectangle { + color: addBusinessBtn.palette.alternateBase + border.color: addBusinessBtn.palette.base + implicitHeight: 40 + Layout.fillWidth: true + implicitWidth: 1 + Text + { + text: model.display + elide: Text.ElideRight + width: parent.width + height: parent.height + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + color: addBusinessBtn.palette.text + } + } } TableView @@ -135,16 +154,18 @@ Item { implicitHeight: 25 //color: selected? "lightblue": palette.base color: selected - ? "lightblue" //palette.highlight + ? addBusinessBtn.palette.highlight //palette.highlight : (testTable.alternatingRows && row % 2 !== 0 - ? "lightslategray" // palette.base - : "lightsteelblue") //palette.alternateBase) + ? addBusinessBtn.palette.base // palette.base + : addBusinessBtn.palette.alternateBase) //palette.alternateBase) Text { //Layout.fillWidth: true text: model.display elide: Text.ElideRight + width: parent.width + color: addBusinessBtn.palette.text } MouseArea @@ -159,9 +180,13 @@ Item { onClicked: { dbm.onRowClicked(row) + + + + } + onEntered: + { testTable.selectionModel.select(testTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows) - - } } }