DefaultItemDelegateIconLabel.qml 884 B

12345678910111213141516171819202122
  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.Controls.impl
  5. import QtQuick.Templates as T
  6. IconLabel {
  7. text: control.text
  8. font: control.font
  9. icon: control.icon
  10. color: control.palette.windowText
  11. spacing: control.spacing
  12. mirrored: control.mirrored
  13. display: control.display
  14. alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon
  15. ? Qt.AlignCenter : Qt.AlignLeft
  16. leftPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
  17. rightPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
  18. readonly property T.ItemDelegate control: parent as T.ItemDelegate
  19. }