From 2445709979c6e125e58076b2707fd43fd7abf9af Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig <jens.bache-wiig@digia.com> Date: Fri, 22 Feb 2013 13:45:41 +0100 Subject: [PATCH] Rename TabFrame to TabView Change-Id: I367758fe97656fb5c4aab79c87e80ead2430c69b Reviewed-by: J-P Nurmi <jpnurmi@digia.com> --- examples/gallery/content/Styles.qml | 6 ++-- examples/gallery/main.qml | 2 +- examples/tableview/main.qml | 2 +- examples/touch/content/TabBarPage.qml | 4 +-- src/controls/ApplicationWindow.qml | 2 +- src/controls/{TabFrame.qml => TabView.qml} | 20 +++++------ src/controls/controls.pro | 2 +- src/controls/doc/qtquickcontrols.qdocconf | 4 +-- src/controls/qmldir | 2 +- src/private/TabBar.qml | 35 +++++++++---------- .../{TabFrameStyle.qml => TabViewStyle.qml} | 0 .../{TabFrameStyle.qml => TabViewStyle.qml} | 4 +-- src/styles/qmldir | 2 +- src/styles/styles.pro | 4 +-- tests/auto/controls/controls.pro | 2 +- .../{tst_tabframe.qml => tst_tabview.qml} | 10 +++--- tests/manual/Layout.qml | 2 +- tests/manual/scrollbars.qml | 2 +- tests/manual/stretching.qml | 2 +- tests/manual/stretchingcustom.qml | 2 +- 20 files changed, 54 insertions(+), 55 deletions(-) rename src/controls/{TabFrame.qml => TabView.qml} (93%) rename src/styles/Desktop/{TabFrameStyle.qml => TabViewStyle.qml} (100%) rename src/styles/{TabFrameStyle.qml => TabViewStyle.qml} (98%) rename tests/auto/controls/data/{tst_tabframe.qml => tst_tabview.qml} (86%) diff --git a/examples/gallery/content/Styles.qml b/examples/gallery/content/Styles.qml index 4f40fe20e..2950ef179 100644 --- a/examples/gallery/content/Styles.qml +++ b/examples/gallery/content/Styles.qml @@ -154,14 +154,14 @@ Item { } Row { - TabFrame { + TabView { width: 400 height: 30 Tab { title: "One" ; Item {}} Tab { title: "Two" ; Item {}} Tab { title: "Three" ; Item {}} Tab { title: "Four" ; Item {}} - style: tabFrameStyle + style: tabViewStyle } } } @@ -236,7 +236,7 @@ Item { } } - property Component tabFrameStyle: TabFrameStyle { + property Component tabViewStyle: TabViewStyle { tabOverlap: 16 leftMargin: 12 diff --git a/examples/gallery/main.qml b/examples/gallery/main.qml index ed26957c7..450fe5a0e 100644 --- a/examples/gallery/main.qml +++ b/examples/gallery/main.qml @@ -241,7 +241,7 @@ ApplicationWindow { ListElement { text: "Coconut" } } - TabFrame { + TabView { id:frame enabled: enabledCheck.checked position: controlPage.tabPosition diff --git a/examples/tableview/main.qml b/examples/tableview/main.qml index efee32af2..5cc2e650c 100644 --- a/examples/tableview/main.qml +++ b/examples/tableview/main.qml @@ -117,7 +117,7 @@ Rectangle { anchors.bottom: parent.bottom anchors.margins: 8 - TabFrame { + TabView { id:frame focus:true enabled: toolbar.enabled diff --git a/examples/touch/content/TabBarPage.qml b/examples/touch/content/TabBarPage.qml index 45ca3be08..4edbaabde 100644 --- a/examples/touch/content/TabBarPage.qml +++ b/examples/touch/content/TabBarPage.qml @@ -48,7 +48,7 @@ import QtQuick.Controls.Styles 1.0 Page { - TabFrame { + TabView { anchors.fill: parent style: touchStyle Tab { @@ -67,7 +67,7 @@ Page { Component { id: touchStyle - TabFrameStyle { + TabViewStyle { tabBarAlignment: "center" frame: Item { } tab: Item { diff --git a/src/controls/ApplicationWindow.qml b/src/controls/ApplicationWindow.qml index 01ab66030..ab2f75bde 100644 --- a/src/controls/ApplicationWindow.qml +++ b/src/controls/ApplicationWindow.qml @@ -69,7 +69,7 @@ import QtQuick.Controls.Private 1.0 } } - TabFrame { + TabView { id: myContent anchors.fill: parent ... diff --git a/src/controls/TabFrame.qml b/src/controls/TabView.qml similarity index 93% rename from src/controls/TabFrame.qml rename to src/controls/TabView.qml index 931988152..f2064e7c1 100644 --- a/src/controls/TabFrame.qml +++ b/src/controls/TabView.qml @@ -44,7 +44,7 @@ import QtQuick.Controls.Private 1.0 import "Styles/Settings.js" as Settings /*! - \qmltype TabFrame + \qmltype TabView \inqmlmodule QtQuick.Controls 1.0 \ingroup navigation \brief Represents a control that contains multiple items that share the same space on the screen. @@ -52,7 +52,7 @@ import "Styles/Settings.js" as Settings */ Item { - id: tabWidget + id: root width: 100 height: 100 @@ -62,7 +62,7 @@ Item { property bool tabsVisible: true property string position: "North" default property alias tabs : stack.children - property Component style: Qt.createComponent(Settings.THEME_PATH + "/TabFrameStyle.qml", tabWidget) + property Component style: Qt.createComponent(Settings.THEME_PATH + "/TabViewStyle.qml", root) property var __styleItem: loader.item onCurrentChanged: __setOpacities() @@ -76,7 +76,7 @@ Item { if (stack.children[i].Accessible.role == Accessible.PageTab) ++tabCount; } - tabWidget.count = tabCount; + root.count = tabCount; } Component { @@ -103,7 +103,7 @@ Item { Loader { id: loader sourceComponent: style - property var control: tabWidget + property var control: root } Loader { @@ -113,7 +113,7 @@ Item { anchors.topMargin: tabbarItem && tabsVisible && position == "North" ? Math.max(0, tabbarItem.height - stack.baseOverlap) : 0 anchors.bottomMargin: tabbarItem && tabsVisible && position == "South" ? Math.max(0, tabbarItem.height - stack.baseOverlap) : 0 sourceComponent: frame && loader.item ? loader.item.frame : null - property var control: tabWidget + property var control: root Item { id: stack @@ -130,11 +130,11 @@ Item { TabBar { id: tabbarItem - tabFrame: tabWidget + tabView: root style: loader.item anchors.top: parent.top - anchors.left: tabWidget.left - anchors.right: tabWidget.right + anchors.left: root.left + anchors.right: root.right } states: [ @@ -148,7 +148,7 @@ Item { AnchorChanges { target: tabbarItem anchors.top: undefined - anchors.bottom: tabWidget.bottom + anchors.bottom: root.bottom } } ] diff --git a/src/controls/controls.pro b/src/controls/controls.pro index 507dda4fe..66410f7c4 100644 --- a/src/controls/controls.pro +++ b/src/controls/controls.pro @@ -28,7 +28,7 @@ QML_FILES = \ Splitter.qml \ StatusBar.qml \ Tab.qml \ - TabFrame.qml \ + TabView.qml \ TableView.qml \ TableViewColumn.qml \ TextArea.qml \ diff --git a/src/controls/doc/qtquickcontrols.qdocconf b/src/controls/doc/qtquickcontrols.qdocconf index bd683f1b5..29fcbd1a6 100644 --- a/src/controls/doc/qtquickcontrols.qdocconf +++ b/src/controls/doc/qtquickcontrols.qdocconf @@ -40,11 +40,11 @@ sources += ../../private/qstyleitem.cpp \ ../../styles/MenuItemStyle.qml \ ../../styles/ProgressBarStyle.qml \ ../../styles/RadioButtonStyle.qml \ - ../../styles/ScrollAreaStyle.qml \ + ../../styles/ScrollViewStyle.qml \ ../../styles/ScrollBarStyle.qml \ ../../styles/SliderStyle.qml \ ../../styles/SpinBoxStyle.qml \ - ../../styles/TabFrameStyle.qml \ + ../../styles/TabViewStyle.qml \ ../../styles/TextFieldStyle.qml \ ../../styles/ToolBarStyle.qml \ ../../styles/ToolButtonStyle.qml diff --git a/src/controls/qmldir b/src/controls/qmldir index 6543c8ae9..bb2b24e84 100644 --- a/src/controls/qmldir +++ b/src/controls/qmldir @@ -21,7 +21,7 @@ SpinBox 1.0 SpinBox.qml Splitter 1.0 Splitter.qml StatusBar 1.0 StatusBar.qml Tab 1.0 Tab.qml -TabFrame 1.0 TabFrame.qml +TabView 1.0 TabView.qml TableView 1.0 TableView.qml TableViewColumn 1.0 TableViewColumn.qml TextArea 1.0 TextArea.qml diff --git a/src/private/TabBar.qml b/src/private/TabBar.qml index d5e2902b0..03d6d3ef1 100644 --- a/src/private/TabBar.qml +++ b/src/private/TabBar.qml @@ -53,24 +53,23 @@ Item { Keys.onRightPressed: { - if (tabFrame && tabFrame.current < tabFrame.count - 1) - tabFrame.current = tabFrame.current + 1 + if (tabView && tabView.current < tabView.count - 1) + tabView.current = tabView.current + 1 } Keys.onLeftPressed: { - if (tabFrame && tabFrame.current > 0) - tabFrame.current = tabFrame.current - 1 + if (tabView && tabView.current > 0) + tabView.current = tabView.current - 1 } - onTabFrameChanged: parent = tabFrame - visible: tabFrame ? tabFrame.tabsVisible : true + onTabViewChanged: parent = tabView + visible: tabView ? tabView.tabsVisible : true - - property Item tabFrame + property var tabView property var style - property var styleItem: tabFrame.__styleItem ? tabFrame.__styleItem : null + property var styleItem: tabView.__styleItem ? tabView.__styleItem : null property string tabBarAlignment: styleItem ? styleItem.tabBarAlignment : "left" - property string position: tabFrame ? tabFrame.position : "North" + property string position: tabView ? tabView.position : "North" property int tabOverlap: styleItem ? styleItem.tabOverlap : 0 property int tabBaseOverlap: styleItem ? styleItem.tabBaseOverlap : 0 @@ -113,17 +112,17 @@ Item { Repeater { id: repeater focus: true - model: tabFrame ? tabFrame.count : null + model: tabView ? tabView.count : null delegate: Item { id: tabitem focus: true property int tabindex: index property bool selectedHelper: selected - property bool selected : tabFrame.current == index + property bool selected : tabView.current == index property bool hover: mousearea.containsMouse property bool first: index === 0 - property string title: tabFrame.tabs[index].title + property string title: tabView.tabs[index].title z: selected ? 1 : -index implicitWidth: Math.min(tabloader.implicitWidth, tabbar.width/repeater.count) + 1 @@ -135,11 +134,11 @@ Item { sourceComponent: loader.item ? loader.item.tab : null anchors.fill: parent - property Item control: tabFrame + property Item control: tabView property Item tab: tabitem property int index: tabindex - property bool nextSelected: tabFrame.current === index + 1 - property bool previousSelected: tabFrame.current === index - 1 + property bool nextSelected: tabView.current === index + 1 + property bool previousSelected: tabView.current === index - 1 property string title: tab.title } @@ -147,11 +146,11 @@ Item { id: mousearea anchors.fill: parent hoverEnabled: true - onPressed: tabFrame.current = index + onPressed: tabView.current = index onPressAndHold: tabitem.parent = null } Accessible.role: Accessible.PageTab - Accessible.name: tabFrame.tabs[index].title + Accessible.name: tabView.tabs[index].title } } } diff --git a/src/styles/Desktop/TabFrameStyle.qml b/src/styles/Desktop/TabViewStyle.qml similarity index 100% rename from src/styles/Desktop/TabFrameStyle.qml rename to src/styles/Desktop/TabViewStyle.qml diff --git a/src/styles/TabFrameStyle.qml b/src/styles/TabViewStyle.qml similarity index 98% rename from src/styles/TabFrameStyle.qml rename to src/styles/TabViewStyle.qml index 56cac100b..bcc8d4faa 100644 --- a/src/styles/TabFrameStyle.qml +++ b/src/styles/TabViewStyle.qml @@ -41,10 +41,10 @@ import QtQuick 2.0 import QtQuick.Controls.Styles 1.0 /*! - \qmltype TabFrameStyle + \qmltype TabViewStyle \internal \inqmlmodule QtQuick.Controls.Styles 1.0 - \brief provides custom styling for TabFrame + \brief provides custom styling for TabView */ Style { diff --git a/src/styles/qmldir b/src/styles/qmldir index 223c2178b..eee1abd17 100644 --- a/src/styles/qmldir +++ b/src/styles/qmldir @@ -9,7 +9,7 @@ ScrollBarStyle 1.0 ScrollBarStyle.qml SliderStyle 1.0 SliderStyle.qml SpinBoxStyle 1.0 SpinBoxStyle.qml TabStyle 1.0 TabStyle.qml -TabFrameStyle 1.0 TabFrameStyle.qml +TabViewStyle 1.0 TabViewStyle.qml TextAreaStyle 1.0 TextAreaStyle.qml TextFieldStyle 1.0 TextFieldStyle.qml ToolBarStyle 1.0 ToolBarStyle.qml diff --git a/src/styles/styles.pro b/src/styles/styles.pro index 70c6ba1eb..f0d44f6a9 100644 --- a/src/styles/styles.pro +++ b/src/styles/styles.pro @@ -14,7 +14,7 @@ QML_FILES = \ SliderStyle.qml \ SpinBoxStyle.qml \ Style.qml \ - TabFrameStyle.qml \ + TabViewStyle.qml \ TextFieldStyle.qml \ ToolBarStyle.qml \ ToolButtonStyle.qml @@ -32,7 +32,7 @@ QML_FILES += \ Desktop/ScrollBarStyle.qml \ Desktop/SliderStyle.qml \ Desktop/SpinBoxStyle.qml \ - Desktop/TabFrameStyle.qml \ + Desktop/TabViewStyle.qml \ Desktop/TextFieldStyle.qml \ Desktop/ToolBarStyle.qml \ Desktop/ToolButtonStyle.qml diff --git a/tests/auto/controls/controls.pro b/tests/auto/controls/controls.pro index cbd7150f2..fb2feeca5 100644 --- a/tests/auto/controls/controls.pro +++ b/tests/auto/controls/controls.pro @@ -32,7 +32,7 @@ OTHER_FILES += \ $$PWD/data/tst_slider.qml \ $$PWD/data/tst_statusbar.qml \ $$PWD/data/tst_tab.qml \ - $$PWD/data/tst_tabframe.qml \ + $$PWD/data/tst_tabview.qml \ $$PWD/data/tst_tableviewcolumn.qml \ $$PWD/data/tst_toolbar.qml \ $$PWD/data/tst_toolbutton.qml \ diff --git a/tests/auto/controls/data/tst_tabframe.qml b/tests/auto/controls/data/tst_tabview.qml similarity index 86% rename from tests/auto/controls/data/tst_tabframe.qml rename to tests/auto/controls/data/tst_tabview.qml index d6e69ba8f..19661a3f9 100644 --- a/tests/auto/controls/data/tst_tabframe.qml +++ b/tests/auto/controls/data/tst_tabview.qml @@ -43,18 +43,18 @@ import QtTest 1.0 TestCase { id: testCase - name: "Tests_TabFrame" + name: "Tests_TabView" when:windowShown width:400 height:400 - function test_createTabFrame() { - var tabFrame = Qt.createQmlObject('import QtQuick.Controls 1.0; TabFrame {}', testCase, ''); + function test_createTabView() { + var tabView = Qt.createQmlObject('import QtQuick.Controls 1.0; TabView {}', testCase, ''); } function test_repeater() { - var tabFrame = Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Controls 1.0; TabFrame { Repeater { model: 3; Tab { } } }', testCase, ''); - compare(tabFrame.count, 3) + var tabView = Qt.createQmlObject('import QtQuick 2.0; import QtQuick.Controls 1.0; TabView { Repeater { model: 3; Tab { } } }', testCase, ''); + compare(tabView.count, 3) } } diff --git a/tests/manual/Layout.qml b/tests/manual/Layout.qml index 4b26865a1..9646d885b 100644 --- a/tests/manual/Layout.qml +++ b/tests/manual/Layout.qml @@ -56,7 +56,7 @@ Item { checked: false width: parent.width } - TabFrame { + TabView { id:frame width: parent.width diff --git a/tests/manual/scrollbars.qml b/tests/manual/scrollbars.qml index 4ce169da0..231ead7fc 100644 --- a/tests/manual/scrollbars.qml +++ b/tests/manual/scrollbars.qml @@ -81,7 +81,7 @@ ApplicationWindow { } } - TabFrame { + TabView { id:frame anchors.fill: parent anchors.margins: 4 diff --git a/tests/manual/stretching.qml b/tests/manual/stretching.qml index fc69d4636..9af4ca1d6 100644 --- a/tests/manual/stretching.qml +++ b/tests/manual/stretching.qml @@ -46,7 +46,7 @@ Rectangle { width: 600 height: 400 - TabFrame { + TabView { anchors.fill: parent Tab { title: "Height" diff --git a/tests/manual/stretchingcustom.qml b/tests/manual/stretchingcustom.qml index ca5b4f762..8df1f794f 100644 --- a/tests/manual/stretchingcustom.qml +++ b/tests/manual/stretchingcustom.qml @@ -46,7 +46,7 @@ Rectangle { width: 600 height: 400 - TabFrame { + TabView { anchors.fill: parent Tab { title: "Height" -- GitLab