TabBar.qml 1.4 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.Fusion
  8. import QtQuick.Controls.Fusion.impl
  9. T.TabBar {
  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. spacing: -1
  16. contentItem: ListView {
  17. model: control.contentModel
  18. currentIndex: control.currentIndex
  19. spacing: control.spacing
  20. orientation: ListView.Horizontal
  21. boundsBehavior: Flickable.StopAtBounds
  22. flickableDirection: Flickable.AutoFlickIfNeeded
  23. snapMode: ListView.SnapToItem
  24. highlightMoveDuration: 0
  25. highlightRangeMode: ListView.ApplyRange
  26. preferredHighlightBegin: 40
  27. preferredHighlightEnd: width - 40
  28. }
  29. background: Item {
  30. implicitHeight: 21
  31. Rectangle {
  32. width: parent.width
  33. height: 1
  34. y: control.position === T.TabBar.Header ? parent.height - 1 : 0
  35. color: Fusion.outline(control.palette)
  36. }
  37. }
  38. }