DefaultItemDelegate.qml 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (C) 2023 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.NativeStyle as NativeStyle
  8. T.ItemDelegate {
  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. implicitIndicatorHeight + topPadding + bottomPadding)
  15. padding: 6
  16. spacing: 6
  17. icon.width: 16
  18. icon.height: 16
  19. contentItem: NativeStyle.DefaultItemDelegateIconLabel {}
  20. background: Rectangle {
  21. implicitWidth: 100
  22. implicitHeight: 20
  23. color: Qt.darker(control.highlighted
  24. ? control.palette.highlight : control.palette.button, control.down ? 1.05 : 1)
  25. }
  26. }