some more experiments

This commit is contained in:
Blue 2024-04-09 18:04:07 -03:00
parent 9b7cea725f
commit cdde0b9e2e
Signed by: blue
GPG key ID: 9B203B252A63EE38
3 changed files with 48 additions and 100 deletions

View file

@ -44,77 +44,6 @@ Item {
onRemove: id => item.remove(id)
onEdit: id => item.edit(id)
}
// model: TableModel {
// TableModelColumn { display: "icon"; decoration: "color" }
// TableModelColumn { display: "title" }
// TableModelColumn { display: "balance" }
// TableModelColumn { display: "currency" }
// TableModelColumn { display: "assetID" }
// TableModelColumn { display: "assetID" }
// }
// delegate: DelegateChooser {
// property int iconSize: 40
// DelegateChoice {
// column: 0
// delegate: Rectangle {
// implicitWidth: iconSize
// implicitHeight: iconSize
// color: model.decoration
// Components.Icon {
// anchors.fill: parent
// anchors.margins: 2
// iconName: model.display
// color: pickColor(model.decoration)
// }
// }
// }
// DelegateChoice {
// column: 1
// delegate: Label {
// text: model.display
// verticalAlignment: Text.AlignVCenter
// font.bold: true
// }
// }
// DelegateChoice {
// column: 2
// delegate: Label {
// text: model.display
// verticalAlignment: Text.AlignVCenter
// }
// }
// DelegateChoice {
// column: 3
// delegate: Label {
// text: model.display
// verticalAlignment: Text.AlignVCenter
// }
// }
// DelegateChoice {
// column: 4
// delegate: Button {
// text: qsTr("Edit")
// icon.name: "entry-edit"
// flat: true
// onClicked: edit(model.display)
// }
// }
// DelegateChoice {
// column: 5
// delegate: Button {
// text: qsTr("Delete")
// icon.name: "delete"
// onClicked: remove(model.display)
// palette { //unfortunately doesn't work anymore
// button: "red"
// }
// }
// }
// }
}
}

View file

@ -16,14 +16,10 @@ Item {
Column {
id: menu
// Layout.fillWidth: true
// Layout.minimumWidth: 50
Layout.preferredWidth: children[3].implicitWidth
// Layout.maximumWidth: 100
Layout.alignment: Qt.AlignTop
MenuItem {
width: parent.width
width: Math.max(parent.implicitWidth, implicitWidth)
text: qsTr("Home")
icon.name: "home"
highlighted: currentPage === "home"
@ -33,7 +29,7 @@ Item {
}
}
MenuItem {
width: parent.width
width: Math.max(parent.implicitWidth, implicitWidth)
text: qsTr("Assets")
icon.name: "document-properties"
highlighted: currentPage === "assets"
@ -43,7 +39,7 @@ Item {
}
}
MenuItem {
width: parent.width
width: Math.max(parent.implicitWidth, implicitWidth)
text: qsTr("Records")
icon.name: "system-search"
highlighted: currentPage === "records"
@ -54,7 +50,7 @@ Item {
}
MenuItem {
width: parent.width
width: Math.max(parent.implicitWidth, implicitWidth)
text: qsTr("Currencies")
icon.name: "format-currency"
highlighted: currentPage === "currencies"
@ -73,32 +69,57 @@ Item {
Component {
id: home
Home {
Item {
StackView.onActivating: currentPage = "home"
Home {
anchors {
fill: parent
margins: 5
}
}
}
}
Component {
id: assets
Assets {
Item {
StackView.onActivating: currentPage = "assets"
onAdd: addAsset()
onRemove: id => removeAsset(id)
onEdit: id => editAsset(id)
Assets {
anchors {
fill: parent
margins: 5
}
onAdd: addAsset()
onRemove: id => removeAsset(id)
onEdit: id => editAsset(id)
}
}
}
Component {
id: records
Records {
Item {
StackView.onActivating: currentPage = "records"
Records {
anchors {
fill: parent
margins: 5
}
}
}
}
Component {
id: currencies
Currencies {
Item {
StackView.onActivating: currentPage = "currencies"
Currencies {
anchors {
fill: parent
margins: 5
}
}
}
}
}