SearchFilterToggle.qml 822 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import QtQuick 2.15
  2. import QtQuick.Layouts 1.15
  3. import DMusic 1.0
  4. import "components"
  5. MouseArea {
  6. id: root
  7. width: _row.implicitWidth
  8. height: _row.implicitHeight
  9. property var style: selected? Style.panel.icon.accent : Style.panel.icon.normal
  10. property bool selected: false
  11. property string text
  12. property url icon
  13. property color color: containsMouse? style.hoverColor : style.color
  14. hoverEnabled: true
  15. cursorShape: Qt.PointingHandCursor
  16. onClicked: selected = !selected
  17. RowLayout {
  18. id: _row
  19. anchors.fill: parent
  20. spacing: 4
  21. Icon {
  22. width: 14
  23. height: 14
  24. src: root.icon
  25. color: root.color
  26. }
  27. DText {
  28. Layout.alignment: Qt.AlignVCenter
  29. style: Style.panel.text
  30. font.pointSize: 9
  31. text: root.text
  32. color: root.color
  33. }
  34. }
  35. }