PlaylistPage.qml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. import QtQuick 2.15
  2. import QtQuick.Controls 2.15
  3. import QtQuick.Layouts 1.15
  4. import DuneWeaver 1.0
  5. import "../components" as Components
  6. Page {
  7. background: Rectangle {
  8. color: Components.ThemeManager.backgroundColor
  9. }
  10. header: ToolBar {
  11. background: Rectangle {
  12. color: Components.ThemeManager.surfaceColor
  13. border.color: Components.ThemeManager.borderColor
  14. border.width: 1
  15. }
  16. RowLayout {
  17. anchors.fill: parent
  18. anchors.margins: 10
  19. Button {
  20. text: "← Back"
  21. font.pixelSize: 14
  22. flat: true
  23. onClicked: stackView.pop()
  24. contentItem: Text {
  25. text: parent.text
  26. font: parent.font
  27. color: Components.ThemeManager.textPrimary
  28. horizontalAlignment: Text.AlignHCenter
  29. verticalAlignment: Text.AlignVCenter
  30. }
  31. }
  32. Label {
  33. text: "Playlists"
  34. Layout.fillWidth: true
  35. font.pixelSize: 20
  36. font.bold: true
  37. color: Components.ThemeManager.textPrimary
  38. }
  39. }
  40. }
  41. PlaylistModel {
  42. id: playlistModel
  43. }
  44. ListView {
  45. anchors.fill: parent
  46. anchors.margins: 20
  47. model: playlistModel
  48. spacing: 10
  49. delegate: Rectangle {
  50. width: parent.width
  51. height: 80
  52. color: mouseArea.pressed ? Components.ThemeManager.buttonBackgroundHover : Components.ThemeManager.cardColor
  53. radius: 8
  54. border.color: Components.ThemeManager.borderColor
  55. RowLayout {
  56. anchors.fill: parent
  57. anchors.margins: 15
  58. spacing: 15
  59. Column {
  60. Layout.fillWidth: true
  61. spacing: 5
  62. Label {
  63. text: model.name
  64. font.pixelSize: 16
  65. font.bold: true
  66. color: Components.ThemeManager.textPrimary
  67. }
  68. Label {
  69. text: model.itemCount + " patterns"
  70. color: Components.ThemeManager.textSecondary
  71. font.pixelSize: 14
  72. }
  73. }
  74. Button {
  75. text: "Play"
  76. Layout.preferredWidth: 80
  77. Layout.preferredHeight: 40
  78. font.pixelSize: 14
  79. enabled: false // TODO: Implement playlist execution
  80. }
  81. }
  82. MouseArea {
  83. id: mouseArea
  84. anchors.fill: parent
  85. onClicked: {
  86. // TODO: Navigate to playlist detail page
  87. }
  88. }
  89. }
  90. }
  91. Label {
  92. anchors.centerIn: parent
  93. text: "No playlists found"
  94. visible: playlistModel.rowCount() === 0
  95. color: Components.ThemeManager.textTertiary
  96. font.pixelSize: 18
  97. }
  98. }