MenuBar.qml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. import QtQuick.Controls.FluentWinUI3.impl as Impl
  8. T.MenuBar {
  9. id: control
  10. implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
  11. implicitContentWidth + leftPadding + rightPadding)
  12. implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
  13. implicitContentHeight + topPadding + bottomPadding)
  14. spacing: __config.spacing || 0
  15. topPadding: SafeArea.margins.top + (__config.topPadding || 0)
  16. bottomPadding: SafeArea.margins.bottom + (__config.bottomPadding || 0)
  17. leftPadding: SafeArea.margins.left + (__config.leftPadding || 0)
  18. rightPadding: SafeArea.margins.right + (__config.rightPadding || 0)
  19. readonly property var __config: Config.controls.toolbar["normal"] || {}
  20. delegate: MenuBarItem { }
  21. contentItem: Row {
  22. spacing: control.spacing
  23. Repeater {
  24. model: control.contentModel
  25. }
  26. }
  27. background: Impl.StyleImage {
  28. imageConfig: control.__config.background
  29. }
  30. }