MenuBar.qml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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.MenuBar {
  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. leftPadding: SafeArea.margins.left + 3
  14. rightPadding: SafeArea.margins.right + 3
  15. topPadding: SafeArea.margins.top + 3
  16. bottomPadding: SafeArea.margins.bottom + 3
  17. spacing: 10
  18. delegate: MenuBarItem { }
  19. contentItem: Row {
  20. spacing: control.spacing
  21. Repeater {
  22. model: control.contentModel
  23. }
  24. }
  25. background: Rectangle {
  26. implicitHeight: 20
  27. color: control.palette.button // The MenuBar shares the same color as the MenuBarItems on Windows
  28. }
  29. }