MainMenu.qml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. property alias additional: additionalLabel.sourceComponent
  8. signal actionSelected(var action)
  9. width: parent.width * 0.66
  10. height: parent.height
  11. Column {
  12. anchors.fill: parent
  13. Row {
  14. width: parent.width
  15. height: 100
  16. Image {
  17. id: logoImage
  18. anchors.top: parent.top
  19. anchors.bottom: parent.bottom
  20. anchors.margins: 10
  21. }
  22. Column {
  23. anchors.verticalCenter: parent.verticalCenter
  24. Label {
  25. id: appNameLabel
  26. font.pointSize: 20
  27. }
  28. Loader {
  29. id: additionalLabel
  30. }
  31. }
  32. }
  33. Repeater {
  34. id: menuRepeater
  35. delegate: ItemDelegate {
  36. width: parent.width
  37. text: model.title
  38. onClicked: actionSelected(model.action)
  39. }
  40. }
  41. }
  42. }