Compare commits

..

6 Commits

Author SHA256 Message Date
7b8c3630f8 searchbar aligned 2025-03-25 11:15:25 +01:00
d125b56564 Merge branch 'main' of https://git.danielsto.de/Linuxero/pyqcrm 2025-03-25 00:24:28 +01:00
Yuri Becker
7f5675c06d Add Hover Effect to Buttons 2025-03-24 12:06:09 +01:00
Yuri Becker
30493dbdbf Fix Offers View 2025-03-24 11:41:07 +01:00
Yuri Becker
41ecdb658c Fix Objects Table 2025-03-24 11:36:09 +01:00
6e8c2f340c added barbutton, searchbar and qucickfilter positioning, combobox still not finished 2025-03-24 11:31:00 +01:00
20 changed files with 529 additions and 3655 deletions

View File

@@ -13,7 +13,6 @@ Item {
id: customersStack id: customersStack
anchors.fill: parent anchors.fill: parent
initialItem: "CustomersTable.qml" initialItem: "CustomersTable.qml"
anchors.topMargin: Dimensions.m
} }
} }

View File

@@ -19,15 +19,13 @@ ColumnLayout {
RowLayout RowLayout
{ {
// Layout.fillWidth: true Layout.fillWidth: true
// Layout.horizontalStretchFactor: 1 spacing: Dimensions.l
// spacing: Dimensions.l
SearchBar SearchBar
{ {
} }
QuickFilter { QuickFilter {
onSelectedChanged: (name) => { onSelectedChanged: (name) => {
business_model.viewCriterion(name) business_model.viewCriterion(name)
@@ -74,6 +72,9 @@ ColumnLayout {
} }
ColumnLayout ColumnLayout
{ {
Layout.fillWidth: true
Layout.fillHeight: true
Layout.verticalStretchFactor: 1
clip: true clip: true
HorizontalHeaderView HorizontalHeaderView
@@ -167,9 +168,9 @@ ColumnLayout {
model: customerTable.model model: customerTable.model
} }
} }
Item {
Layout.fillWidth: true
}
}
}
Item {
Layout.fillHeight: true
}
} }

View File

@@ -11,7 +11,6 @@ Item {
anchors.fill: parent anchors.fill: parent
initialItem: "EmployeesTable.qml" initialItem: "EmployeesTable.qml"
anchors.topMargin: Dimensions.m
} }
} }

View File

@@ -13,11 +13,14 @@ ColumnLayout
} }
anchors.fill: parent anchors.fill: parent
spacing: Dimensions.l
Component.onCompleted: employeesStack.pop() Component.onCompleted: employeesStack.pop()
// property var availableFilters: ["Name", "Adresse", "PLZ", "Ort", "Status"] // property var availableFilters: ["Name", "Adresse", "PLZ", "Ort", "Status"]
RowLayout RowLayout
{ {
Layout.fillWidth: true
spacing: Dimensions.l
SearchBar SearchBar
{ {
id:searchBar id:searchBar
@@ -71,98 +74,6 @@ ColumnLayout
} }
// ButtonGroup
// {
// id: criterion
// // buttons: criterion.children
// onClicked:
// {
// viewEmployees(criterion.checkedButton.text)
// }
// }
// ColumnLayout
// {
// id: tableParent
// clip: true
// anchors
// {
// top: searchBar.bottom
// bottom: parent.bottom
// left: parent.left
// right: parent.right
// }
// RowLayout
// {
// id: viewCriterion
// 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 HorizontalHeaderView
{ {
id: employeeTableHeader id: employeeTableHeader
@@ -203,7 +114,7 @@ ColumnLayout
resizableColumns: true resizableColumns: true
model: employee_model model: employee_model
selectionBehavior: TableView.SelectRows selectionBehavior: TableView.SelectRows
z: 1
ScrollBar.vertical: ScrollBar ScrollBar.vertical: ScrollBar
{ {
policy: appliEmpTable.contentHeight > appliEmpTable.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff policy: appliEmpTable.contentHeight > appliEmpTable.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff

View File

@@ -5,13 +5,13 @@ import Qt.labs.qmlmodels
Item { Item {
property var availableFilters: [""] property var availableFilters: [""]
anchors.fill: parent
StackView StackView
{ {
id: objectsStack id: objectsStack
anchors.fill: parent anchors.fill: parent
initialItem: "ObjectsTable.qml" initialItem: "ObjectsTable.qml"
anchors.topMargin: Dimensions.m
} }
} }

26
Gui/ObjectTable.qml.orig Normal file
View File

@@ -0,0 +1,26 @@
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
}
}

View File

@@ -0,0 +1,26 @@
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
}
}

View File

@@ -0,0 +1,22 @@
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
}
}

View File

@@ -0,0 +1,22 @@
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
}
}

View File

@@ -0,0 +1,22 @@
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"
}
}

View File

