DialogButtonBox.qml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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.DialogButtonBox {
  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. spacing: 6
  16. padding: 6
  17. alignment: Qt.AlignRight
  18. delegate: Button { }
  19. contentItem: ListView {
  20. implicitWidth: contentWidth
  21. model: control.contentModel
  22. spacing: control.spacing
  23. orientation: ListView.Horizontal
  24. boundsBehavior: Flickable.StopAtBounds
  25. snapMode: ListView.SnapToItem
  26. }
  27. background: Rectangle {
  28. implicitHeight: 34
  29. width: parent.width
  30. height: parent.height
  31. color: "transparent"
  32. border.color: Fusion.highContrast ? control.palette.windowText : "transparent"
  33. radius: 2
  34. Rectangle {
  35. x: 1; y: 1
  36. width: parent.width - 2
  37. height: parent.height - 2
  38. color: control.palette.window
  39. radius: 2
  40. }
  41. }
  42. }