aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2019-10-09 14:06:58 +0200
committerMitch Curtis <mitch.curtis@qt.io>2019-10-11 13:29:00 +0200
commit2da83b321f41ce3a9581447e0209c9b827c2c397 (patch)
tree7cd57e3d6735a68c7ba721f52dc4fd794d8589fa
parenteed033246e6ab0518c92a0bcc92f245741218db5 (diff)
Universal: disable wrapping for TabBar
The wrapping behavior makes for a poor user experience. Use ListView as other styles do. [ChangeLog][Universal][TabBar] Disabled wrapping. The Universal style TabBar now behaves like TabBar from other styles. Change-Id: I0a37490cdc2b81ff864ec682256f469a1a930628 Fixes: QTBUG-50027 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
-rw-r--r--src/imports/controls/universal/TabBar.qml23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/imports/controls/universal/TabBar.qml b/src/imports/controls/universal/TabBar.qml
index ab660c93..c7d27cbd 100644
--- a/src/imports/controls/universal/TabBar.qml
+++ b/src/imports/controls/universal/TabBar.qml
@@ -46,23 +46,20 @@ T.TabBar {
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding)
- contentItem: PathView {
+ contentItem: ListView {
model: control.contentModel
currentIndex: control.currentIndex
- interactive: false
- snapMode: PathView.SnapToItem
- movementDirection: PathView.Positive
- highlightMoveDuration: 100
+ spacing: control.spacing
+ orientation: ListView.Horizontal
+ boundsBehavior: Flickable.StopAtBounds
+ flickableDirection: Flickable.AutoFlickIfNeeded
+ snapMode: ListView.SnapToItem
- path: Path {
- startX: control.count ? control.availableWidth / control.count / 2 : 0
- startY: control.availableHeight / 2
- PathLine {
- x: control.count ? control.availableWidth + (control.availableWidth / control.count / 2) : 0
- y: control.availableHeight / 2
- }
- }
+ highlightMoveDuration: 100
+ highlightRangeMode: ListView.ApplyRange
+ preferredHighlightBegin: 48
+ preferredHighlightEnd: width - 48
}
background: Rectangle {