@@ -5,6 +5,9 @@ import Qt.labs.qmlmodels
ColumnLayout ColumnLayout
{ {
anchors.fill: parent
spacing: Dimensions.l
function viewCriterion(criterion) function viewCriterion(criterion)
{ {
business_model.viewCriterion(criterion.text); business_model.viewCriterion(criterion.text);
@@ -15,8 +18,6 @@ ColumnLayout
if (added) object_model.viewCriterion("") if (added) object_model.viewCriterion("")
} }
anchors.fill: parent
Component.onCompleted: Component.onCompleted:
{ {
contact_model.objectContactAdded.connect(onObjectContactAdded) contact_model.objectContactAdded.connect(onObjectContactAdded)
@@ -24,9 +25,10 @@ ColumnLayout
} }
RowLayout RowLayout
{ {
Layout.fillWidth: true
spacing: Dimensions.l
SearchBar SearchBar
{ {
} }
QuickFilter { QuickFilter {
onSelectedChanged: (name) => { onSelectedChanged: (name) => {
@@ -76,6 +78,9 @@ ColumnLayout
ColumnLayout ColumnLayout
{ {
id: tableColumn id: tableColumn
Layout.fillWidth: true
Layout.fillHeight: true
Layout.verticalStretchFactor: 1
clip: true clip: true
// anchors // anchors
// { // {
@@ -90,7 +95,6 @@ ColumnLayout
id: horizontalHeaderview id: horizontalHeaderview
Layout.fillWidth: true Layout.fillWidth: true
implicitHeight: 40 implicitHeight: 40
//visible: false
movableColumns: true //@disable-check M16 movableColumns: true //@disable-check M16
syncView: objectTable syncView: objectTable
@@ -117,8 +121,9 @@ ColumnLayout
{ {
property real newWidth: 0 property real newWidth: 0
id: objectTable id: objectTable
z: 0 z: 1
height: tableColumn.height - horizontalHeaderview.height // height: tableColumn.height - horizontalHeaderview.height
Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
columnSpacing: 1 columnSpacing: 1
rowSpacing: 2 rowSpacing: 2
@@ -175,40 +180,10 @@ ColumnLayout
} }
} }
} }
// onContentWidthChanged:
// {
// redrawTable.start()
// }
} }
} }
Item Item {
{
Layout.fillHeight: true 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("")
// }
} }

257
Gui/ObjectsTable.qml.orig Normal file
View File

@@ -0,0 +1,257 @@
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
}

View File

@@ -6,12 +6,12 @@ import Qt.labs.qmlmodels
Item Item
{ {
anchors.fill: parent
StackView StackView
{ {
id: employeesStack id: offersStack
anchors.fill: parent anchors.fill: parent
initialItem: "OffersTable.qml" initialItem: "OffersTable.qml"
anchors.topMargin: Dimensions.m
} }
} }

22
Gui/OfferTable.qml.orig Normal file
View File

@@ -0,0 +1,22 @@
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
}
}

View File

@@ -6,6 +6,7 @@ import Qt.labs.qmlmodels
ColumnLayout ColumnLayout
{ {
anchors.fill: parent anchors.fill: parent
spacing: Dimensions.l
function viewOffers(criterion) function viewOffers(criterion)
{ {
//offer_model.viewCriterion(criterion) //offer_model.viewCriterion(criterion)
@@ -13,9 +14,11 @@ ColumnLayout
RowLayout RowLayout
{ {
Layout.fillWidth: true
spacing: Dimensions.l
SearchBar SearchBar
{ {
id:searchBar id: searchBar
} }
QuickFilter QuickFilter
{ {

90
Gui/OffersTable.qml.orig Normal file
View File

@@ -0,0 +1,90 @@
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
}
}

View File

@@ -43,7 +43,7 @@ T.Button {
border.color: Colors.interactive border.color: Colors.interactive
border.width: isFieldButton ? 1 : 0 border.width: isFieldButton ? 1 : 0
bottomLeftRadius: topLeftRadius bottomLeftRadius: topLeftRadius
color: Colors.primary color: !control.hovered ? Colors.primary : Colors.primaryLighter
radius: Dimensions.radius radius: Dimensions.radius
topLeftRadius: isFieldButton ? 0 : radius topLeftRadius: isFieldButton ? 0 : radius
} }

View File

@@ -8,9 +8,10 @@ QtObject {
property int theme: Application.styleHints.colorScheme === Qt.ColorScheme.Light ? light : dark property int theme: Application.styleHints.colorScheme === Qt.ColorScheme.Light ? light : dark
property color primary: "#b81a34" readonly property color primary: "#b81a34"
property color primaryContrast: "#fdfdfd" readonly property color primaryContrast: "#fdfdfd"
property color foreground: theme === dark ? "#fdfdfd" : "#110b0c" readonly property color primaryLighter: Qt.lighter(primary, 1.5)
readonly property color foreground: theme === dark ? "#fdfdfd" : "#110b0c"
readonly property color background: theme === dark ? "#303136" : "#eff1f5" readonly property color background: theme === dark ? "#303136" : "#eff1f5"
readonly property color mantle: theme === dark ? "#1e1f22" : "#e7e9ef" readonly property color mantle: theme === dark ? "#1e1f22" : "#e7e9ef"
readonly property color interactive: theme === dark ? "#878b97" : "#d9d9da" readonly property color interactive: theme === dark ? "#878b97" : "#d9d9da"

View File

@@ -19,6 +19,7 @@ RowLayout {
required property int index required property int index
required property var modelData required property var modelData
property bool hovered: false
property real padding: Dimensions.m property real padding: Dimensions.m
height: text.height + padding * 2 height: text.height + padding * 2
@@ -28,7 +29,7 @@ RowLayout {
anchors.fill: parent anchors.fill: parent
border.color: modelData.selected ? Colors.transparent : Colors.foreground border.color: modelData.selected ? Colors.transparent : Colors.foreground
border.width: 2 border.width: 2
color: modelData.selected ? Colors.primary : Colors.transparent color: modelData.selected || mouseArea.containsMouse ? Colors.primary : Colors.transparent
radius: parent.height radius: parent.height
} }
Text { Text {
@@ -41,6 +42,9 @@ RowLayout {
y: parent.padding y: parent.padding
} }
MouseArea { MouseArea {
id: mouseArea
hoverEnabled: true
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor

File diff suppressed because it is too large Load Diff