SelectionRectangle.qml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright (C) 2021 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
  3. // Qt-Security score:significant reason:default
  4. import QtQuick
  5. import QtQuick.Templates as T
  6. import QtQuick.Controls.impl
  7. import QtQuick.Controls.Imagine
  8. import QtQuick.Controls.Imagine.impl
  9. T.SelectionRectangle {
  10. id: control
  11. topLeftHandle: handle
  12. bottomRightHandle: handle
  13. Component {
  14. id: handle
  15. Image {
  16. id: image
  17. source: Imagine.url + "slider-handle"
  18. visible: SelectionRectangle.control.active
  19. ImageSelector on source {
  20. states: [
  21. {"vertical": false},
  22. {"horizontal": true},
  23. {"disabled": false},
  24. {"pressed": tapHandler.pressed || image.SelectionRectangle.dragging},
  25. {"focused": true},
  26. {"mirrored": false},
  27. {"hovered": hoverHandler.hovered}
  28. ]
  29. }
  30. HoverHandler {
  31. id: hoverHandler
  32. }
  33. TapHandler {
  34. id: tapHandler
  35. }
  36. }
  37. }
  38. }