From 6b4a6b0deb54f9a65d75d9c9f1e60b32ced1a781 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 24 Aug 2016 13:37:43 +0200 Subject: TabBar: improve the behavior of flickable tabs When using flickable tabs, make sure the next or previous tab is a bit visible to make it clear that there are more tabs and ensure that the content is not flickable when there is less content than available size. Change-Id: I231ac8e99007103517ff49e747282af43cc6f8ea Task-number: QTBUG-55129 Reviewed-by: Mitch Curtis --- src/imports/controls/TabBar.qml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/imports/controls/TabBar.qml') diff --git a/src/imports/controls/TabBar.qml b/src/imports/controls/TabBar.qml index 6f3e040b..6a575167 100644 --- a/src/imports/controls/TabBar.qml +++ b/src/imports/controls/TabBar.qml @@ -34,7 +34,7 @@ ** ****************************************************************************/ -import QtQuick 2.6 +import QtQuick 2.7 import QtQuick.Templates 2.0 as T T.TabBar { @@ -58,7 +58,13 @@ T.TabBar { spacing: control.spacing orientation: ListView.Horizontal boundsBehavior: Flickable.StopAtBounds + flickableDirection: Flickable.AutoFlickIfNeeded snapMode: ListView.SnapToItem + + highlightMoveDuration: 0 + highlightRangeMode: ListView.ApplyRange + preferredHighlightBegin: 40 + preferredHighlightEnd: width - 40 } //! [contentItem] -- cgit v1.2.3