diff --git a/Gui/AddNewOffer.qml b/Gui/AddNewOffer.qml new file mode 100644 index 0000000..798b457 --- /dev/null +++ b/Gui/AddNewOffer.qml @@ -0,0 +1,213 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +GridLayout +{ + id: newObject + + columns: 4 + Layout.fillWidth: true + Layout.fillHeight: true + rowSpacing: 9 + + //New Grid + Label + { + text: qsTr("Objekt:") + Layout.alignment: Qt.AlignRight + font: Typography.h2 + + + } + Item + { + Layout.columnSpan: 3 + } + + //New grid row + Label + { + text: qsTr("Objekt-Nr.") + Layout.alignment: Qt.AlignRight + } + TextField + { + property string name: "objectno" + id: objectno + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + } + + Button + { + text: qsTr("Objekt hinzufügen") + icon.source: "qrc:/images/PlusCircle.svg" + } + Item + { + + } + + + //// New grid row + + Label + { + text: qsTr("Straße") + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + } + + TextField + { + property string name: "street" + id: street + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + // onTextChanged: checkFields() + } + + Label + { + text: qsTr("Nr.*") + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + } + + TextField + { + property string name: "houseno" + id: houseno + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + // onTextChanged: checkFields() + } + + // New grid row + Label + { + text: qsTr("PLZ") + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + } + + ComboBox + { + property string name: "postcode" + id: postcode + Layout.fillWidth: true + editable: true + // onCurrentTextChanged: checkFields() + // onEditTextChanged: checkFields() + onActivated: currentValue + model: address_model + textRole: "display" + popup.height: 300 + currentIndex: -1 + onCurrentIndexChanged: city.currentIndex = postcode.currentIndex + + validator: RegularExpressionValidator + { + regularExpression: /([0-9]{1,5})/ + } + } + + Label + { + text: qsTr("Ort") + Layout.alignment: Qt.AlignRight + + } + + ComboBox + { + property string name: "city" + id: city + Layout.fillWidth: true + editable: true + // onEditTextChanged: checkFields() + // onCurrentTextChanged: checkFields() + model: address_model + textRole: "city" + popup.height: 300 + currentIndex: -1 + } + + //New Grid + Label + { + text: qsTr("Kunde:") + Layout.alignment: Qt.AlignRight + font: Typography.h2 + + + } + Item + { + Layout.columnSpan: 3 + } + + //New grid row + Label + { + text: qsTr("Kunden-Nr.") + Layout.alignment: Qt.AlignRight + } + + TextField + { + property string name: "customerno" + id: customerno + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + } + Button + { + text: qsTr("Kunde hinzufügen") + icon.source: "qrc:/images/PlusCircle.svg" + } + Item + { + + } + + + // New grid row + Label + { + text: qsTr("Kunden-Name") + Layout.alignment: Qt.AlignRight | Qt.AlignVCenter + } + + TextField + { + + id: customerName + Layout.fillWidth: true + Layout.alignment: Qt.AlignVCenter + } + + + + Item + { + Layout.fillHeight: true + } + + // function checkObjectField() + // { + + // return street.text.trim() && houseno.text.trim() && + + // (postcode.editText.trim() || postcode.currentText.trim()) && + // (city.editText.trim() || city.currentText.trim()) && + // cleaningproducts.text.trim() + // } +} + + + + + + + + + diff --git a/Gui/AddOffer.qml b/Gui/AddOffer.qml new file mode 100644 index 0000000..5aba818 --- /dev/null +++ b/Gui/AddOffer.qml @@ -0,0 +1,112 @@ +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Dialogs +import "../js/qmldict.js" as JsLib + +ColumnLayout +{ + property var new_object: null + //property alias checkAddContact: checkAddContact + Layout.fillWidth: true + Layout.fillHeight: true + spacing: 15 + Label + { + text: qsTr("Angebot anlegen") + horizontalAlignment: Text.AlignHCenter + Layout.fillWidth: true + font.pixelSize: 35 + } + + + RowLayout + { + id: addObject + Layout.fillWidth: true + Layout.fillHeight: true + spacing: 45 + + Frame + { + Layout.alignment: Qt.AlignTop + Layout.fillWidth: true + AddNewOffer + { + id: newOffer + width: parent.width + } + } + + + } + RowLayout + { + Layout.fillHeight: true + Layout.alignment: Qt.AlignRight + Button + { + text: qsTr("Abbrechen") + onClicked: appLoader.source = "OfferTable.qml" + } + Button + { + property var new_object: null + id: saveBtn + text: qsTr("Speichern") + enabled: false + onClicked: + { + // new_object = JsLib.parseForm(newObject) + // new_object['lift'] = new_object['lift'] === 'Ja' ? 1 : 0 + // new_object['mezzanin'] = new_object['mezzanin'] === 'Ja' ? 1 : 0 + // object_model.addObject(new_object) + } + } + } + Item + { + id: spacer3 + Layout.fillHeight: true + } + + Component.onCompleted: + { + //object_model.objectAdded.connect(onObjectAdded) + //contact_model.objectContactAdded.connect(onObjectContact) + } + + + // Connections + // { + // target: object_model + + // function onObjectIdReady() + // { + // var obj_id = arguments[0] + // if (checkAddObjectContact.checked && obj_id) + // { + // var new_objecto = addObjectLayout.getForm() + // contact_model.addObjectContact(new_objecto, obj_id) + // object_model.viewCriterion("Alle") + // } + + // appLoader.source = "ObjectTable.qml" + // } + // } + + // function checkFields() + // { + // if(checkAddObjectContact.checked) + // { + // if(!newObject.checkObjectField() || !addObjectLayout.contactPerson.contacts || !addObjectLayout.contactPerson.contacts.length) + // saveBtn.enabled = false + // else + // saveBtn.enabled = true + // } + // else if (!newObject.checkObjectField()) + // saveBtn.enabled = false + // else + // saveBtn.enabled = true + // } +} diff --git a/Gui/Dashboard.qml b/Gui/Dashboard.qml index 22bf6c2..37f523e 100644 --- a/Gui/Dashboard.qml +++ b/Gui/Dashboard.qml @@ -2,127 +2,106 @@ import QtQuick import QtQuick.Controls import QtQuick.Layouts -ColumnLayout -{ - anchors.top: TopBar.bottom +ColumnLayout { + anchors.top: Navigation.bottom - Rectangle - { - color: "dimgrey" + Rectangle { + Layout.bottomMargin: 3 Layout.fillHeight: true Layout.fillWidth: true - Layout.bottomMargin: 3 + color: "dimgrey" radius: 45 - RowLayout - { + RowLayout { anchors.fill: parent - Rectangle - { + Rectangle { id: contractButton - width: 300 - height: 145 - color: "darkslategray" - radius: 45 + Layout.alignment: Qt.AlignHCenter border.color: "steelblue" border.width: 1 - Text - { - text: qsTr("Aufträge") - anchors.centerIn: parent - font.pixelSize: 45 - font.bold: true - color: "lightgoldenrodyellow" - } + color: "darkslategray" + height: 145 + radius: 45 + width: 300 - MouseArea - { + Text { + anchors.centerIn: parent + color: "lightgoldenrodyellow" + font.bold: true + font.pixelSize: 45 + text: qsTr("Aufträge") + } + MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor hoverEnabled: true - onPressed: - { - contractButton.color = "darkolivegreen" - contractButton.border.width = 3 - contractButton.border.color = "skyblue" - console.log("Aufträge...") + + onExited: { + contractButton.color = "darkslategray"; + contractButton.border.color = "steelblue"; + contractButton.border.width = 1; } - - onReleased: - { - contractButton.color = "darkslategray" - contractButton.border.width = 1 - contractButton.border.color = "steelblue" + onHoveredChanged: { + var w = contractButton.border.width === 3 ? 1 : 3; + contractButton.border.width = w; } - - onHoveredChanged: - { - var w = contractButton.border.width === 3? 1: 3 - contractButton.border.width = w + onPressed: { + contractButton.color = "darkolivegreen"; + contractButton.border.width = 3; + contractButton.border.color = "skyblue"; + console.log("Aufträge..."); } - - onExited: - { - - contractButton.color = "darkslategray" - contractButton.border.color = "steelblue" - contractButton.border.width = 1 + onReleased: { + contractButton.color = "darkslategray"; + contractButton.border.width = 1; + contractButton.border.color = "steelblue"; } } } - - Rectangle - { + Rectangle { id: offerButton - width: 300 - height: 145 - color: "darkslategray" - radius: 45 + Layout.alignment: Qt.AlignHCenter border.color: "steelblue" border.width: 1 - Text - { - text: qsTr("Angebote") + color: "darkslategray" + height: 145 + radius: 45 + width: 300 + + Text { anchors.centerIn: parent - font.pixelSize: 45 - font.bold: true color: "lightgoldenrodyellow" + font.bold: true + font.pixelSize: 45 + text: qsTr("Angebote") } - MouseArea - { + MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor hoverEnabled: true - onPressed: - { - offerButton.color = "darkolivegreen" - offerButton.border.width = 3 - offerButton.border.color = "skyblue" - console.log("Angebote...") + onExited: { + offerButton.color = "darkslategray"; + offerButton.border.color = "steelblue"; + offerButton.border.width = 1; } - onReleased: - { - offerButton.color = "darkslategray" - offerButton.border.width = 1 - offerButton.border.color = "steelblue" + onHoveredChanged: { + var w = offerButton.border.width === 3 ? 1 : 3; + offerButton.border.width = w; } - - onHoveredChanged: - { - var w = offerButton.border.width === 3? 1: 3 - offerButton.border.width = w + onPressed: { + offerButton.color = "darkolivegreen"; + offerButton.border.width = 3; + offerButton.border.color = "skyblue"; + console.log("Angebote..."); } - - onExited: - { - - offerButton.color = "darkslategray" - offerButton.border.color = "steelblue" - offerButton.border.width = 1 + onReleased: { + offerButton.color = "darkslategray"; + offerButton.border.width = 1; + offerButton.border.color = "steelblue"; } } } diff --git a/Gui/Navigation.qml b/Gui/Navigation.qml new file mode 100644 index 0000000..b0a4058 --- /dev/null +++ b/Gui/Navigation.qml @@ -0,0 +1,132 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +ColumnLayout { + height: parent.height + spacing: 0 + + anchors { + left: parent.left + top: parent.top + } + ButtonGroup { + id: buttonBar + } + BarButton { + id: dashBoard + + ButtonGroup.group: buttonBar + icon.source: "qrc:/images/dash.svg" + text: qsTr("Dashboard") + + onClicked: { + appLoader.source = "Dashboard.qml"; + } + } + BarButton { + id: kunden + + ButtonGroup.group: buttonBar + icon.source: "qrc:/images/customer.svg" + text: qsTr("Kunden") + + onClicked: { + appLoader.source = "CustomerTable.qml"; + } + } + BarButton { + id: objekt + + ButtonGroup.group: buttonBar + icon.source: "qrc:/images/object.svg" + text: qsTr("Objekt") + + onClicked: { + appLoader.source = "ObjectTable.qml"; + } + } + BarButton { + id: mitarbeiter + + ButtonGroup.group: buttonBar + icon.source: "qrc:/images/employee.svg" + text: qsTr("Mitarbeiter") + + onClicked: { + appLoader.source = "EmployeeTable.qml"; + } + } + BarButton { + id: offers + + ButtonGroup.group: buttonBar + icon.source: "qrc:/images/offer.svg" + text: qsTr("Angebote") + + onClicked: { + appLoader.source = "OfferTable.qml"; + } + } + BarButton { + id: abrechnung + + ButtonGroup.group: buttonBar + icon.source: "qrc:/images/invoice.svg" + text: qsTr("Abrechnung") + } + Item { + id: hspacer + + Layout.fillHeight: true + } + BarButton { + id: atajos + + Layout.bottomMargin: Dimensions.s + checkable: false + flat: true + icon.source: "qrc:/images/Bars3.svg" + implicitHeight: 90 + implicitWidth: 90 + + onClicked: mainMenu.open() + + Menu { + id: mainMenu + + MenuItem { + text: qsTr("Einstellungen") + + onTriggered: { + // TODO: Check if logged-in user is admin first!! + + appLoader.source = "PyqcrmConf.qml"; + } + } + MenuSeparator { + } + MenuItem { + text: qsTr("Als PDF exportieren") + } + MenuSeparator { + } + MenuItem { + text: qsTr("Drucken") + } + MenuItem { + text: qsTr("Erweiterter Druck") + + onTriggered: printerDialog.show() + } + MenuSeparator { + } + MenuItem { + text: qsTr("Über PYQCRM") + + onTriggered: readMeWin.show() + } + } + } +} + diff --git a/Gui/ObjectTable.qml.orig b/Gui/ObjectTable.qml.orig deleted file mode 100644 index 9e0c078..0000000 --- a/Gui/ObjectTable.qml.orig +++ /dev/null @@ -1,26 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls -import Qt.labs.qmlmodels - -Item { - property var availableFilters: [""] - anchors.fill: parent - - StackView - { - id: objectsStack - anchors.fill: parent - initialItem: "ObjectsTable.qml" -<<<<<<< HEAD - anchors.topMargin: Dimensions.m -======= ->>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d - } -} - - - - - - diff --git a/Gui/ObjectTable_BACKUP_93344.qml b/Gui/ObjectTable_BACKUP_93344.qml deleted file mode 100644 index 9e0c078..0000000 --- a/Gui/ObjectTable_BACKUP_93344.qml +++ /dev/null @@ -1,26 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls -import Qt.labs.qmlmodels - -Item { - property var availableFilters: [""] - anchors.fill: parent - - StackView - { - id: objectsStack - anchors.fill: parent - initialItem: "ObjectsTable.qml" -<<<<<<< HEAD - anchors.topMargin: Dimensions.m -======= ->>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d - } -} - - - - - - diff --git a/Gui/ObjectTable_BASE_93344.qml b/Gui/ObjectTable_BASE_93344.qml deleted file mode 100644 index 8fc8d48..0000000 --- a/Gui/ObjectTable_BASE_93344.qml +++ /dev/null @@ -1,22 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls -import Qt.labs.qmlmodels - -Item { - property var availableFilters: [""] - - StackView - { - id: objectsStack - anchors.fill: parent - initialItem: "ObjectsTable.qml" - anchors.margins: 9 - } -} - - - - - - diff --git a/Gui/ObjectTable_LOCAL_93344.qml b/Gui/ObjectTable_LOCAL_93344.qml deleted file mode 100644 index e72e3a8..0000000 --- a/Gui/ObjectTable_LOCAL_93344.qml +++ /dev/null @@ -1,22 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls -import Qt.labs.qmlmodels - -Item { - property var availableFilters: [""] - - StackView - { - id: objectsStack - anchors.fill: parent - initialItem: "ObjectsTable.qml" - anchors.topMargin: Dimensions.m - } -} - - - - - - diff --git a/Gui/ObjectTable_REMOTE_93344.qml b/Gui/ObjectTable_REMOTE_93344.qml deleted file mode 100644 index 19c9865..0000000 --- a/Gui/ObjectTable_REMOTE_93344.qml +++ /dev/null @@ -1,22 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls -import Qt.labs.qmlmodels - -Item { - property var availableFilters: [""] - anchors.fill: parent - - StackView - { - id: objectsStack - anchors.fill: parent - initialItem: "ObjectsTable.qml" - } -} - - - - - - diff --git a/Gui/ObjectsTable.qml.orig b/Gui/ObjectsTable.qml.orig deleted file mode 100644 index 46d3b1d..0000000 --- a/Gui/ObjectsTable.qml.orig +++ /dev/null @@ -1,257 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls -import Qt.labs.qmlmodels - -<<<<<<< HEAD -ColumnLayout -{ - function viewCriterion(criterion) - { - business_model.viewCriterion(criterion.text); - } - function onObjectContactAdded(added) - { - console.log(added) - if (added) object_model.viewCriterion("") - } - - anchors.fill: parent - - Component.onCompleted: - { - contact_model.objectContactAdded.connect(onObjectContactAdded) - objectsStack.pop() - } - RowLayout - { - SearchBar - { - - } - QuickFilter { - onSelectedChanged: (name) => { - business_model.viewCriterion(name) - } - - model: ListModel { - ListElement { - - name: "Alle" - text: qsTr("Alle") - selected: true - } - ListElement { - name: "Interessent" - text: qsTr("Interessent") - selected: false - } - ListElement { - name: "Kunde" - text: qsTr("Kunde") - selected: false - } - ListElement { - name: "Lieferant" - text: qsTr("Lieferant") - selected: false - } - ListElement { - name: "Erledigt" - text: qsTr("Erledigt") - selected: false - } - } - } - Button - { - id: addObjectBtn - icon.source: "qrc:/images/PlusCircle.svg" - text: qsTr("Objekt Hinzufügen") - Layout.alignment: Qt.AlignRight - onClicked: appLoader.source = "AddObject.qml" - } -======= -ColumnLayout { - spacing: Dimensions.l - function onObjectContactAdded(added) { - console.log(added); - if (added) - object_model.viewCriterion(""); - } - - Component.onCompleted: { - contact_model.objectContactAdded.connect(onObjectContactAdded); - objectsStack.pop(); ->>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d - } - - RowLayout { - Layout.fillWidth: true - spacing: Dimensions.l - -<<<<<<< HEAD - ColumnLayout - { - id: tableColumn - clip: true - // anchors - // { - // top: searchBar.bottom - // bottom: parent.bottom - // left: parent.left - // right: parent.right - // topMargin: 15 - // } - HorizontalHeaderView - { -======= - SearchBar { - } - - Button { - id: addObjectBtn - Layout.alignment: Qt.AlignRight - - icon.source: "qrc:/images/PlusCircle.svg" - text: qsTr("Objekt Hinzufügen") - - onClicked: appLoader.source = "AddObject.qml" - } - } - ColumnLayout { - id: tableColumn - Layout.fillWidth: true - Layout.fillHeight: true - Layout.verticalStretchFactor: 1 - - clip: true - - HorizontalHeaderView { ->>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d - id: horizontalHeaderview - - Layout.fillWidth: true - implicitHeight: 40 - movableColumns: true //@disable-check M16 - syncView: objectTable - - delegate: Rectangle { - Layout.fillWidth: true - border.color: addObjectBtn.palette.base - color: addObjectBtn.palette.alternateBase - implicitHeight: 40 - implicitWidth: 1 - - Text { - color: addObjectBtn.palette.text - elide: Text.ElideRight - height: parent.height - horizontalAlignment: Text.AlignHCenter - text: model.display - verticalAlignment: Text.AlignVCenter - width: parent.width - } - } - } - TableView { - id: objectTable - - property real newWidth: 0 - - Layout.fillWidth: true - Layout.fillHeight: true - alternatingRows: true - columnSpacing: 1 - height: parent.height - horizontalHeaderview.height - model: object_model - resizableColumns: true // @disable-check M16 - rowSpacing: 2 - selectionBehavior: TableView.SelectRows - z: 0 - - ScrollBar.vertical: ScrollBar { - policy: objectTable.contentHeight > objectTable.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff - } - delegate: Rectangle { - required property bool current - required property bool selected - - color: selected ? addObjectBtn.palette.highlight - : (objectTable.alternatingRows && row % 2 !== 0 ? addObjectBtn.palette.base - : addObjectBtn.palette.alternateBase) - - implicitHeight: 25 - implicitWidth: objectTable.width / objectTable.columns - - Text { - color: addObjectBtn.palette.text - elide: Text.ElideRight - height: parent.height - leftPadding: 9 //@disable-check M16 - text: (model.display === null || model.display === undefined) ? "" : model.display - verticalAlignment: Text.AlignVCenter - width: parent.width - } - MouseArea { - id: mouseArea - - property bool hovered: false - - anchors.fill: parent - hoverEnabled: true - - onDoubleClicked: { - objectsStack.push("ObjectDetails.qml", { - selectedObject: row - }); - } - onEntered: { - objectTable.selectionModel.select(objectTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows); - } - } - } - - selectionModel: ItemSelectionModel { - id: obmodel - - model: objectTable.model - } - } -<<<<<<< HEAD - - - } - Item - { - - Layout.fillHeight: true - } - // function onObjectContactAdded(added) - // { - // console.log(added) - // if (added) object_model.viewCriterion("") - // } - // function viewCriterion(criterion) - // { - // object_model.viewCriterion(criterion.text) - // } - - // Component.onCompleted: - // { - // contact_model.objectContactAdded.connect(onObjectContactAdded) - // objectsStack.pop() - // } - - // function onObjectContactAdded(added) - // { - // console.log(added) - // if (added) object_model.viewCriterion("") - // } -======= - Item { - Layout.fillWidth: true - } - } ->>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d -} diff --git a/Gui/OfferTable.qml.orig b/Gui/OfferTable.qml.orig deleted file mode 100644 index 10d6b8e..0000000 --- a/Gui/OfferTable.qml.orig +++ /dev/null @@ -1,22 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls -import Qt.labs.qmlmodels - - -Item -{ - anchors.fill: parent - StackView - { - id: offersStack - - anchors.fill: parent - initialItem: "OffersTable.qml" -<<<<<<< HEAD - anchors.topMargin: Dimensions.m -======= ->>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d - } -} - diff --git a/Gui/OffersTable.qml b/Gui/OffersTable.qml index 2aeb9a7..edd8f06 100644 --- a/Gui/OffersTable.qml +++ b/Gui/OffersTable.qml @@ -56,7 +56,7 @@ ColumnLayout icon.source: "qrc:/images/PlusCircle.svg" Layout.alignment: Qt.AlignRight flat: true - //onClicked: appLoader.source = "AddOffer.qml" + onClicked: appLoader.source = "AddOffer.qml" } } Item { diff --git a/Gui/OffersTable.qml.orig b/Gui/OffersTable.qml.orig deleted file mode 100644 index 64dd9ec..0000000 --- a/Gui/OffersTable.qml.orig +++ /dev/null @@ -1,90 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls -import Qt.labs.qmlmodels - -<<<<<<< HEAD -ColumnLayout -{ - anchors.fill: parent - function viewOffers(criterion) - { - //offer_model.viewCriterion(criterion) -======= -ColumnLayout { - property var availableFilters: [] - - Layout.fillWidth: true - anchors.fill: parent - - RowLayout { - spacing: Dimensions.l - SearchBar { - } - } - Item { - Layout.fillHeight: true ->>>>>>> 7f5675c06d72728a2249b66dc18d56221ad5a0c97791edbc86afeb57dcb3392d - } - - RowLayout - { - SearchBar - { - id:searchBar - } - QuickFilter - { - onSelectedChanged: (name) => - { - business_model.viewCriterion(name) - } - - model: ListModel - { - ListElement - { - - name: "Alle" - text: qsTr("Alle") - selected: true - } - ListElement - { - name: "Offen" - text: qsTr("Offen") - selected: false - } - ListElement - { - name: "Abgeschlossen" - text: qsTr("Abgeschlossen") - selected: false - } - - ListElement - { - name: "Erledigt" - text: qsTr("Erledigt") - selected: false - } - } - } - Button - { - id: addOfferBtn - text: qsTr("Angebote Hinzufügen") - icon.source: "qrc:/images/PlusCircle.svg" - Layout.alignment: Qt.AlignRight - flat: true - //onClicked: appLoader.source = "AddOffer.qml" - } - } - Item { - id: spacer - Layout.fillHeight: true - - } - - -} diff --git a/Gui/TopBar.qml b/Gui/TopBar.qml deleted file mode 100644 index 095f33e..0000000 --- a/Gui/TopBar.qml +++ /dev/null @@ -1,270 +0,0 @@ -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts - - -ColumnLayout -{ - id: topBar - spacing: 0 - height: parent.height - anchors - { - top: parent.top - left: parent.left - - - } - ButtonGroup - { - id: buttonBar - } - - BarButton - { - id: dashBoard - flat: true - text: qsTr("Dashboard") - implicitWidth: 90 - implicitHeight: 90 - Layout.margins: 3 - Layout.topMargin: Dimensions.s - icon.source: "qrc:/images/dash.svg" - ButtonGroup.group: buttonBar - // background: Rectangle - // { - // id: dashiBackie - // border.width: dashBoard.activeFocus ? 2 : 1 - // border.color: "#888" - // radius: 4 - // gradient: Gradient - // { - // GradientStop { position: 0 ; color: dashBoard.pressed ? "#000" : "#001" } - // GradientStop { position: 1 ; color: dashBoard.pressed ? "#100" : "#000" } - // } - // } - onClicked: - { - appLoader.source = "Dashboard.qml" - - - // dashiBackie.border.width = 2 - // kundiBackie.border.width = 1 - // mitoBackie.border.width = 1 - // invoBackie.border.width = 1 - // objBackie.border.width = 1 - } - } - - BarButton - { - id: kunden - flat: true - text: qsTr("Kunden") - implicitWidth: 90 - implicitHeight: 90 - Layout.margins: 3 - icon.source: "qrc:/images/customer.svg" - ButtonGroup.group: buttonBar - // background: Rectangle - // { - // id: kundiBackie - // border.width: kunden.activeFocus ? 2 : 1 - // border.color: "#888" - // radius: 4 - // gradient: Gradient - // { - // GradientStop { position: 0 ; color: kunden.pressed ? "#000" : "#001" } - // GradientStop { position: 1 ; color: kunden.pressed ? "#100" : "#000" } - // } - // } - onClicked: - { - // TODO: here we should call the model - appLoader.source = "CustomerTable.qml" - // kundiBackie.border.width = 2 - // dashiBackie.border.width = 1 - // mitoBackie.border.width = 1 - // invoBackie.border.width = 1 - // objBackie.border.width = 1 - } - } - - BarButton - { - id: objekt - flat: true - text: qsTr("Objekt") - implicitWidth: 90 - implicitHeight: 90 - Layout.margins: 3 - icon.source: "qrc:/images/object.svg" - ButtonGroup.group: buttonBar - // background: Rectangle - // { - // id: objBackie - // border.width: objekt.activeFocus ? 2 : 1 - // border.color: "#888" - // radius: 4 - // gradient: Gradient - // { - // GradientStop { position: 0 ; color: objekt.pressed ? "#000" : "#001" } - // GradientStop { position: 1 ; color: objekt.pressed ? "#100" : "#000" } - // } - // } - onClicked: - { - appLoader.source = "ObjectTable.qml" - // objBackie.border.width = 2 - // dashiBackie.border.width = 1 - // kundiBackie.border.width = 1 - // mitoBackie.border.width = 1 - // invoBackie.border.width = 1 - } - - } - - BarButton - { - id: mitarbeiter - flat: true - text: qsTr("Mitarbeiter") - implicitWidth: 90 - implicitHeight: 90 - Layout.margins: 3 - icon.source: "qrc:/images/employee.svg" - - ButtonGroup.group: buttonBar - // background: Rectangle - // { - // id: mitoBackie - // border.width: mitarbeiter.activeFocus ? 2 : 1 - // border.color: "#888" - // radius: 4 - // gradient: Gradient - // { - // GradientStop { position: 0 ; color: mitarbeiter.pressed ? "#000" : "#001" } - // GradientStop { position: 1 ; color: mitarbeiter.pressed ? "#100" : "#000" } - // } - // } - onClicked: - { - appLoader.source = "EmployeeTable.qml" - // mitoBackie.border.width = 2 - // dashiBackie.border.width = 1 - // kundiBackie.border.width = 1 - // invoBackie.border.width = 1 - // objBackie.border.width = 1 - } - } - - BarButton - { - id: offers - flat: true - text: qsTr("Angebote") - implicitWidth: 90 - implicitHeight: 90 - Layout.margins: 3 - icon.source: "qrc:/images/offer.svg" - ButtonGroup.group: buttonBar - // background: Rectangle - // { - // id: offersBackie - // border.width: offers.activeFocus ? 2 : 1 - // border.color: "#888" - // radius: 4 - // gradient: Gradient - // { - // GradientStop { position: 0 ; color: offers.pressed ? "#000" : "#001" } - // GradientStop { position: 1 ; color: offers.pressed ? "#100" : "#000" } - // } - // } - onClicked: - { - appLoader.source = "OfferTable.qml" - // mitoBackie.border.width = 2 - // dashiBackie.border.width = 1 - // kundiBackie.border.width = 1 - // invoBackie.border.width = 1 - // objBackie.border.width = 1 - // offersBackie.border.width = 1 - } - } - - BarButton - { - id: abrechnung - flat: true - text: qsTr("Abrechnung") - implicitWidth: 90 - implicitHeight: 90 - Layout.margins: 3 - icon.source: "qrc:/images/invoice.svg" - ButtonGroup.group: buttonBar - // background: Rectangle - // { - // id: invoBackie - // border.width: abrechnung.activeFocus ? 2 : 1 - // border.color: "#888" - // radius: 4 - // gradient: Gradient - // { - // GradientStop { position: 0 ; color: abrechnung.pressed ? "#000" : "#001" } - // GradientStop { position: 1 ; color: abrechnung.pressed ? "#100" : "#000" } - // } - // } - } - - Item - { - id: hspacer - Layout.fillHeight: true - } - - BarButton - { - id: atajos - implicitWidth: 90 - implicitHeight: 90 - checkable: false - icon.source: "qrc:/images/Bars3.svg" - - flat: true - Layout.bottomMargin: Dimensions.s - onClicked: mainMenu.open() - - Menu { - id: mainMenu - MenuItem - { - //text: qsTr("Benutzer-Verwaltung") - //onTriggered: appLoader.source = "UsersPage.qml" - text: qsTr("Einstellungen") - onTriggered: - { - // TODO: Check if logged-in user is admin first!! - - appLoader.source = "PyqcrmConf.qml" - } - } - MenuSeparator {} - MenuItem { text: qsTr("Als PDF exportieren") } - MenuSeparator {} - MenuItem { text: qsTr("Drucken") } - MenuItem - { - text: qsTr("Erweiterter Druck") - onTriggered: printerDialog.show() - } - MenuSeparator {} - MenuItem - { - text: qsTr("Über PYQCRM") - onTriggered: readMeWin.show() - } - } - } -} - - diff --git a/Gui/main.qml b/Gui/main.qml index 404cf37..393c4b7 100644 --- a/Gui/main.qml +++ b/Gui/main.qml @@ -4,173 +4,148 @@ import QtQuick.Controls import QtQuick.Dialogs import QtCore -ApplicationWindow -{ +ApplicationWindow { id: appWindow - width: Screen.width * .75 - height: Screen.height * .85 - visible: true - title: "TERO Personal" - font: Typography.body - color: Colors.mantle + property string confile: "" property alias settingsFileDialog: settingsFiledialog + function goToLogin() { + appLoader.source = "LoginScreen.qml"; + navigation.visible = true; + } + function showWindow(why) { + if (why === 3) { + systray.setVisible(false); + appWindow.show(); + } + } + + color: Colors.mantle + font: Typography.body + height: Screen.height * .85 palette.text: Colors.foreground + title: "TERO Personal" + visible: true + width: Screen.width * .75 + Component.onCompleted: { + config.configurationReady.connect(goToLogin); + systray.activated.connect(showWindow); - TopBar - { - id:topBar - visible: bad_config || !db_con ? false: true + if (bad_config) { + importDialog.open(); + } else { + if (db_con) + appLoader.source = "LoginScreen.qml"; + else + appLoader.source = "NoDbConnection.qml"; + } + } + onClosing: close => { + if (false) { + console.log("Main window closed!! Was soll ich tun? kann ich mich beenden?!"); + } + } + onVisibilityChanged: { + if (appWindow.visibility === Window.Minimized && config.systray()) { + systray.setVisible(true); + appWindow.hide(); + } + } + onWindowStateChanged: windowState => { + if (windowState !== Qt.WindowMinimized) { + systray.setVisible(false); + appWindow.show(); + } } - PrinterDialog - { + Navigation { + id: navigation + + visible: bad_config || !db_con ? false : true + } + PrinterDialog { id: printerDialog - } - ReadMe - { + } + ReadMe { id: readMeWin - } - Item - { + } + Item { id: mainView + } - Loader - { - id: appLoader - - anchors - { - left: topBar.right + Rectangle { + id: contentBackground + anchors { + bottom: parent.bottom + left: navigation.right right: parent.right top: parent.top - bottom: parent.bottom - - - - topMargin: Dimensions.l - bottomMargin: Dimensions.l - rightMargin: Dimensions.l - leftMargin: Dimensions.l - } + color: Colors.background + } + + Loader { + id: appLoader property alias window: appWindow + + anchors { + fill: contentBackground + margins: Dimensions.l + } } - - Dialog - { + Dialog { id: importDialog - modal: true + anchors.centerIn: parent + modal: true standardButtons: Dialog.Yes | Dialog.No - onAccepted: settingsFiledialog.open() - onRejected: appLoader.source= "Firststart.qml" title: qsTr("Einstellungen importieren") + + onAccepted: settingsFiledialog.open() + onRejected: appLoader.source = "Firststart.qml" } - - FileDialog - { - + FileDialog { id: settingsFiledialog - title: qsTr("PYQCRM Einstellungen") + currentFolder: StandardPaths.standardLocations(StandardPaths.DocumentsLocation)[0] modality: "ApplicationModal" nameFilters: [qsTr("PYQCRM Einstellungen (*.pyqrec)")] - onAccepted: - { - exportFilePassword.open() - confile = selectedFile + title: qsTr("PYQCRM Einstellungen") + + onAccepted: { + exportFilePassword.open(); + confile = selectedFile; } } - - Dialog - { + Dialog { id: exportFilePassword - modal: true - title: qsTr("PYQCRM Einstellungen") + anchors.centerIn: parent + modal: true standardButtons: Dialog.Ok | Dialog.Cancel + title: qsTr("PYQCRM Einstellungen") + onAccepted: config.importConfig(confile, exportPasswordInput.text) - ColumnLayout - { - RowLayout - { - Label - { + + ColumnLayout { + RowLayout { + Label { text: qsTr("Passwort eingeben:") } - - TextField - { + TextField { id: exportPasswordInput + echoMode: TextInput.Password implicitWidth: 300 } } } } - - Component.onCompleted: - { - config.configurationReady.connect(goToLogin) - systray.activated.connect(showWindow) - - if(bad_config) - { - importDialog.open() - } - else - { - if (db_con) appLoader.source= "LoginScreen.qml" - else appLoader.source= "NoDbConnection.qml" - } - } - - - function showWindow(why) - { - if (why === 3) - { - systray.setVisible(false) - appWindow.show() - } - } - onVisibilityChanged: - { - if (appWindow.visibility === Window.Minimized && config.systray()) - { - systray.setVisible(true) - appWindow.hide() - } - } - - onWindowStateChanged: (windowState) => - { - if (windowState !== Qt.WindowMinimized) - { - systray.setVisible(false) - appWindow.show() - } - } - - onClosing: (close) => - { - if (false) - { - console.log("Main window closed!! Was soll ich tun? kann ich mich beenden?!") - } - } - - function goToLogin() - { - appLoader.source= "LoginScreen.qml" - topBar.visible = true - } } diff --git a/Gui/qmldir b/Gui/qmldir index 2c090fe..a5ac533 100644 --- a/Gui/qmldir +++ b/Gui/qmldir @@ -1,2 +1,2 @@ module gui -TopBar 1.0 TopBar.qml +TopBar 1.0 Navigation.qml diff --git a/TeroStyle/BarButton.qml b/TeroStyle/BarButton.qml index 0572df1..c29de2e 100644 --- a/TeroStyle/BarButton.qml +++ b/TeroStyle/BarButton.qml @@ -6,82 +6,47 @@ import QtQuick.Templates as T T.ToolButton { id: control - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) checkable: true icon.color: Colors.foreground icon.height: 36 icon.width: 36 + implicitHeight: 90 + implicitWidth: 100 topPadding: 20 - // horizontalPadding: padding + 2 - // spacing: 6 - // display: AbstractButton.TextUnderIcon - - // icon.color: control.checked || control.highlighted ? control.palette.brightText : - // control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText - - contentItem: Column - { - - IconLabel - { + contentItem: Column { + readonly property color color: control.checked ? Colors.primaryShade : control.hovered ? Colors.primary : Colors.foreground + IconLabel { + icon.color: parent.color + icon.source: control.icon.source + icon.height: control.icon.height + icon.width: control.icon.width + color: parent.color x: parent.width * .5 - width * .5 - // height: icon.height - // width: icon.width - icon: control.icon - - // display: control.display - - } - Label - { + Label { + font: Typography.small + color: parent.color text: control.text - font: Typography.dash - - color: Colors.foreground x: parent.width * .5 - width * .5 - - - - } - - // spacing: control.spacing - // mirrored: control.mirrored - // display: control.TextUnderIcon - - // icon: control.icon - // text: control.text - // font: control.font - // color: control.checked || control.highlighted ? control.palette.brightText : - // control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText - - } - - background: Rectangle { - id: mainrect - implicitWidth: control.width - implicitHeight: control.height - visible: !control.flat || control.down || control.checked || control.highlighted - x: control.left - y: control.top - color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button, - control.palette.mid, control.down ? 0.5 : 0.0) - border.color: control.palette.highlight - border.width: control.visualFocus ? 2 : 0 - Rectangle - { - implicitHeight: control.height - implicitWidth: 6 - x: mainrect.left - y: mainrect.top - color: "yellow" - } } + Rectangle { + anchors.bottom: parent.bottom + anchors.left: parent.left + anchors.top: parent.top + color: control.checked ? Colors.primaryShade : Colors.primary + implicitWidth: 6 + visible: control.checked || control.hovered + } + MouseArea { + id: mouseArea + + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + + onPressed: mouse => mouse.accepted = false + } } diff --git a/TeroStyle/Colors.qml b/TeroStyle/Colors.qml index bcc1df6..af7cb98 100644 --- a/TeroStyle/Colors.qml +++ b/TeroStyle/Colors.qml @@ -11,9 +11,10 @@ QtObject { readonly property color primary: "#b81a34" readonly property color primaryContrast: "#fdfdfd" readonly property color primaryLighter: Qt.lighter(primary, 1.5) + readonly property color primaryShade: theme === dark ? primaryLighter : Qt.darker(primary, 1.5) readonly property color foreground: theme === dark ? "#fdfdfd" : "#110b0c" readonly property color background: theme === dark ? "#303136" : "#eff1f5" - readonly property color mantle: theme === dark ? "#1e1f22" : "#e7e9ef" + readonly property color mantle: theme === dark ? "#1E1E23" : "#e7e9ef" readonly property color interactive: theme === dark ? "#878b97" : "#d9d9da" readonly property color error: theme === dark ? "#ff2264" : "#ff004b" readonly property color transparent: "transparent" diff --git a/TeroStyle/ComboBox.qml b/TeroStyle/ComboBox.qml index 78c3840..46e5189 100644 --- a/TeroStyle/ComboBox.qml +++ b/TeroStyle/ComboBox.qml @@ -1,22 +1,59 @@ -pragma ComponentBehavior: Bound - import QtQuick -import QtQuick.Controls.impl -import QtQuick.Controls import QtQuick.Templates as T +import QtQuick.Controls +import QtQuick.Controls.impl T.ComboBox { id: control - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) + font: Typography.body implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding, implicitIndicatorHeight + topPadding + bottomPadding) - leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) - rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) + contentItem: T.TextField { + id: test + autoScroll: control.editable + color: Colors.foreground + enabled: control.editable + + font: Typography.body + implicitHeight: Typography.body.pixelSize + topPadding + bottomPadding + inputMethodHints: control.inputMethodHints + padding: Dimensions.m + readOnly: control.down + selectByMouse: control.selectTextByMouse + text: control.editable ? control.editText : control.displayText + validator: control.validator + width: control.width - indicator.width + verticalAlignment: Text.AlignVCenter + } + background: Rectangle { + border.color: Colors.interactive + border.width: 1 + color: Colors.mantle + // height: parent.height + radius: Dimensions.radius + width: parent.width + } + // delegate: MenuItem { + // id: menuItem + + // required property int index + // required property var model + + // highlighted: control.highlightedIndex === index + // hoverEnabled: control.hoverEnabled + // text: model[control.textRole] + // width: control.width + + // background: Rectangle { + // color: menuItem.down || menuItem.highlighted ? Colors.primary : "transparent" + // height: menuItem.height + // width: menuItem.width + // } + // } delegate: ItemDelegate { required property var model required property int index @@ -25,222 +62,71 @@ T.ComboBox { text: model[control.textRole] // palette.text: control.palette.text // palette.highlightedText: control.palette.highlightedText - font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal + // font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal highlighted: control.highlightedIndex === index hoverEnabled: control.hoverEnabled } + indicator: Rectangle { + id: indicator - indicator: ColorImage { - x: control.mirrored ? control.padding : control.width - width - control.padding - y: control.topPadding + (control.availableHeight - height) / 2 + border.color: Colors.interactive + bottomRightRadius: Dimensions.radius + color: Colors.primary + height: control.height + topRightRadius: Dimensions.radius + width: 20 + Dimensions.s * 2 + x: control.width - width + y: 0 + z: 2 - source: "qrc:/images/ChevronDown.svg" - opacity: enabled ? 1 : 0.3 - } - - contentItem: T.TextField { - // leftPadding: !control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1 - // rightPadding: control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1 - // topPadding: 6 - control.padding - // bottomPadding: 6 - control.padding - implicitHeight: Typography.body.pixelSize + bottomPadding + topPadding - text: control.editable ? control.editText : control.displayText - padding: Dimensions.m - enabled: control.editable - autoScroll: control.editable - readOnly: control.down - inputMethodHints: control.inputMethodHints - validator: control.validator - selectByMouse: control.selectTextByMouse - - color: Colors.foreground - // selectionColor: control.palette.highlight - // selectedTextColor: control.palette.highlightedText - verticalAlignment: Text.AlignVCenter - - background: Rectangle { - visible: control.enabled && control.editable && !control.flat - border.width: parent && parent.activeFocus ? 2 : 1 - border.color: Colors.interactive - radius: Dimensions.radius - color: Colors.mantle + IconLabel { + anchors.fill: parent + bottomPadding: Dimensions.s + icon.color: Colors.foreground + icon.source: "qrc:/images/ChevronDown.svg" + leftPadding: Dimensions.s + rightPadding: Dimensions.s + topPadding: Dimensions.s + } + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onPressed: () => { + control.popup.visible = true; + control.popup.forceActiveFocus() + } } } - - background: Rectangle { - implicitWidth: 140 - implicitHeight: 40 - radius: Dimensions.radius - color: Colors.mantle - border.color: Colors.interactive - border.width: 1 - visible: !control.flat || control.down - } - popup: T.Popup { - y: control.height - width: control.width - height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) - topMargin: 6 bottomMargin: 6 - palette: control.palette + height: Math.min(contentItem.implicitHeight + 2, control.Window.height - topMargin - bottomMargin) + padding: 1 + topMargin: 6 + width: control.width + y: control.height + background: Rectangle { + border.color: Colors.interactive + color: Colors.mantle + radius: Dimensions.radius + } contentItem: ListView { clip: true - implicitHeight: contentHeight - model: control.delegateModel currentIndex: control.highlightedIndex - highlightMoveDuration: 0 + implicitHeight: contentHeight + model: control.popup.visible ? control.delegateModel : null - Rectangle { - z: 10 - width: parent.width - height: parent.height - color: "transparent" - border.color: control.palette.mid + T.ScrollBar.vertical: ScrollBar { + } + highlight: Rectangle { + color: Colors.primary + opacity: Colors.highlightOpacity } - - T.ScrollIndicator.vertical: ScrollIndicator { } } - - background: Rectangle { - color: control.palette.window - } - + } + Component.onCompleted: + { + console.log(control.implicitContentHeight) } } - - -// import QtQuick -// import QtQuick.Templates as T -// import QtQuick.Controls -// import QtQuick.Controls.impl - -// T.ComboBox { -// id: control - -// font: Typography.body -// implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, -// implicitContentHeight + topPadding + bottomPadding, -// implicitIndicatorHeight + topPadding + bottomPadding) - - -// contentItem: T.TextField { -// id: test -// autoScroll: control.editable -// color: Colors.foreground -// enabled: control.editable - -// font: Typography.body -// implicitHeight: Typography.body.pixelSize + topPadding + bottomPadding -// inputMethodHints: control.inputMethodHints -// padding: Dimensions.m -// readOnly: control.down -// selectByMouse: control.selectTextByMouse -// text: control.editable ? control.editText : control.displayText -// validator: control.validator -// width: control.width - indicator.width -// verticalAlignment: Text.AlignVCenter -// } -// background: Rectangle { -// border.color: Colors.interactive -// border.width: 1 -// color: Colors.mantle -// // height: parent.height -// radius: Dimensions.radius -// width: parent.width -// } -// // delegate: MenuItem { -// // id: menuItem - -// // required property int index -// // required property var model - -// // highlighted: control.highlightedIndex === index -// // hoverEnabled: control.hoverEnabled -// // text: model[control.textRole] -// // width: control.width - -// // background: Rectangle { -// // color: menuItem.down || menuItem.highlighted ? Colors.primary : "transparent" -// // height: menuItem.height -// // width: menuItem.width -// // } -// // } -// delegate: ItemDelegate { -// required property var model -// required property int index - -// width: ListView.view.width -// text: model[control.textRole] -// // palette.text: control.palette.text -// // palette.highlightedText: control.palette.highlightedText -// // font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal -// highlighted: control.highlightedIndex === index -// hoverEnabled: control.hoverEnabled -// } -// indicator: Rectangle { -// id: indicator - -// border.color: Colors.interactive -// bottomRightRadius: Dimensions.radius -// color: Colors.primary -// height: control.height -// topRightRadius: Dimensions.radius -// width: 20 + Dimensions.s * 2 -// x: control.width - width -// y: 0 -// z: 2 - -// IconLabel { -// anchors.fill: parent -// bottomPadding: Dimensions.s -// icon.color: Colors.foreground -// icon.source: "qrc:/images/ChevronDown.svg" -// leftPadding: Dimensions.s -// rightPadding: Dimensions.s -// topPadding: Dimensions.s -// } -// MouseArea { -// anchors.fill: parent -// cursorShape: Qt.PointingHandCursor - -// onPressed: () => { -// control.popup.visible = true; -// control.popup.forceActiveFocus() -// } -// } -// } -// popup: T.Popup { -// bottomMargin: 6 -// height: Math.min(contentItem.implicitHeight + 2, control.Window.height - topMargin - bottomMargin) -// padding: 1 -// topMargin: 6 -// width: control.width -// y: control.height - -// background: Rectangle { -// border.color: Colors.interactive -// color: Colors.mantle -// radius: Dimensions.radius -// } -// contentItem: ListView { -// clip: true -// currentIndex: control.highlightedIndex -// implicitHeight: contentHeight -// model: control.popup.visible ? control.delegateModel : null - -// T.ScrollBar.vertical: ScrollBar { -// } -// highlight: Rectangle { -// color: Colors.primary -// opacity: Colors.highlightOpacity -// } -// } -// } -// Component.onCompleted: -// { -// console.log(control.implicitContentHeight) -// } -// } diff --git a/TeroStyle/Typography.qml b/TeroStyle/Typography.qml index 145d16d..b09a2da 100644 --- a/TeroStyle/Typography.qml +++ b/TeroStyle/Typography.qml @@ -3,38 +3,37 @@ pragma Singleton import QtCore import QtQuick -Item -{ - readonly property FontLoader robotoCondensed: FontLoader - { +Item { + readonly property font body: ({ + family: robotoCondensed.font, + pointSize: 16, + weight: Font.Medium, + letterSpacing: 0, + kerning: true + }) + readonly property font small: ({ + family: body.family, + pointSize: 11, + weight: Font.DemiBold, + letterSpacing: body.letterSpacing, + kerning: body.kerning + }) + readonly property font h1: ({ + family: body.family, + pointSize: 38, + weight: body.weight, + letterSpacing: body.letterSpacing, + kerning: body.kerning + }) + readonly property font h2: + ({ + family: body.family, + pointSize: 20, + weight: body.weight, + letterSpacing: body.letterSpacing, + kerning: body.kerning, + }) + readonly property FontLoader robotoCondensed: FontLoader { source: "qrc:/fonts/RobotoCondensed.otf" } - - readonly property font body: - ({ - family: robotoCondensed.font, - pointSize: 16, - weight: Font.Medium, - letterSpacing: 0, - kerning: true, - }) - - readonly property font h1: - ({ - family: body.family, - pointSize: 38, - weight: body.weight, - letterSpacing: body.letterSpacing, - kerning: body.kerning, - }) - - readonly property font dash: - ({ - family: body.family, - pointSize: 10, - weight: body.weight, - letterSpacing: body.letterSpacing, - kerning: body.kerning, - }) - } diff --git a/doc/design/TERO CRM.penpot b/doc/design/TERO CRM.penpot new file mode 100644 index 0000000..dfa5e79 Binary files /dev/null and b/doc/design/TERO CRM.penpot differ diff --git a/doc/design/pages/Angebot Erstellen.png b/doc/design/pages/Angebot Erstellen.png index a7389eb..dd9adcb 100644 Binary files a/doc/design/pages/Angebot Erstellen.png and b/doc/design/pages/Angebot Erstellen.png differ diff --git a/main.py b/main.py index 6336235..7fa4103 100644 --- a/main.py +++ b/main.py @@ -22,6 +22,7 @@ from lib.Printers import Printers os.environ['QML_XHR_ALLOW_FILE_READ'] = '1' + # [pyqcrm] # program-name="" # version= diff --git a/qml.qrc b/qml.qrc index 05ec096..8c0bae2 100644 --- a/qml.qrc +++ b/qml.qrc @@ -1,6 +1,6 @@ - Gui/TopBar.qml + Gui/Navigation.qml Gui/AdminUserConfig.qml Gui/EncryptionKey.qml Gui/DbConfiguration.qml @@ -60,6 +60,8 @@ TeroStyle/TextField.qml TeroStyle/Typography.qml TeroStyle/BarButton.qml + Gui/AddOffer.qml + Gui/AddNewOffer.qml