TabButton.qml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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.Material
  8. import QtQuick.Controls.Material.impl
  9. T.TabButton {
  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. padding: 12
  16. spacing: 6
  17. icon.width: 24
  18. icon.height: 24
  19. contentItem: IconLabel {
  20. spacing: control.spacing
  21. mirrored: control.mirrored
  22. display: control.display
  23. icon: control.icon
  24. defaultIconColor: !control.enabled ? control.Material.hintTextColor
  25. : control.down || control.checked ? control.Material.accentColor : control.Material.foreground
  26. text: control.text
  27. font: control.font
  28. color: defaultIconColor
  29. }
  30. background: Ripple {
  31. implicitHeight: control.Material.touchTarget
  32. clip: true
  33. pressed: control.pressed
  34. anchor: control
  35. active: enabled && (control.down || control.visualFocus || control.hovered)
  36. color: control.Material.rippleColor
  37. }
  38. }