PlaylistPage.qml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. import QtQuick 2.15
  2. import QtQuick.Controls 2.15
  3. import QtQuick.Layouts 1.15
  4. import DuneWeaver 1.0
  5. Page {
  6. header: ToolBar {
  7. RowLayout {
  8. anchors.fill: parent
  9. anchors.margins: 10
  10. Button {
  11. text: "← Back"
  12. font.pixelSize: 14
  13. flat: true
  14. onClicked: stackView.pop()
  15. }
  16. Label {
  17. text: "Playlists"
  18. Layout.fillWidth: true
  19. font.pixelSize: 20
  20. font.bold: true
  21. }
  22. }
  23. }
  24. PlaylistModel {
  25. id: playlistModel
  26. }
  27. ListView {
  28. anchors.fill: parent
  29. anchors.margins: 20
  30. model: playlistModel
  31. spacing: 10
  32. delegate: Rectangle {
  33. width: parent.width
  34. height: 80
  35. color: mouseArea.pressed ? "#e0e0e0" : "#f5f5f5"
  36. radius: 8
  37. border.color: "#d0d0d0"
  38. RowLayout {
  39. anchors.fill: parent
  40. anchors.margins: 15
  41. spacing: 15
  42. Column {
  43. Layout.fillWidth: true
  44. spacing: 5
  45. Label {
  46. text: model.name
  47. font.pixelSize: 16
  48. font.bold: true
  49. }
  50. Label {
  51. text: model.itemCount + " patterns"
  52. color: "#666"
  53. font.pixelSize: 14
  54. }
  55. }
  56. Button {
  57. text: "Play"
  58. Layout.preferredWidth: 80
  59. Layout.preferredHeight: 40
  60. font.pixelSize: 14
  61. enabled: false // TODO: Implement playlist execution
  62. }
  63. }
  64. MouseArea {
  65. id: mouseArea
  66. anchors.fill: parent
  67. onClicked: {
  68. // TODO: Navigate to playlist detail page
  69. }
  70. }
  71. }
  72. }
  73. Label {
  74. anchors.centerIn: parent
  75. text: "No playlists found"
  76. visible: playlistModel.rowCount() === 0
  77. color: "#999"
  78. font.pixelSize: 18
  79. }
  80. }