From 3dab48bcc532f44acc0370d056329a2e5a6b7b6e Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 29 Apr 2015 09:55:05 +0200 Subject: Import the new TabBar implementation Change-Id: I2c646c07f8310c27f3f03f3cdb27f748c5e6198c Reviewed-by: J-P Nurmi --- src/imports/controls/TabBar.qml | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'src/imports/controls') diff --git a/src/imports/controls/TabBar.qml b/src/imports/controls/TabBar.qml index 845cf3d0..93d30f35 100644 --- a/src/imports/controls/TabBar.qml +++ b/src/imports/controls/TabBar.qml @@ -40,14 +40,7 @@ import QtQuick.Controls 2.0 AbstractTabBar { id: control - property list items - readonly property int count: items.length property alias highlight: listView.highlight - property alias spacing: listView.spacing - - property Component delegate: TabButton { - width: (listView.width - Math.max(0, count - 1) * spacing) / count - } contentWidth: listView.contentWidth contentHeight: listView.contentHeight @@ -57,10 +50,6 @@ AbstractTabBar { Accessible.role: Accessible.PageTabList - ExclusiveGroup { - id: group - } - contentItem: ListView { id: listView @@ -69,18 +58,9 @@ AbstractTabBar { boundsBehavior: Flickable.StopAtBounds snapMode: ListView.SnapToItem - model: control.items + model: control.model currentIndex: control.currentIndex - delegate: Loader { - sourceComponent: control.delegate - visible: modelData.Tab.visible - Binding { target: item; property: "Exclusive.group"; value: group } - Binding { target: item; property: "text"; value: modelData.Tab.title } - Binding { target: item; property: "checked"; value: control.currentIndex === index } - Connections { target: item; onClicked: control.currentIndex = index } - } - highlightMoveDuration: 250 highlightResizeDuration: 0 highlightFollowsCurrentItem: true @@ -98,10 +78,11 @@ AbstractTabBar { background: Rectangle { implicitWidth: 26 implicitHeight: 26 - width: listView.width + border.color: control.Theme.backgroundColor border.width: 8 - color: listView.count > 1 ? control.Theme.frameColor : control.Theme.backgroundColor + color: control.count > 1 ? control.Theme.frameColor : control.Theme.backgroundColor + Rectangle { y: parent.height - height width: parent.width -- cgit v1.2.3