aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2015-04-29 09:55:05 +0200
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2015-06-11 15:12:56 +0000
commit3dab48bcc532f44acc0370d056329a2e5a6b7b6e (patch)
treebbd2dffec81d1bf101565ef4d46beefdd19b68dc /src/imports
parentf944c34757baf145f7018e37bc732d061f0bbf7f (diff)
Import the new TabBar implementation
Change-Id: I2c646c07f8310c27f3f03f3cdb27f748c5e6198c Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/imports')
-rw-r--r--src/imports/controls/TabBar.qml27
1 files changed, 4 insertions, 23 deletions
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<Item> 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