From 5aa53579156a5234a660999c876f17339542113a Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 4 Jun 2013 11:53:38 +0200 Subject: Update controls to work with latest API Change-Id: Ib2d71f1b81aa5d4befbf8f61dbfbb0f92ddc00fa Reviewed-by: Gunnar Sletta --- basicsuite/Controls Layouts/main.qml | 8 +------- basicsuite/Controls Touch/content/ButtonPage.qml | 13 +++++++++---- .../Controls Touch/content/ProgressBarPage.qml | 2 +- basicsuite/Controls Touch/content/SliderPage.qml | 2 +- basicsuite/Controls Touch/content/TabBarPage.qml | 7 ++++--- .../Controls Touch/content/TextInputPage.qml | 2 +- basicsuite/Controls Touch/main.qml | 22 ++++++++-------------- basicsuite/Launcher Settings/main.qml | 10 ++-------- 8 files changed, 27 insertions(+), 39 deletions(-) diff --git a/basicsuite/Controls Layouts/main.qml b/basicsuite/Controls Layouts/main.qml index 7ed3323..b12b6c8 100644 --- a/basicsuite/Controls Layouts/main.qml +++ b/basicsuite/Controls Layouts/main.qml @@ -54,7 +54,6 @@ Rectangle { } property int margin: 11 - width: 1280 height: 720 @@ -65,8 +64,6 @@ Rectangle { GroupBox { id: rowBox title: "Row layout" - contentWidth: rowLayout.implicitWidth - contentHeight: rowLayout.implicitHeight Layout.fillWidth: true RowLayout { @@ -85,8 +82,6 @@ Rectangle { GroupBox { id: gridBox title: "Grid layout" - contentWidth: gridLayout.implicitWidth - contentHeight: gridLayout.implicitHeight Layout.fillWidth: true GridLayout { @@ -115,8 +110,7 @@ Rectangle { TextArea { id: t3 text: "This fills the whole cell" - width: 200 - height: 400 + Layout.minimumHeight: 30 Layout.fillHeight: true Layout.fillWidth: true } diff --git a/basicsuite/Controls Touch/content/ButtonPage.qml b/basicsuite/Controls Touch/content/ButtonPage.qml index cc5925c..f431a52 100644 --- a/basicsuite/Controls Touch/content/ButtonPage.qml +++ b/basicsuite/Controls Touch/content/ButtonPage.qml @@ -86,7 +86,7 @@ Item { anchors.margins: 20 style: touchStyle text: "Dont press me" - onClicked: if (pageStack) pageStack.pop() + onClicked: if (stackView) stackView.pop() } } @@ -94,7 +94,7 @@ Item { Component { id: touchStyle ButtonStyle { - background: Item { + panel: Item { implicitHeight: 50 implicitWidth: 320 BorderImage { @@ -106,10 +106,15 @@ Item { border.right: 8 anchors.margins: control.pressed ? -4 : 0 source: control.pressed ? "../images/button_pressed.png" : "../images/button_default.png" + Text { + text: control.text + anchors.centerIn: parent + color: "white" + font.pixelSize: 23 + renderType: Text.NativeRendering + } } } - foregroundColor: "white" - font.pixelSize: 23 } } } diff --git a/basicsuite/Controls Touch/content/ProgressBarPage.qml b/basicsuite/Controls Touch/content/ProgressBarPage.qml index 86a46b6..dc0f552 100644 --- a/basicsuite/Controls Touch/content/ProgressBarPage.qml +++ b/basicsuite/Controls Touch/content/ProgressBarPage.qml @@ -96,7 +96,7 @@ Item { Component { id: touchStyle ProgressBarStyle { - background: Rectangle { + panel: Rectangle { implicitHeight: 15 implicitWidth: 400 color: "#444" diff --git a/basicsuite/Controls Touch/content/SliderPage.qml b/basicsuite/Controls Touch/content/SliderPage.qml index 8d9ff0b..8eb9190 100644 --- a/basicsuite/Controls Touch/content/SliderPage.qml +++ b/basicsuite/Controls Touch/content/SliderPage.qml @@ -83,7 +83,7 @@ Item { color: Qt.lighter("#468bb7", 1.2) } - background: Item { + groove: Item { implicitHeight: 50 implicitWidth: 400 Rectangle { diff --git a/basicsuite/Controls Touch/content/TabBarPage.qml b/basicsuite/Controls Touch/content/TabBarPage.qml index 41de782..7651a3c 100644 --- a/basicsuite/Controls Touch/content/TabBarPage.qml +++ b/basicsuite/Controls Touch/content/TabBarPage.qml @@ -70,7 +70,8 @@ Item { Component { id: touchStyle TabViewStyle { - tabBarAlignment: "center" + tabsAlignment: Qt.AlignVCenter + tabOverlap: 0 frame: Item { } tab: Item { implicitWidth: control.width/control.count @@ -79,11 +80,11 @@ Item { anchors.fill: parent border.bottom: 8 border.top: 8 - source: tab.selected ? "../images/tab_selected.png":"../images/tabs_standard.png" + source: styleData.selected ? "../images/tab_selected.png":"../images/tabs_standard.png" Text { anchors.centerIn: parent color: "white" - text: tab.title.toUpperCase() + text: styleData.title.toUpperCase() font.pixelSize: 16 } Rectangle { diff --git a/basicsuite/Controls Touch/content/TextInputPage.qml b/basicsuite/Controls Touch/content/TextInputPage.qml index 3f408d4..605afef 100644 --- a/basicsuite/Controls Touch/content/TextInputPage.qml +++ b/basicsuite/Controls Touch/content/TextInputPage.qml @@ -87,7 +87,7 @@ Item { id: touchStyle TextFieldStyle { - foregroundColor: "white" + textColor: "white" font.pixelSize: 28 background: Item { implicitHeight: 50 diff --git a/basicsuite/Controls Touch/main.qml b/basicsuite/Controls Touch/main.qml index 18b26e9..e4d2562 100644 --- a/basicsuite/Controls Touch/main.qml +++ b/basicsuite/Controls Touch/main.qml @@ -38,10 +38,6 @@ ** ****************************************************************************/ - - - - import QtQuick 2.1 import QtQuick.Controls 1.0 import "content" @@ -58,8 +54,8 @@ Item { // Implements back key navigation Keys.onReleased: { if (event.key === Qt.Key_Back) { - if (pageStack.depth > 1) { - pageStack.pop(); + if (stackView.depth > 1) { + stackView.pop(); event.accepted = true; } else { Qt.quit(); } } @@ -77,7 +73,7 @@ Item { width: opacity ? 60 : 0 anchors.left: parent.left anchors.leftMargin: 20 - opacity: pageStack.depth > 1 ? 1 : 0 + opacity: stackView.depth > 1 ? 1 : 0 anchors.verticalCenter: parent.verticalCenter antialiasing: true height: 60 @@ -92,7 +88,7 @@ Item { id: backmouse anchors.fill: parent anchors.margins: -10 - onClicked: pageStack.pop() + onClicked: stackView.pop() } } @@ -131,11 +127,9 @@ Item { } StackView { - id: pageStack - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - anchors.top: toolbar.bottom + id: stackView + anchors.fill: parent + anchors.topMargin: toolbar.height initialItem: Item { width: parent.width @@ -145,7 +139,7 @@ Item { anchors.fill: parent delegate: AndroidDelegate { text: title - onClicked: pageStack.push(Qt.resolvedUrl(page)) + onClicked: stackView.push(Qt.resolvedUrl(page)) } } } diff --git a/basicsuite/Launcher Settings/main.qml b/basicsuite/Launcher Settings/main.qml index 83bb9ee..8384566 100644 --- a/basicsuite/Launcher Settings/main.qml +++ b/basicsuite/Launcher Settings/main.qml @@ -54,9 +54,6 @@ Rectangle { Layout.fillWidth: true - contentWidth: powerButtonColumn.implicitWidth - contentHeight: powerButtonColumn.implicitHeight - RowLayout { id: powerButtonColumn @@ -85,9 +82,6 @@ Rectangle { Layout.fillWidth: true - contentWidth: displayGrid.implicitWidth - contentHeight: displayGrid.implicitHeight - GridLayout { id: displayGrid @@ -95,8 +89,8 @@ Rectangle { flow: GridLayout.TopToBottom anchors.fill: parent - Label { text: "Brightness: " } - Label { text: "Display FPS: " } + Label { text: "Brightness: "; } + Label { text: "Display FPS: "; } Slider { maximumValue: 255 -- cgit v1.2.3