SelectionRectangle.qml 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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.Universal
  8. T.SelectionRectangle {
  9. id: control
  10. topLeftHandle: handle
  11. bottomRightHandle: handle
  12. Component {
  13. id: handle
  14. Rectangle {
  15. implicitWidth: 8
  16. implicitHeight: 24
  17. radius: 4
  18. color: tapHandler.pressed || SelectionRectangle.dragging ? control.Universal.chromeHighColor :
  19. hoverHandler.hovered ? control.Universal.chromeAltLowColor :
  20. control.Universal.accent
  21. visible: control.active
  22. property Item control: SelectionRectangle.control
  23. HoverHandler {
  24. id: hoverHandler
  25. }
  26. TapHandler {
  27. id: tapHandler
  28. }
  29. }
  30. }
  31. }