diff options
author | Damian Jansen <damian.jansen@nokia.com> | 2011-05-16 10:11:00 +1000 |
---|---|---|
committer | Damian Jansen <damian.jansen@nokia.com> | 2011-05-17 13:42:54 +1000 |
commit | c7490be4c04c32e11657311bdef9e80c6c02b3c7 (patch) | |
tree | a1e1a7504fed35c2fc4c7dc48dd88e5b56d8b07c | |
parent | 279180e02b18d93de2449252b17f256f88e92fc5 (diff) |
Improve textinput test app.
-rw-r--r-- | Qt/examples/declarative/textinput/textinput.qml | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/Qt/examples/declarative/textinput/textinput.qml b/Qt/examples/declarative/textinput/textinput.qml index 70b3ebf..d0cf3e9 100644 --- a/Qt/examples/declarative/textinput/textinput.qml +++ b/Qt/examples/declarative/textinput/textinput.qml @@ -44,11 +44,11 @@ import QtQuick 1.1 Rectangle { height: 360; width: 640; color: "gray" - Rectangle { id: textinput1box; width: 200; height: 30; color: "green" + Rectangle { id: textinput1box; width: 200; height: 30; color: "green"; border.color: textinput1.activeFocus ? "red" : "green" anchors.left: parent.left; anchors.leftMargin: 20; anchors.top: parent.top; anchors.topMargin: 10 } Rectangle { - id: textinput2box; width: 200; height: 30; color: "lightblue" + id: textinput2box; width: 200; height: 30; color: "lightblue"; border.color: textinput2.activeFocus ? "red" : "lightblue" anchors.left: parent.left; anchors.leftMargin: 20; anchors.top: textinput1.bottom; anchors.topMargin: 10 } TextInput { @@ -61,6 +61,7 @@ Rectangle { smooth: smoothon.active cursorVisible: cursoron.active autoScroll: autoscrollon.active + focus: true onFocusChanged: { if(focus){ cursoron.active = true; } } } @@ -103,7 +104,7 @@ Rectangle { ListView { id: controlsview model: controls - height: parent.height - 90; width: parent.width - 10; orientation: ListView.Horizontal + height: parent.height *.6; width: parent.width - 10; orientation: ListView.Horizontal anchors.horizontalCenter: parent.horizontalCenter; anchors.bottom: parent.bottom; anchors.bottomMargin: 5 } @@ -209,16 +210,20 @@ Rectangle { // Text Styling Item { id: styling - height: controlsview.height; width: 100 - Column { - id: buttonlist - ToggleButton { id: bolded; effectname: "Bold" } - ToggleButton { id: italics; effectname: "Italics" } - ToggleButton { id: strikeouton; effectname: "Strikeout" } - ToggleButton { id: underlineon; effectname: "Underline" } - ToggleButton { id: smoothon; effectname: "Smooth" } - ToggleButton { id: cursoron; effectname: "Cursor"; active: true } - ToggleButton { id: autoscrollon; effectname: "Autoscroll" } + height: controlsview.height; width: 200 + Row { + Column { + id: buttonlist + ToggleButton { id: bolded; effectname: "Bold" } + ToggleButton { id: italics; effectname: "Italics" } + ToggleButton { id: strikeouton; effectname: "Strikeout" } + ToggleButton { id: underlineon; effectname: "Underline" } + } + Column { + ToggleButton { id: smoothon; effectname: "Smooth" } + ToggleButton { id: cursoron; effectname: "Cursor"; active: true } + ToggleButton { id: autoscrollon; effectname: "Autoscroll" } + } } } |