Warning, /maui/mauikit/src/style.5/TabButton.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 QtQml.Models 2.1
0025 import QtQuick.Templates 2.3 as T
0026 import org.mauikit.controls 1.2 as Maui
0027 
0028 T.TabButton
0029 {
0030     id: controlRoot
0031 
0032     //Some qstyles like fusion don't have correct pixel metrics here and just return 0
0033     implicitWidth: Math.max(styleitem.implicitWidth, textMetrics.width + Maui.Style.units.gridUnit * 2)
0034 //    implicitHeight: styleitem.implicitHeight || Maui.Style.units.gridUnit * 2
0035     baselineOffset: contentItem.y + contentItem.baselineOffset
0036 
0037     //This width: is important to make the tabbar internals not assume
0038     //all tabs have the same width
0039     width: implicitWidth
0040     
0041     padding: Maui.Style.defaultPadding
0042     spacing: Maui.Style.defaultSpacing
0043     
0044     hoverEnabled: true
0045 
0046     contentItem: Item {}
0047 
0048 //    background: StylePrivate.StyleItem {
0049 //        id: styleitem
0050 
0051 //        TextMetrics {
0052 //            id: textMetrics
0053 //            font.capitalization: Maui.Theme.defaultFont.capitalization
0054 //            font.family: Maui.Theme.defaultFont.family
0055 //            font.italic: Maui.Theme.defaultFont.italic
0056 //            font.letterSpacing: Maui.Theme.defaultFont.letterSpacing
0057 //            font.pointSize: Maui.Theme.defaultFont.pointSize
0058 //            font.strikeout: Maui.Theme.defaultFont.strikeout
0059 //            font.underline: Maui.Theme.defaultFont.underline
0060 //            font.weight: Maui.Theme.defaultFont.weight
0061 //            font.wordSpacing: Maui.Theme.defaultFont.wordSpacing
0062 //            text: controlRoot.text
0063 //        }
0064 
0065 //        control: controlRoot
0066 //        anchors.fill: parent
0067 //        elementType: "tab"
0068 //        paintMargins: 0
0069 //        property Item tabBar: controlRoot.parent.parent.parent
0070 
0071 //        property string orientation: tabBar.position == TabBar.Header ? "Top" : "Bottom"
0072 //        property string selectedpos: tabBar.currentIndex == controlRoot.ObjectModel.index + 1 ? "next" :
0073 //                                    tabBar.currentIndex == controlRoot.ObjectModel.index - 1 ? "previous" : ""
0074 //        property string tabpos: tabBar.count === 1 ? "only" : controlRoot.ObjectModel.index === 0 ? "beginning" : controlRoot.ObjectModel.index === tabBar.count - 1 ? "end" : "middle"
0075 
0076 //        properties: {
0077 //            "hasFrame" : true,
0078 //            "orientation": orientation,
0079 //            "tabpos": tabpos,
0080 //            "selectedpos": selectedpos
0081 //        }
0082 
0083 //        enabled: controlRoot.enabled
0084 //        selected: controlRoot.checked
0085 //        text: controlRoot.text
0086 //        hover: controlRoot.hovered
0087 //        hasFocus: controlRoot.activeFocus
0088 //    }
0089 }