VerticalHeaderViewDelegate.qml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright (C) 2025 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.Fusion as FusionControls
  7. T.HeaderViewDelegate {
  8. id: control
  9. // same as AbstractButton.qml
  10. implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
  11. implicitContentWidth + leftPadding + rightPadding)
  12. implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
  13. implicitContentHeight + topPadding + bottomPadding)
  14. padding: 8
  15. highlighted: selected
  16. background: Rectangle {
  17. id: backgroundRect
  18. color: control.palette.button
  19. gradient: Gradient {
  20. GradientStop {
  21. position: 0
  22. color: FusionControls.Fusion.gradientStart(backgroundRect.color)
  23. }
  24. GradientStop {
  25. position: 1
  26. color: FusionControls.Fusion.gradientStop(backgroundRect.color)
  27. }
  28. }
  29. }
  30. contentItem: Label {
  31. horizontalAlignment: Text.AlignHCenter
  32. verticalAlignment: Text.AlignVCenter
  33. text: control.model[control.headerView.textRole]
  34. }
  35. }