aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/tutorials/gettingStartedQml/texteditor.qml
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2013-08-01 11:39:02 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-09 15:47:23 +0200
commitfc8b40f888139342ebe0d4ce7d507005572737db (patch)
treee90b81b9922fcb1b615d131a487c282cc3a45841 /examples/quick/tutorials/gettingStartedQml/texteditor.qml
parent04f699d26a3f06dbd98d9bd3e0f64ee9980a6a26 (diff)
Doc: Update example used for QML getting started tutorial
Update the example project referred to in Getting Started with Qt Quick tutorial. - Fix coding/comment style issues - Change plugin TARGET name, Use /imports as the destination directory - Fix qmldir with proper module info, delete unused qmldir from /core - Add a .qmlproject file Change-Id: If269e61fb76399faae753469dc251d07cc219139 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Diffstat (limited to 'examples/quick/tutorials/gettingStartedQml/texteditor.qml')
-rw-r--r--examples/quick/tutorials/gettingStartedQml/texteditor.qml57
1 files changed, 30 insertions, 27 deletions
diff --git a/examples/quick/tutorials/gettingStartedQml/texteditor.qml b/examples/quick/tutorials/gettingStartedQml/texteditor.qml
index 6f62301413..1850476b53 100644
--- a/examples/quick/tutorials/gettingStartedQml/texteditor.qml
+++ b/examples/quick/tutorials/gettingStartedQml/texteditor.qml
@@ -44,14 +44,14 @@ import "core"
Rectangle {
id: screen
width: 1000; height: 1000
- property int partition: height/3
- border { width: 1; color: "#DCDCCC"}
+ property int partition: height / 3
state: "DRAWER_CLOSED"
- //Item 1: MenuBar on the top portion of the screen
+ // Item 1: MenuBar on the top portion of the screen
MenuBar {
- id:menuBar
- height: screen.partition; width: screen.width
+ id: menuBar
+ height: screen.partition
+ width: screen.width
z: 1
}
@@ -61,26 +61,31 @@ Rectangle {
y: drawer.height
color: "#3F3F3F"
fontColor: "#DCDCCC"
- height: partition*2; width:parent.width
+ height: partition * 2
+ width: parent.width
}
- //Item 3: The drawer handle
+ // Item 3: The drawer handle
Rectangle {
id: drawer
- height: 15; width: parent.width
- border { color : "#6A6D6A"; width: 1 }
+ height:15; width: parent.width
+ border.color : "#6A6D6A"
+ border.width: 1
z: 1
+
gradient: Gradient {
- GradientStop { position: 0.0; color: "#8C8F8C" }
- GradientStop { position: 0.17; color: "#6A6D6A" }
- GradientStop { position: 0.77; color: "#3F3F3F" }
- GradientStop { position: 1.0; color: "#6A6D6A" }
- }
+ GradientStop { position: 0.0; color: "#8C8F8C" }
+ GradientStop { position: 0.17; color: "#6A6D6A" }
+ GradientStop { position: 0.77; color: "#3F3F3F" }
+ GradientStop { position: 1.0; color: "#6A6D6A" }
+ }
+
Image {
id: arrowIcon
source: "images/arrow.png"
anchors.horizontalCenter: parent.horizontalCenter
- Behavior{ NumberAnimation { property: "rotation"; easing.type: Easing.OutExpo } }
+
+ Behavior { NumberAnimation { property: "rotation"; easing.type: Easing.OutExpo } }
}
MouseArea {
@@ -88,30 +93,28 @@ Rectangle {
anchors.fill: parent
hoverEnabled: true
onEntered: parent.border.color = Qt.lighter("#6A6D6A")
- onExited: parent.border.color = "#6A6D6A"
+ onExited: parent.border.color = "#6A6D6A"
onClicked: {
- if (screen.state == "DRAWER_CLOSED") {
+ if (screen.state == "DRAWER_CLOSED")
screen.state = "DRAWER_OPEN"
- }
- else if (screen.state == "DRAWER_OPEN"){
+ else if (screen.state == "DRAWER_OPEN")
screen.state = "DRAWER_CLOSED"
- }
}
}
}
//! [states]
- states:[
+ states: [
State {
name: "DRAWER_OPEN"
- PropertyChanges { target: menuBar; y: 0}
- PropertyChanges { target: textArea; y: partition + drawer.height}
- PropertyChanges { target: drawer; y: partition}
- PropertyChanges { target: arrowIcon; rotation: 180}
+ PropertyChanges { target: menuBar; y: 0 }
+ PropertyChanges { target: textArea; y: partition + drawer.height }
+ PropertyChanges { target: drawer; y: partition }
+ PropertyChanges { target: arrowIcon; rotation: 180 }
},
State {
name: "DRAWER_CLOSED"
- PropertyChanges { target: menuBar; y:-height; }
+ PropertyChanges { target: menuBar; y: -height; }
PropertyChanges { target: textArea; y: drawer.height; height: screen.height - drawer.height }
PropertyChanges { target: drawer; y: 0 }
PropertyChanges { target: arrowIcon; rotation: 0 }
@@ -123,7 +126,7 @@ Rectangle {
transitions: [
Transition {
to: "*"
- NumberAnimation { target: textArea; properties: "y, height"; duration: 100; easing.type:Easing.OutExpo }
+ NumberAnimation { target: textArea; properties: "y, height"; duration: 100; easing.type: Easing.OutExpo }
NumberAnimation { target: menuBar; properties: "y"; duration: 100; easing.type: Easing.OutExpo }
NumberAnimation { target: drawer; properties: "y"; duration: 100; easing.type: Easing.OutExpo }
}