MenuBarItem.qml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // Copyright (C) 2024 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. T.MenuBarItem {
  8. id: control
  9. implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
  10. implicitContentWidth + leftPadding + rightPadding)
  11. implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
  12. implicitContentHeight + topPadding + bottomPadding,
  13. implicitIndicatorHeight + topPadding + bottomPadding)
  14. topPadding: 8
  15. bottomPadding: 8
  16. leftPadding: 10
  17. rightPadding: 10
  18. spacing: 6
  19. icon.width: 16
  20. icon.height: 16
  21. contentItem: IconLabel {
  22. spacing: control.spacing
  23. mirrored: control.mirrored
  24. display: control.display
  25. alignment: Qt.AlignLeft
  26. icon: control.icon
  27. text: control.text
  28. font: control.font
  29. color: control.palette.text
  30. }
  31. background: Rectangle {
  32. implicitWidth: 20
  33. implicitHeight: 20
  34. color: "black"
  35. opacity: 0.05
  36. radius: 4
  37. visible: control.down || control.highlighted
  38. }
  39. }