Compare commits
21 Commits
7f5675c06d
...
d125b56564
| Author | SHA256 | Date | |
|---|---|---|---|
| d125b56564 | |||
| 6e8c2f340c | |||
| 76c4be7a7a | |||
| 8236bd32e6 | |||
| 3520c65879 | |||
| a821956a67 | |||
| 46cba58ebe | |||
| a7a1cd4913 | |||
| 34bd7409df | |||
| 6df02d9ff2 | |||
| 9499eace9b | |||
| 8f6efac11e | |||
| d6034a5299 | |||
| 15b14387df | |||
| fadd3d1b9e | |||
| 648753823f | |||
| 495252c408 | |||
| 5b7e364c20 | |||
| ce26d6d223 | |||
| c49e4ebacd | |||
| 7b1f5cd3cc |
@@ -3,6 +3,7 @@ import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
property var availableFilters: ["Name", "Adresse", "PLZ", "Ort"]
|
||||
@@ -12,6 +13,7 @@ Item {
|
||||
id: customersStack
|
||||
anchors.fill: parent
|
||||
initialItem: "CustomersTable.qml"
|
||||
anchors.topMargin: Dimensions.m
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,17 +5,27 @@ import Qt.labs.qmlmodels
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
function viewCriterion(criterion)
|
||||
{
|
||||
business_model.viewCriterion(criterion.text);
|
||||
}
|
||||
|
||||
|
||||
|
||||
anchors.fill: parent
|
||||
spacing: Dimensions.l
|
||||
|
||||
Component.onCompleted: customersStack.pop()
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.horizontalStretchFactor: 1
|
||||
spacing: Dimensions.l
|
||||
RowLayout
|
||||
{
|
||||
// Layout.fillWidth: true
|
||||
// Layout.horizontalStretchFactor: 1
|
||||
// spacing: Dimensions.l
|
||||
|
||||
SearchBar {
|
||||
|
||||
SearchBar
|
||||
{
|
||||
}
|
||||
|
||||
QuickFilter {
|
||||
@@ -25,6 +35,7 @@ ColumnLayout {
|
||||
|
||||
model: ListModel {
|
||||
ListElement {
|
||||
|
||||
name: "Alle"
|
||||
text: qsTr("Alle")
|
||||
selected: true
|
||||
@@ -51,20 +62,22 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
Button {
|
||||
Button
|
||||
{
|
||||
id: addCustomer
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
icon.source: "qrc:/images/PlusCircle.svg"
|
||||
text: qsTr("Kunde Hinzufügen")
|
||||
|
||||
onClicked: appLoader.source = "AddCustomer.qml"
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
ColumnLayout
|
||||
{
|
||||
clip: true
|
||||
|
||||
HorizontalHeaderView {
|
||||
HorizontalHeaderView
|
||||
{
|
||||
id: horizontalHeader
|
||||
|
||||
Layout.fillWidth: true
|
||||
@@ -72,14 +85,16 @@ ColumnLayout {
|
||||
movableColumns: true //@disable-check M16
|
||||
syncView: customerTable
|
||||
|
||||
delegate: Rectangle {
|
||||
delegate: Rectangle
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
border.color: addCustomer.palette.base
|
||||
color: addCustomer.palette.alternateBase
|
||||
implicitHeight: 40
|
||||
implicitWidth: 1
|
||||
|
||||
Text {
|
||||
Text
|
||||
{
|
||||
color: addCustomer.palette.text
|
||||
elide: Text.ElideRight
|
||||
height: parent.height
|
||||
@@ -156,4 +171,5 @@ ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ Item {
|
||||
|
||||
anchors.fill: parent
|
||||
initialItem: "EmployeesTable.qml"
|
||||
anchors.topMargin: Dimensions.m
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,195 +3,274 @@ import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
ColumnLayout {
|
||||
property var availableFilters: ["Name", "Adresse", "PLZ", "Ort", "Status"]
|
||||
ColumnLayout
|
||||
{
|
||||
|
||||
function viewEmployees(criterion) {
|
||||
employee_model.viewCriterion(criterion, showProcessed.checked, showFired.checked, showEveryone.checked);
|
||||
function viewEmployees(criterion)
|
||||
{
|
||||
employee_model.viewCriterion(criterion)
|
||||
// employee_model.viewCriterion(criterion, showProcessed.checked, showFired.checked, showEveryone.checked)
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
spacing: Dimensions.s
|
||||
|
||||
Component.onCompleted: employeesStack.pop()
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.horizontalStretchFactor: 1
|
||||
spacing: Dimensions.l
|
||||
|
||||
SearchBar {
|
||||
// property var availableFilters: ["Name", "Adresse", "PLZ", "Ort", "Status"]
|
||||
RowLayout
|
||||
{
|
||||
SearchBar
|
||||
{
|
||||
id:searchBar
|
||||
}
|
||||
QuickFilter
|
||||
{
|
||||
onSelectedChanged: (name) =>
|
||||
{
|
||||
business_model.viewCriterion(name)
|
||||
}
|
||||
|
||||
QuickFilter {
|
||||
model: ListModel {
|
||||
ListElement {
|
||||
model: ListModel
|
||||
{
|
||||
ListElement
|
||||
{
|
||||
|
||||
name: "Alle"
|
||||
selected: true
|
||||
text: qsTr("Alle")
|
||||
selected: true
|
||||
}
|
||||
ListElement {
|
||||
ListElement
|
||||
{
|
||||
name: "Bewerber"
|
||||
selected: false
|
||||
text: qsTr("Bewerber")
|
||||
selected: false
|
||||
}
|
||||
ListElement {
|
||||
ListElement
|
||||
{
|
||||
name: "Mitarbeiter"
|
||||
text: qsTr("Mitarbeiter")
|
||||
}
|
||||
text: qsTr("Kunde")
|
||||
selected: false
|
||||
}
|
||||
|
||||
onSelectedChanged: name => {
|
||||
viewEmployees(name);
|
||||
ListElement
|
||||
{
|
||||
name: "Erledigt"
|
||||
text: qsTr("Erledigt")
|
||||
selected: false
|
||||
}
|
||||
}
|
||||
Button {
|
||||
}
|
||||
Button
|
||||
{
|
||||
id: addEmployeeBtn
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
icon.source: "qrc:/images/PlusCircle.svg"
|
||||
text: qsTr("Mitarbeiter Hinzufügen")
|
||||
|
||||
icon.source: "qrc:/images/PlusCircle.svg"
|
||||
Layout.alignment: Qt.AlignRight
|
||||
flat: true
|
||||
onClicked: appLoader.source = "AddApplicant.qml"
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
id: viewCriterion
|
||||
|
||||
CheckBox {
|
||||
id: showEveryone
|
||||
|
||||
checked: true
|
||||
text: qsTr("Alle Stati")
|
||||
|
||||
onCheckedChanged: {
|
||||
showFired.checked = false;
|
||||
showProcessed.checked = false;
|
||||
}
|
||||
onClicked: viewEmployees(criterion.checkedButton.text)
|
||||
}
|
||||
CheckBox {
|
||||
id: showProcessed
|
||||
|
||||
checked: false
|
||||
enabled: !showEveryone.checked
|
||||
text: qsTr("Erledigt")
|
||||
|
||||
onClicked: {
|
||||
showFired.checked = false;
|
||||
viewEmployees(criterion.checkedButton.text);
|
||||
}
|
||||
}
|
||||
CheckBox {
|
||||
id: showFired
|
||||
// ButtonGroup
|
||||
// {
|
||||
// id: criterion
|
||||
// // buttons: criterion.children
|
||||
// onClicked:
|
||||
// {
|
||||
// viewEmployees(criterion.checkedButton.text)
|
||||
// }
|
||||
// }
|
||||
|
||||
checked: false
|
||||
enabled: !showEveryone.checked
|
||||
text: qsTr("Ausgeschieden")
|
||||
// ColumnLayout
|
||||
// {
|
||||
// id: tableParent
|
||||
// clip: true
|
||||
// anchors
|
||||
// {
|
||||
|
||||
onClicked: {
|
||||
showProcessed.checked = false;
|
||||
viewEmployees(criterion.checkedButton.text);
|
||||
}
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
id: tableParent
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.verticalStretchFactor: 1
|
||||
// top: searchBar.bottom
|
||||
// bottom: parent.bottom
|
||||
// left: parent.left
|
||||
// right: parent.right
|
||||
// }
|
||||
|
||||
clip: true
|
||||
// RowLayout
|
||||
// {
|
||||
// id: viewCriterion
|
||||
|
||||
HorizontalHeaderView {
|
||||
// RadioButton
|
||||
// {
|
||||
// //id: showAll
|
||||
// checked: true
|
||||
// text: qsTr("Alle")
|
||||
// ButtonGroup.group: criterion
|
||||
// //onClicked: viewEmployees(showAll)
|
||||
// }
|
||||
// RadioButton
|
||||
// {
|
||||
// //id: showApplicant
|
||||
// text: qsTr("Bewerber")
|
||||
// ButtonGroup.group: criterion
|
||||
// //onClicked: viewEmployees(showApplicant)
|
||||
// }
|
||||
// RadioButton
|
||||
// {
|
||||
// //id: showEmployee
|
||||
// text: qsTr("Mitarbeiter")
|
||||
// ButtonGroup.group: criterion
|
||||
// //onClicked: viewEmployees(showEmployee)
|
||||
// }
|
||||
|
||||
// CheckBox
|
||||
// {
|
||||
// id: showEveryone
|
||||
// text: qsTr("Alle Stati")
|
||||
// checked: true
|
||||
// onClicked: viewEmployees(criterion.checkedButton.text)
|
||||
// onCheckedChanged:
|
||||
// {
|
||||
// showFired.checked = false
|
||||
// showProcessed.checked = false
|
||||
// }
|
||||
// }
|
||||
// CheckBox
|
||||
// {
|
||||
// id: showProcessed
|
||||
// text: qsTr("Erledigt")
|
||||
// enabled: !showEveryone.checked
|
||||
// checked: false
|
||||
// onClicked:
|
||||
// {
|
||||
// showFired.checked = false
|
||||
// viewEmployees(criterion.checkedButton.text)
|
||||
// }
|
||||
// }
|
||||
// CheckBox
|
||||
// {
|
||||
// id: showFired
|
||||
// text: qsTr("Ausgeschieden")
|
||||
// enabled: !showEveryone.checked
|
||||
// checked: false
|
||||
// onClicked:
|
||||
// {
|
||||
// showProcessed.checked = false
|
||||
// viewEmployees(criterion.checkedButton.text)
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
HorizontalHeaderView
|
||||
{
|
||||
id: employeeTableHeader
|
||||
|
||||
Layout.fillWidth: true
|
||||
width: tableParent.width
|
||||
syncView: appliEmpTable
|
||||
implicitHeight: 40
|
||||
movableColumns: true //@disable-check M16
|
||||
syncView: appliEmpTable
|
||||
|
||||
delegate: Rectangle {
|
||||
Layout.fillWidth: true
|
||||
border.color: palette.base
|
||||
delegate: Rectangle
|
||||
{
|
||||
color: addEmployeeBtn.palette.alternateBase
|
||||
border.color: palette.base
|
||||
implicitHeight: 40
|
||||
Layout.fillWidth: true
|
||||
implicitWidth: 1
|
||||
|
||||
Text {
|
||||
color: palette.text
|
||||
Text
|
||||
{
|
||||
text: model.display
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: model.display
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
width: parent.width
|
||||
color: palette.text
|
||||
}
|
||||
}
|
||||
}
|
||||
TableView {
|
||||
id: appliEmpTable
|
||||
|
||||
TableView
|
||||
{
|
||||
id: appliEmpTable
|
||||
//Layout.fillHeight: true
|
||||
//height: tableParent.height - (viewCriterion.height + employeeTableHeader.height)
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.verticalStretchFactor: 1
|
||||
columnSpacing: 1
|
||||
height: tableParent.height - employeeTableHeader.height
|
||||
model: employee_model
|
||||
resizableColumns: true
|
||||
rowSpacing: 2
|
||||
alternatingRows: true
|
||||
resizableColumns: true
|
||||
model: employee_model
|
||||
selectionBehavior: TableView.SelectRows
|
||||
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
ScrollBar.vertical: ScrollBar
|
||||
{
|
||||
policy: appliEmpTable.contentHeight > appliEmpTable.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
||||
}
|
||||
delegate: Rectangle {
|
||||
required property bool current
|
||||
required property bool selected
|
||||
|
||||
color: selected ? addEmployeeBtn.palette.highlight //palette.highlight
|
||||
: (appliEmpTable.alternatingRows && row % 2 !== 0 ? addEmployeeBtn.palette.base // palette.base
|
||||
selectionModel: ItemSelectionModel
|
||||
{
|
||||
id: selModel
|
||||
model: appliEmpTable.model
|
||||
}
|
||||
|
||||
|
||||
delegate:Rectangle
|
||||
{
|
||||
required property bool selected
|
||||
required property bool current
|
||||
implicitWidth: appliEmpTable.width / appliEmpTable.columns
|
||||
implicitHeight: 25
|
||||
color: selected
|
||||
? addEmployeeBtn.palette.highlight //palette.highlight
|
||||
: (appliEmpTable.alternatingRows && row % 2 !== 0
|
||||
? addEmployeeBtn.palette.base // palette.base
|
||||
: addEmployeeBtn.palette.alternateBase) //palette.alternateBase)
|
||||
|
||||
implicitHeight: 25
|
||||
implicitWidth: appliEmpTable.width / appliEmpTable.columns
|
||||
|
||||
Text {
|
||||
color: palette.text
|
||||
elide: Text.ElideRight
|
||||
height: parent.height
|
||||
leftPadding: 9 //@d isable-check M16
|
||||
Text
|
||||
{
|
||||
text: (model.display === null || model.display === undefined)? "": model.display
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
}
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
height: parent.height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
leftPadding: 9 //@d isable-check M16
|
||||
color: palette.text
|
||||
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
id: mouseArea
|
||||
property bool hovered:false
|
||||
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
onDoubleClicked: {
|
||||
employeesStack.push("EmployeeDetails.qml", {
|
||||
selectedEmployee: row
|
||||
});
|
||||
onDoubleClicked:
|
||||
{
|
||||
employeesStack.push("EmployeeDetails.qml", {selectedEmployee: row});
|
||||
}
|
||||
|
||||
onEntered:
|
||||
{
|
||||
appliEmpTable.selectionModel.select(appliEmpTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows)
|
||||
}
|
||||
onEntered: {
|
||||
appliEmpTable.selectionModel.select(appliEmpTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows);
|
||||
}
|
||||
}
|
||||
}
|
||||
selectionModel: ItemSelectionModel {
|
||||
id: selModel
|
||||
|
||||
model: appliEmpTable.model
|
||||
}
|
||||
}
|
||||
Item {
|
||||
}
|
||||
|
||||
Item
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// function viewEmployees(criterion)
|
||||
// {
|
||||
// employee_model.viewCriterion(criterion, showProcessed.checked, showFired.checked, showEveryone.checked)
|
||||
// }
|
||||
// Component.onCompleted: employeesStack.pop()
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Layouts
|
||||
import TeroStyle
|
||||
|
||||
|
||||
Item {
|
||||
property string recpass: ""
|
||||
|
||||
@@ -3,133 +3,182 @@ import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
ColumnLayout {
|
||||
ColumnLayout
|
||||
{
|
||||
anchors.fill: parent
|
||||
spacing: Dimensions.l
|
||||
function onObjectContactAdded(added) {
|
||||
console.log(added);
|
||||
if (added)
|
||||
object_model.viewCriterion("");
|
||||
|
||||
function viewCriterion(criterion)
|
||||
{
|
||||
business_model.viewCriterion(criterion.text);
|
||||
}
|
||||
function onObjectContactAdded(added)
|
||||
{
|
||||
console.log(added)
|
||||
if (added) object_model.viewCriterion("")
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
contact_model.objectContactAdded.connect(onObjectContactAdded);
|
||||
objectsStack.pop();
|
||||
Component.onCompleted:
|
||||
{
|
||||
contact_model.objectContactAdded.connect(onObjectContactAdded)
|
||||
objectsStack.pop()
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
RowLayout
|
||||
{
|
||||
Layout.fillWidth: true
|
||||
spacing: Dimensions.l
|
||||
|
||||
SearchBar {
|
||||
SearchBar
|
||||
{
|
||||
}
|
||||
QuickFilter {
|
||||
onSelectedChanged: (name) => {
|
||||
business_model.viewCriterion(name)
|
||||
}
|
||||
|
||||
Button {
|
||||
id: addObjectBtn
|
||||
Layout.alignment: Qt.AlignRight
|
||||
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 {
|
||||
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
id: tableColumn
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.verticalStretchFactor: 1
|
||||
|
||||
clip: true
|
||||
|
||||
HorizontalHeaderView {
|
||||
// anchors
|
||||
// {
|
||||
// top: searchBar.bottom
|
||||
// bottom: parent.bottom
|
||||
// left: parent.left
|
||||
// right: parent.right
|
||||
// topMargin: 15
|
||||
// }
|
||||
HorizontalHeaderView
|
||||
{
|
||||
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
|
||||
border.color: addObjectBtn.palette.base
|
||||
implicitHeight: 40
|
||||
Layout.fillWidth: true
|
||||
implicitWidth: 1
|
||||
|
||||
Text {
|
||||
color: addObjectBtn.palette.text
|
||||
Text
|
||||
{
|
||||
text: model.display
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: model.display
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
width: parent.width
|
||||
color: addObjectBtn.palette.text
|
||||
}
|
||||
}
|
||||
}
|
||||
TableView {
|
||||
id: objectTable
|
||||
|
||||
TableView
|
||||
{
|
||||
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
|
||||
id: objectTable
|
||||
z: 0
|
||||
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
height: tableColumn.height - horizontalHeaderview.height
|
||||
Layout.fillWidth: true
|
||||
columnSpacing: 1
|
||||
rowSpacing: 2
|
||||
model: object_model
|
||||
alternatingRows: true
|
||||
resizableColumns: true // @disable-check M16
|
||||
selectionBehavior: TableView.SelectRows
|
||||
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
|
||||
selectionModel: ItemSelectionModel
|
||||
{
|
||||
id: obmodel
|
||||
model: objectTable.model
|
||||
}
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
||||
delegate:Rectangle
|
||||
{
|
||||
required property bool selected
|
||||
required property bool current
|
||||
implicitWidth: objectTable.width / objectTable.columns
|
||||
implicitHeight: 25
|
||||
color: selected
|
||||
? addObjectBtn.palette.highlight //palette.highlight
|
||||
: (objectTable.alternatingRows && row % 2 !== 0
|
||||
? addObjectBtn.palette.base // palette.base
|
||||
: addObjectBtn.palette.alternateBase) //palette.alternateBase)
|
||||
|
||||
Text
|
||||
{
|
||||
text: (model.display === null || model.display === undefined)? "": model.display
|
||||
elide: Text.ElideRight
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
leftPadding: 9 //@d isable-check M16
|
||||
color: addObjectBtn.palette.text
|
||||
}
|
||||
|
||||
MouseArea
|
||||
{
|
||||
property bool hovered: false
|
||||
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
|
||||
onDoubleClicked: {
|
||||
objectsStack.push("ObjectDetails.qml", {
|
||||
selectedObject: row
|
||||
});
|
||||
onDoubleClicked:
|
||||
{
|
||||
objectsStack.push("ObjectDetails.qml", {selectedObject: row});
|
||||
}
|
||||
onEntered: {
|
||||
objectTable.selectionModel.select(objectTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows);
|
||||
onEntered:
|
||||
{
|
||||
objectTable.selectionModel.select(objectTable.model.index(row, 0), ItemSelectionModel.SelectCurrent | ItemSelectionModel.Rows)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
selectionModel: ItemSelectionModel {
|
||||
id: obmodel
|
||||
|
||||
model: objectTable.model
|
||||
}
|
||||
}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
|
||||
@@ -3,18 +3,72 @@ import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.qmlmodels
|
||||
|
||||
ColumnLayout {
|
||||
property var availableFilters: []
|
||||
|
||||
Layout.fillWidth: true
|
||||
ColumnLayout
|
||||
{
|
||||
anchors.fill: parent
|
||||
function viewOffers(criterion)
|
||||
{
|
||||
//offer_model.viewCriterion(criterion)
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Dimensions.l
|
||||
SearchBar {
|
||||
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
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ Item
|
||||
if (db['database']['DB_HOST'] === '' || db['database']['DB_PORT'] === '' ||
|
||||
db['database']['DB_NAME'] === '' || db['database']['DB_USER'] === '' ||
|
||||
db['database']['DB_PASS'] === '');
|
||||
else config.saveDbConf(company)
|
||||
else config.saveDbConf(db)
|
||||
}
|
||||
|
||||
function updateCompanyInfo()
|
||||
|
||||
@@ -2,6 +2,7 @@ import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
|
||||
TextField {
|
||||
Layout.preferredWidth: 300
|
||||
placeholderText: qsTr("Suche")
|
||||
|
||||
262
Gui/TopBar.qml
@@ -2,12 +2,12 @@ import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
RowLayout
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
id: topBar
|
||||
spacing: 0
|
||||
height: 35
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
@@ -15,193 +15,223 @@ RowLayout
|
||||
|
||||
|
||||
}
|
||||
ButtonGroup
|
||||
{
|
||||
id: buttonBar
|
||||
}
|
||||
|
||||
Button
|
||||
BarButton
|
||||
{
|
||||
id: dashBoard
|
||||
flat: true
|
||||
text: qsTr("Dashboard")
|
||||
implicitWidth: abrechnung.implicitContentWidth + 10
|
||||
implicitWidth: 90
|
||||
implicitHeight: 90
|
||||
Layout.margins: 3
|
||||
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" }
|
||||
}
|
||||
}
|
||||
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
|
||||
|
||||
|
||||
// dashiBackie.border.width = 2
|
||||
// kundiBackie.border.width = 1
|
||||
// mitoBackie.border.width = 1
|
||||
// invoBackie.border.width = 1
|
||||
// objBackie.border.width = 1
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
BarButton
|
||||
{
|
||||
id: kunden
|
||||
flat: true
|
||||
text: qsTr("Kunden")
|
||||
implicitWidth: abrechnung.implicitContentWidth + 10
|
||||
implicitWidth: 90
|
||||
implicitHeight: 90
|
||||
Layout.margins: 3
|
||||
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" }
|
||||
}
|
||||
}
|
||||
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
|
||||
// kundiBackie.border.width = 2
|
||||
// dashiBackie.border.width = 1
|
||||
// mitoBackie.border.width = 1
|
||||
// invoBackie.border.width = 1
|
||||
// objBackie.border.width = 1
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
BarButton
|
||||
{
|
||||
id: objekt
|
||||
flat: true
|
||||
text: qsTr("Objekt")
|
||||
implicitWidth: abrechnung.implicitContentWidth + 10
|
||||
implicitWidth: 90
|
||||
implicitHeight: 90
|
||||
Layout.margins: 3
|
||||
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" }
|
||||
}
|
||||
}
|
||||
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
|
||||
// objBackie.border.width = 2
|
||||
// dashiBackie.border.width = 1
|
||||
// kundiBackie.border.width = 1
|
||||
// mitoBackie.border.width = 1
|
||||
// invoBackie.border.width = 1
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Button
|
||||
BarButton
|
||||
{
|
||||
id: mitarbeiter
|
||||
flat: true
|
||||
text: qsTr("Mitarbeiter")
|
||||
implicitWidth: abrechnung.implicitContentWidth + 10
|
||||
implicitWidth: 90
|
||||
implicitHeight: 90
|
||||
Layout.margins: 3
|
||||
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" }
|
||||
}
|
||||
}
|
||||
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
|
||||
// mitoBackie.border.width = 2
|
||||
// dashiBackie.border.width = 1
|
||||
// kundiBackie.border.width = 1
|
||||
// invoBackie.border.width = 1
|
||||
// objBackie.border.width = 1
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
BarButton
|
||||
{
|
||||
id: offers
|
||||
flat: true
|
||||
text: qsTr("Angebote")
|
||||
implicitWidth: abrechnung.implicitContentWidth + 10
|
||||
implicitWidth: 90
|
||||
implicitHeight: 90
|
||||
Layout.margins: 3
|
||||
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" }
|
||||
}
|
||||
}
|
||||
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
|
||||
// mitoBackie.border.width = 2
|
||||
// dashiBackie.border.width = 1
|
||||
// kundiBackie.border.width = 1
|
||||
// invoBackie.border.width = 1
|
||||
// objBackie.border.width = 1
|
||||
// offersBackie.border.width = 1
|
||||
}
|
||||
}
|
||||
|
||||
Button
|
||||
BarButton
|
||||
{
|
||||
id: abrechnung
|
||||
flat: true
|
||||
text: qsTr("Abrechnung")
|
||||
implicitWidth: abrechnung.implicitContentWidth + 10
|
||||
implicitWidth: 90
|
||||
implicitHeight: 90
|
||||
Layout.margins: 3
|
||||
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" }
|
||||
}
|
||||
}
|
||||
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.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
Button
|
||||
BarButton
|
||||
{
|
||||
id: atajos
|
||||
implicitWidth: 90
|
||||
implicitHeight: 90
|
||||
checkable: false
|
||||
icon.source: "qrc:/images/Bars3.svg"
|
||||
|
||||
flat: true
|
||||
Layout.rightMargin: 9
|
||||
Layout.bottomMargin: Dimensions.s
|
||||
onClicked: mainMenu.open()
|
||||
|
||||
Menu {
|
||||
|
||||
16
Gui/main.qml
@@ -21,14 +21,7 @@ ApplicationWindow
|
||||
|
||||
TopBar
|
||||
{
|
||||
|
||||
id:topBar
|
||||
anchors
|
||||
{
|
||||
rightMargin: 9
|
||||
leftMargin: 9
|
||||
}
|
||||
|
||||
visible: bad_config || !db_con ? false: true
|
||||
}
|
||||
|
||||
@@ -53,11 +46,18 @@ ApplicationWindow
|
||||
|
||||
anchors
|
||||
{
|
||||
fill: parent
|
||||
left: topBar.right
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
|
||||
|
||||
|
||||
topMargin: Dimensions.l
|
||||
bottomMargin: Dimensions.l
|
||||
rightMargin: Dimensions.l
|
||||
leftMargin: Dimensions.l
|
||||
|
||||
}
|
||||
|
||||
property alias window: appWindow
|
||||
|
||||
87
TeroStyle/BarButton.qml
Normal file
@@ -0,0 +1,87 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls
|
||||
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
|
||||
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
|
||||
{
|
||||
|
||||
|
||||
x: parent.width * .5 - width * .5
|
||||
// height: icon.height
|
||||
// width: icon.width
|
||||
icon: control.icon
|
||||
|
||||
// display: control.display
|
||||
|
||||
|
||||
}
|
||||
Label
|
||||
{
|
||||
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"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,110 +1,246 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Templates as T
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.ComboBox {
|
||||
id: control
|
||||
|
||||
font: Typography.body
|
||||
implicitHeight: implicitContentHeight + topInset + bottomInset
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
background: Rectangle {
|
||||
border.color: Colors.interactive
|
||||
border.width: 1
|
||||
color: Colors.mantle
|
||||
height: parent.height
|
||||
radius: Dimensions.radius
|
||||
width: parent.width
|
||||
}
|
||||
contentItem: T.TextField {
|
||||
autoScroll: control.editable
|
||||
color: Colors.foreground
|
||||
enabled: control.editable
|
||||
font: Typography.body
|
||||
implicitHeight: Typography.body.pointSize + 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
|
||||
}
|
||||
delegate: MenuItem {
|
||||
id: menuItem
|
||||
leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
|
||||
rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
|
||||
|
||||
required property int index
|
||||
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
|
||||
text: model[control.textRole]
|
||||
width: control.width
|
||||
}
|
||||
|
||||
indicator: ColorImage {
|
||||
x: control.mirrored ? control.padding : control.width - width - control.padding
|
||||
y: control.topPadding + (control.availableHeight - height) / 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 {
|
||||
color: menuItem.down || menuItem.highlighted ? Colors.primary : "transparent"
|
||||
height: menuItem.height
|
||||
width: menuItem.width
|
||||
}
|
||||
}
|
||||
indicator: Rectangle {
|
||||
id: indicator
|
||||
|
||||
visible: control.enabled && control.editable && !control.flat
|
||||
border.width: parent && parent.activeFocus ? 2 : 1
|
||||
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
|
||||
color: Colors.mantle
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
contentItem: ListView {
|
||||
clip: true
|
||||
currentIndex: control.highlightedIndex
|
||||
implicitHeight: contentHeight
|
||||
model: control.popup.visible ? control.delegateModel : null
|
||||
model: control.delegateModel
|
||||
currentIndex: control.highlightedIndex
|
||||
highlightMoveDuration: 0
|
||||
|
||||
T.ScrollBar.vertical: ScrollBar {
|
||||
}
|
||||
highlight: Rectangle {
|
||||
color: Colors.primary
|
||||
opacity: Colors.highlightOpacity
|
||||
}
|
||||
Rectangle {
|
||||
z: 10
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
color: "transparent"
|
||||
border.color: control.palette.mid
|
||||
}
|
||||
|
||||
T.ScrollIndicator.vertical: ScrollIndicator { }
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: control.palette.window
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 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)
|
||||
// }
|
||||
// }
|
||||
|
||||
@@ -2,7 +2,8 @@ pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
|
||||
QtObject {
|
||||
QtObject
|
||||
{
|
||||
/**
|
||||
* Distance for objects that are tied to each other,
|
||||
* e.g. a field and its label.
|
||||
|
||||
@@ -2,11 +2,13 @@ import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
ColumnLayout {
|
||||
ColumnLayout
|
||||
{
|
||||
required property string label
|
||||
spacing: Dimensions.s
|
||||
|
||||
Label {
|
||||
Label
|
||||
{
|
||||
text: label
|
||||
font: Typography.body
|
||||
}
|
||||
|
||||
@@ -1,23 +1,30 @@
|
||||
import QtQuick
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.TextField {
|
||||
T.TextField
|
||||
{
|
||||
id: control
|
||||
background: Rectangle {
|
||||
background: Rectangle
|
||||
{
|
||||
id: background
|
||||
color: Colors.mantle
|
||||
radius: Dimensions.radius
|
||||
border.width: !control.focus ? 1 : 2
|
||||
border.color: Colors.interactive
|
||||
height: 47
|
||||
height: control.implicitHeight
|
||||
}
|
||||
|
||||
color: Colors.foreground
|
||||
implicitHeight: background.height
|
||||
implicitHeight: Typography.body.pixelSize + topPadding + bottomPadding
|
||||
placeholderTextColor: Colors.interactive
|
||||
font: Typography.body
|
||||
padding: Dimensions.m
|
||||
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Placeholder
|
||||
*/
|
||||
@@ -36,3 +43,4 @@ T.TextField {
|
||||
renderType: control.renderType
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,15 @@ pragma Singleton
|
||||
import QtCore
|
||||
import QtQuick
|
||||
|
||||
Item {
|
||||
readonly property FontLoader robotoCondensed: FontLoader {
|
||||
Item
|
||||
{
|
||||
readonly property FontLoader robotoCondensed: FontLoader
|
||||
{
|
||||
source: "qrc:/fonts/RobotoCondensed.otf"
|
||||
}
|
||||
|
||||
readonly property font body: ({
|
||||
readonly property font body:
|
||||
({
|
||||
family: robotoCondensed.font,
|
||||
pointSize: 16,
|
||||
weight: Font.Medium,
|
||||
@@ -16,11 +19,22 @@ Item {
|
||||
kerning: true,
|
||||
})
|
||||
|
||||
readonly property font h1: ({
|
||||
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,
|
||||
})
|
||||
|
||||
}
|
||||
@@ -5,6 +5,10 @@ singleton Typography Typography.qml
|
||||
Button Button.qml
|
||||
ComboBox ComboBox.qml
|
||||
Field Field.qml
|
||||
TextField TextField.qml
|
||||
BarButton BarButton.qml
|
||||
Label Label.qml
|
||||
QuickFilter QuickFilter.qml
|
||||
TextField TextField.qml
|
||||
|
||||
|
||||
|
||||
|
||||
3
images/contract.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg data-slot="icon" fill="none" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M12 7.5h1.5m-1.5 3h1.5m-7.5 3h7.5m-7.5 3h7.5m3-9h3.375c.621 0 1.125.504 1.125 1.125V18a2.25 2.25 0 0 1-2.25 2.25M16.5 7.5V18a2.25 2.25 0 0 0 2.25 2.25M16.5 7.5V4.875c0-.621-.504-1.125-1.125-1.125H4.125C3.504 3.75 3 4.254 3 4.875V18a2.25 2.25 0 0 0 2.25 2.25h13.5M6 7.5h3v3H6v-3Z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 501 B |
3
images/customer.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg data-slot="icon" fill="none" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 733 B |
3
images/dash.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg data-slot="icon" fill="none" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6.429 9.75 2.25 12l4.179 2.25m0-4.5 5.571 3 5.571-3m-11.142 0L2.25 7.5 12 2.25l9.75 5.25-4.179 2.25m0 0L21.75 12l-4.179 2.25m0 0 4.179 2.25L12 21.75 2.25 16.5l4.179-2.25m11.142 0-5.571 3-5.571-3"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 418 B |
3
images/employee.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg data-slot="icon" fill="none" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15 9h3.75M15 12h3.75M15 15h3.75M4.5 19.5h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Zm6-10.125a1.875 1.875 0 1 1-3.75 0 1.875 1.875 0 0 1 3.75 0Zm1.294 6.336a6.721 6.721 0 0 1-3.17.789 6.721 6.721 0 0 1-3.168-.789 3.376 3.376 0 0 1 6.338 0Z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 539 B |
3
images/invoice.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg data-slot="icon" fill="none" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M21 12a2.25 2.25 0 0 0-2.25-2.25H15a3 3 0 1 1-6 0H5.25A2.25 2.25 0 0 0 3 12m18 0v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 9m18 0V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v3"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 490 B |
3
images/object.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg data-slot="icon" fill="none" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M2.25 21h19.5m-18-18v18m10.5-18v18m6-13.5V21M6.75 6.75h.75m-.75 3h.75m-.75 3h.75m3-6h.75m-.75 3h.75m-.75 3h.75M6.75 21v-3.375c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21M3 3h12m-.75 4.5H21m-3.75 3.75h.008v.008h-.008v-.008Zm0 3h.008v.008h-.008v-.008Zm0 3h.008v.008h-.008v-.008Z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 521 B |
3
images/offer.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg data-slot="icon" fill="none" stroke-width="2" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 6.878V6a2.25 2.25 0 0 1 2.25-2.25h7.5A2.25 2.25 0 0 1 18 6v.878m-12 0c.235-.083.487-.128.75-.128h10.5c.263 0 .515.045.75.128m-12 0A2.25 2.25 0 0 0 4.5 9v.878m13.5-3A2.25 2.25 0 0 1 19.5 9v.878m0 0a2.246 2.246 0 0 0-.75-.128H5.25c-.263 0-.515.045-.75.128m15 0A2.25 2.25 0 0 1 21 12v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6c0-.98.626-1.813 1.5-2.122"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 589 B |
@@ -16,5 +16,13 @@
|
||||
<file>fonts/RobotoCondensed.otf</file>
|
||||
<file>README</file>
|
||||
<file>LICENSE</file>
|
||||
<file>images/tero.jpg</file>
|
||||
<file>images/dash.svg</file>
|
||||
<file>images/invoice.svg</file>
|
||||
<file>images/offer.svg</file>
|
||||
<file>images/employee.svg</file>
|
||||
<file>images/customer.svg</file>
|
||||
<file>images/contract.svg</file>
|
||||
<file>images/object.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||