Warning, /maui/nomad-style/TabBar.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * Copyright 2017 Marco Martin <mart@kde.org>
0003  * Copyright 2017 The Qt Company Ltd.
0004  *
0005  * GNU Lesser General Public License Usage
0006  * Alternatively, this file may be used under the terms of the GNU Lesser
0007  * General Public License version 3 as published by the Free Software
0008  * Foundation and appearing in the file LICENSE.LGPLv3 included in the
0009  * packaging of this file. Please review the following information to
0010  * ensure the GNU Lesser General Public License version 3 requirements
0011  * will be met: https://www.gnu.org/licenses/lgpl.html.
0012  *
0013  * GNU General Public License Usage
0014  * Alternatively, this file may be used under the terms of the GNU
0015  * General Public License version 2.0 or later as published by the Free
0016  * Software Foundation and appearing in the file LICENSE.GPL included in
0017  * the packaging of this file. Please review the following information to
0018  * ensure the GNU General Public License version 2.0 requirements will be
0019  * met: http://www.gnu.org/licenses/gpl-2.0.html.
0020  */
0021 
0022 
0023 import QtQuick 2.6
0024 import org.kde.qqc2desktopstyle.private 1.0 as StylePrivate
0025 import org.kde.kirigami 2.2 as Kirigami
0026 import QtQuick.Templates 2.3 as T
0027 
0028 T.TabBar {
0029     id: controlRoot
0030 
0031     Kirigami.Theme.colorSet: Kirigami.Theme.Button
0032     Kirigami.Theme.inherit: false
0033 
0034     implicitWidth: contentItem.implicitWidth
0035     implicitHeight: contentItem.implicitHeight
0036 
0037     spacing: 0
0038 
0039     contentItem: ListView {
0040         implicitWidth: contentWidth
0041         implicitHeight: controlRoot.contentModel.get(0).height
0042 
0043         model: controlRoot.contentModel
0044         currentIndex: controlRoot.currentIndex
0045 
0046         spacing: -styleItem.pixelMetric("tabOverlap")-1
0047         orientation: ListView.Horizontal
0048         boundsBehavior: Flickable.StopAtBounds
0049         flickableDirection: Flickable.AutoFlickIfNeeded
0050         snapMode: ListView.SnapToItem
0051 
0052         highlightMoveDuration: 0
0053         highlightRangeMode: ListView.ApplyRange
0054         preferredHighlightBegin: 40
0055         preferredHighlightEnd: width - 40
0056     }
0057 
0058     StylePrivate.StyleItem {
0059         id: styleItem
0060         control: controlRoot
0061         visible: false
0062         elementType: "tabframe"
0063         properties: {
0064             "orientation" : controlRoot.position == T.TabBar.Header ? "Top" : "Bottom"
0065         }
0066     }
0067 
0068     background: Item {
0069         Rectangle {
0070             anchors {
0071                 left: parent.left
0072                 right: parent.right
0073                 bottom : controlRoot.position == T.TabBar.Header ? parent.bottom : undefined
0074                 top : controlRoot.position == T.TabBar.Header ? undefined : parent.top
0075             }
0076             height: 1
0077             color: Kirigami.Theme.textColor
0078             opacity: 0.4
0079         }
0080     }
0081 }