MainMenu.qml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import QtQuick 2.15
  2. import QtQuick.Controls 2.15
  3. Drawer {
  4. property alias logo: logoImage.source
  5. property alias appName: appNameLabel.text
  6. property alias model: menuRepeater.model
  7. signal actionSelected(var action)
  8. width: parent.width * 0.66
  9. height: parent.height
  10. Column {
  11. anchors.fill: parent
  12. Row {
  13. width: parent.width
  14. height: 100
  15. Image {
  16. id: logoImage
  17. anchors.top: parent.top
  18. anchors.bottom: parent.bottom
  19. anchors.margins: 10
  20. }
  21. Label {
  22. id: appNameLabel
  23. anchors.verticalCenter: parent.verticalCenter
  24. font.pointSize: 20
  25. text: qsTr("BeerLog v0.1")
  26. }
  27. }
  28. Repeater {
  29. id: menuRepeater
  30. delegate: ItemDelegate {
  31. width: parent.width
  32. text: model.title
  33. onClicked: actionSelected(model.action)
  34. }
  35. }
  36. }
  37. }