Initial import from the monolithic Qt.
[profile/ivi/qtdeclarative.git] / tests / auto / declarative / qmlvisual / qdeclarativetextinput / cursorDelegate.qml
1 import QtQuick 1.0
2 import "../shared" 1.0
3
4 Rectangle {
5     resources: [
6         Component { id: cursorA
7             Item { id: cPage;
8                 Behavior on x { NumberAnimation { } }
9                 Behavior on y { NumberAnimation { } }
10                 Behavior on height { NumberAnimation { duration: 200 } }
11                 Rectangle { id: cRectangle; color: "black"; y: 1; width: 1; height: parent.height-2;
12                     Rectangle { id:top; color: "black"; width: 3; height: 1; x: -1; y:0}
13                     Rectangle { id:bottom; color: "black"; width: 3; height: 1; x: -1; anchors.bottom: parent.bottom;}
14                     opacity: 1
15                     SequentialAnimation on opacity { running: cPage.parent.focus == true; loops: Animation.Infinite;
16                         NumberAnimation { to: 1; duration: 500; easing.type: "InQuad"}
17                         NumberAnimation { to: 0; duration: 500; easing.type: "OutQuad"}
18                      }
19                 }
20                 width: 1;
21             }
22         }
23     ]
24     width: 400
25     height: 200
26     color: "white"
27     TestTextInput { id: mainText
28         text: "Hello World"
29         cursorDelegate: cursorA
30         focus: true
31         font.pixelSize: 28
32         selectionColor: "lightsteelblue"
33         selectedTextColor: "deeppink"
34         color: "forestgreen"
35         anchors.centerIn: parent
36     }
37 }