MenuBar.qml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright (C) 2017 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.Fusion
  8. import QtQuick.Controls.Fusion.impl
  9. T.MenuBar {
  10. id: control
  11. implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
  12. implicitContentWidth + leftPadding + rightPadding)
  13. implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
  14. implicitContentHeight + topPadding + bottomPadding)
  15. topPadding: SafeArea.margins.top
  16. leftPadding: SafeArea.margins.left
  17. rightPadding: SafeArea.margins.right
  18. bottomPadding: SafeArea.margins.bottom
  19. delegate: MenuBarItem { }
  20. contentItem: Row {
  21. spacing: control.spacing
  22. Repeater {
  23. model: control.contentModel
  24. }
  25. }
  26. background: Rectangle {
  27. implicitHeight: 20
  28. color: control.palette.window
  29. Rectangle {
  30. y: parent.height - height
  31. width: parent.width
  32. height: 1
  33. color: Fusion.mergedColors(Qt.darker(control.palette.window, 1.2),
  34. Qt.lighter(Fusion.outline(control.palette), 1.4), 60)
  35. }
  36. }
  37. }