Dialog.qml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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.Universal
  7. T.Dialog {
  8. id: control
  9. implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
  10. implicitContentWidth + leftPadding + rightPadding,
  11. implicitHeaderWidth,
  12. implicitFooterWidth)
  13. implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
  14. implicitContentHeight + topPadding + bottomPadding
  15. + (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
  16. + (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
  17. padding: 24
  18. verticalPadding: 18
  19. background: Rectangle {
  20. color: control.Universal.chromeMediumLowColor
  21. border.color: control.Universal.chromeHighColor
  22. border.width: 1 // FlyoutBorderThemeThickness
  23. }
  24. header: Label {
  25. text: control.title
  26. visible: parent?.parent === Overlay.overlay && control.title
  27. elide: Label.ElideRight
  28. topPadding: 18
  29. leftPadding: 24
  30. rightPadding: 24
  31. // TODO: QPlatformTheme::TitleBarFont
  32. font.pixelSize: 20
  33. background: Rectangle {
  34. x: 1; y: 1 // // FlyoutBorderThemeThickness
  35. color: control.Universal.chromeMediumLowColor
  36. width: parent.width - 2
  37. height: parent.height - 1
  38. }
  39. }
  40. footer: DialogButtonBox {
  41. visible: count > 0
  42. }
  43. T.Overlay.modal: Rectangle {
  44. color: control.Universal.baseLowColor
  45. }
  46. T.Overlay.modeless: Rectangle {
  47. color: control.Universal.baseLowColor
  48. }
  49. }