BarButton still in progress

This commit is contained in:
2025-03-20 09:19:03 +01:00
parent c49e4ebacd
commit ce26d6d223
14 changed files with 271 additions and 125 deletions

View File

@@ -2,11 +2,11 @@ import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
RowLayout
ColumnLayout
{
id: topBar
spacing: 0
width: parent.width
height: parent.height
anchors
{
top: parent.top
@@ -15,194 +15,217 @@ RowLayout
}
Button
BarButton
{
id: dashBoard
flat: true
text: qsTr("Dashboard")
implicitWidth: abrechnung.implicitContentWidth + 10
implicitWidth: 90
implicitHeight: 90
Layout.margins: 3
Layout.leftMargin: 0
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"
// 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"
// 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"
// 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"
// 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"
// 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"
// 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
icon.source: "qrc:/images/menu.svg"
icon.color: "red"
implicitWidth: 90
implicitHeight: 90
flat: true
Layout.rightMargin: 9
Layout.bottomMargin: Dimensions.s
onClicked: mainMenu.open()
Menu {

View File

@@ -51,14 +51,11 @@ ApplicationWindow
anchors
{
left: parent.left
left: topBar.right
right: parent.right
top: topBar.bottom
top: parent.top
bottom: parent.bottom
topMargin: 0
bottomMargin: 5
rightMargin: 9
leftMargin: 9
margins: Dimensions.s
}
property alias window: appWindow