diff options
Diffstat (limited to 'src/imports/controls/material/TabBar.qml')
-rw-r--r-- | src/imports/controls/material/TabBar.qml | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/src/imports/controls/material/TabBar.qml b/src/imports/controls/material/TabBar.qml index dbc62512..901e3328 100644 --- a/src/imports/controls/material/TabBar.qml +++ b/src/imports/controls/material/TabBar.qml @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Labs Controls module of the Qt Toolkit. +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL3$ ** Commercial License Usage @@ -34,9 +34,10 @@ ** ****************************************************************************/ -import QtQuick 2.6 -import Qt.labs.templates 1.0 as T -import Qt.labs.controls.material 1.0 +import QtQuick 2.7 +import QtQuick.Templates 2.0 as T +import QtQuick.Controls.Material 2.0 +import QtQuick.Controls.Material.impl 2.0 T.TabBar { id: control @@ -48,7 +49,6 @@ T.TabBar { spacing: 1 - //! [contentItem] contentItem: ListView { implicitWidth: contentWidth implicitHeight: 48 @@ -59,20 +59,34 @@ T.TabBar { spacing: control.spacing orientation: ListView.Horizontal boundsBehavior: Flickable.StopAtBounds + flickableDirection: Flickable.AutoFlickIfNeeded snapMode: ListView.SnapToItem highlightMoveDuration: 250 highlightResizeDuration: 0 highlightFollowsCurrentItem: true + highlightRangeMode: ListView.ApplyRange + preferredHighlightBegin: 48 + preferredHighlightEnd: width - 48 + highlight: Item { z: 2 Rectangle { height: 2 width: parent.width - y: parent.height - height + y: control.position === T.TabBar.Footer ? 0 : parent.height - height color: control.Material.accentColor } } } - //! [contentItem] + + background: Rectangle { + color: control.Material.backgroundColor + + layer.enabled: control.Material.elevation > 0 + layer.effect: ElevationEffect { + elevation: control.Material.elevation + fullWidth: true + } + } } |