summaryrefslogtreecommitdiff
path: root/src/controls/TabView.qml
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-05-02 18:18:08 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-08 21:42:37 +0200
commit2416927b67dcb4021edd38231295c13fe1b5a580 (patch)
treef7d31bc4c1640d867ef59c4109766c3cc0a336a6 /src/controls/TabView.qml
parent2ae89b14d8dcc7176af3d475b38d3c023a1897a2 (diff)
downloadqtquickcontrols-2416927b67dcb4021edd38231295c13fe1b5a580.tar.gz
Refactor and clean up public style API
Change-Id: I10271c860abd9b45a262e3548628e6a3026e1a4f Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls/TabView.qml')
-rw-r--r--src/controls/TabView.qml19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/controls/TabView.qml b/src/controls/TabView.qml
index 153c2400..7871cdd6 100644
--- a/src/controls/TabView.qml
+++ b/src/controls/TabView.qml
@@ -49,6 +49,8 @@ import QtQuick.Controls.Private 1.0
\ingroup views
\brief A control that allows the user to select one of multiple stacked items.
+ You can create a custom appearance for a TabView by
+ assigning a TabViewStyle.
*/
FocusScope {
@@ -176,7 +178,7 @@ FocusScope {
id: loader
z: tabbarItem.z - 1
sourceComponent: style
- property var control: root
+ property var __control: root
}
Loader {
@@ -184,10 +186,11 @@ FocusScope {
z: tabbarItem.z - 1
anchors.fill: parent
- anchors.topMargin: tabbarItem && tabsVisible && tabPosition == Qt.TopEdge ? Math.max(0, tabbarItem.height - stack.baseOverlap) : 0
- anchors.bottomMargin: tabbarItem && tabsVisible && tabPosition == Qt.BottomEdge ? Math.max(0, tabbarItem.height - stack.baseOverlap) : 0
+ anchors.topMargin: tabPosition === Qt.TopEdge && tabbarItem && tabsVisible ? Math.max(0, tabbarItem.height - baseOverlap) : 0
+ anchors.bottomMargin: tabPosition === Qt.BottomEdge && tabbarItem && tabsVisible ? Math.max(0, tabbarItem.height -baseOverlap) : 0
sourceComponent: frameVisible && loader.item ? loader.item.frame : null
- property var control: root
+
+ property int baseOverlap: __styleItem ? __styleItem.frameOverlap : 0
Item {
id: stack
@@ -199,7 +202,6 @@ FocusScope {
property int frameWidth
property string style
- property int baseOverlap
Component.onCompleted: addTabs(stack.children)
@@ -240,15 +242,14 @@ FocusScope {
states: [
State {
name: "Bottom"
- when: tabPosition == Qt.BottomEdge && tabbarItem != undefined
+ when: tabPosition === Qt.BottomEdge && tabbarItem != undefined
PropertyChanges {
target: tabbarItem
- anchors.topMargin: tabbarItem.height
+ anchors.topMargin: -frameLoader.baseOverlap
}
AnchorChanges {
target: tabbarItem
- anchors.top: undefined
- anchors.bottom: root.bottom
+ anchors.top: frameLoader.bottom
}
}
]