2
import StyleItemType 0.1
7
property int current: 0
8
property int count: stack.children.length
9
property bool frame: true
10
property bool tabsVisible: true
11
property string position: "North"
12
default property alias tabs : stack.children
13
property Item tabBar: tabbarItem
15
onCurrentChanged: __setOpacities()
16
Component.onCompleted: __setOpacities()
18
property int __baseOverlap : frameitem.pixelMetric("tabbaseoverlap")// add paintmargins;
19
function __setOpacities() {
20
for (var i = 0; i < stack.children.length; ++i) {
21
stack.children[i].visible = (i == current ? true : false)
30
function addTab(component, title) {
31
var tab = tabcomp.createObject(this);
32
component.createObject(tab)
39
function removeTab(id) {
48
z: style == "oxygen" ? 1 : 0
49
elementType: "tabframe"
51
value: tabbarItem && tabsVisible && tabbarItem.tab(current) ? tabbarItem.tab(current).x : 0
52
minimum: tabbarItem && tabsVisible && tabbarItem.tab(current) ? tabbarItem.tab(current).width : 0
53
maximum: tabbarItem && tabsVisible ? tabbarItem.tabWidth : width
56
property int frameWidth: pixelMetric("defaultframewidth")
61
anchors.margins: (frame ? frameitem.frameWidth : 0)
62
anchors.topMargin: anchors.margins + (frameitem.style =="mac" ? 6 : 0)
63
anchors.bottomMargin: anchors.margins + (frameitem.style =="mac" ? 6 : 0)
66
anchors.topMargin: tabbarItem && tabsVisible && position == "North" ? Math.max(0, tabbarItem.height - __baseOverlap) : 0
71
when: position == "South" && tabbarItem!= undefined
75
anchors.bottomMargin: tabbarItem ? tabbarItem.height - __baseOverlap: 0
79
anchors.topMargin: -__baseOverlap
83
anchors.top: frameitem.bottom
84
anchors.bottom: undefined
92
anchors.top: tabWidget.top
93
anchors.left: tabWidget.left
94
anchors.right: tabWidget.right