FloatingPanel.qml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import QtQuick 2.15
  2. import QtGraphicalEffects 1.15
  3. import DMusic 1.0
  4. Item {
  5. id: root
  6. property color color: Style.panel.background
  7. property var triangleCenter: root.horizontalCenter
  8. property var triangleTop: root.bottom
  9. property var triangleBottom: root.top
  10. property real triangleOffset: 0
  11. property real triangleRotation: 0
  12. property bool triangleOnTop: false
  13. opacity: 0
  14. Rectangle {
  15. id: _background
  16. anchors.fill: root
  17. radius: Style.panel.radius
  18. color: root.color
  19. }
  20. DropShadow {
  21. anchors.fill: root
  22. radius: 16.0
  23. samples: 30
  24. transparentBorder: true
  25. color: "#40000000"
  26. source: _background
  27. }
  28. Triangle {
  29. id: _triangle
  30. anchors.horizontalCenter: root.triangleCenter
  31. anchors.top: triangleOnTop? undefined : root.triangleTop
  32. anchors.bottom: triangleOnTop? root.triangleBottom : undefined
  33. anchors.horizontalCenterOffset: root.triangleOffset
  34. rotation: root.triangleRotation + (triangleOnTop? 180 : 0)
  35. color: root.color
  36. }
  37. MouseArea {
  38. anchors.fill: parent
  39. hoverEnabled: true
  40. }
  41. }