summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Keller <rainer.keller@digia.com>2013-12-17 15:46:00 +0100
committerRainer Keller <rainer.keller@digia.com>2014-01-17 10:18:23 +0200
commit5a362f80d9da6d2d36efc127588f3c427211f98c (patch)
tree2d665fe3484d7dea07d16942f5a4172ff278c0ac
parent18c237dc06da8a870fc9a0ecd50c5ca48678224a (diff)
Remove background image of text input application
The image does not scale well and looks horribly. Change-Id: I3c0b34588e74315623dfb68c260706151be2bade Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
-rw-r--r--basicsuite/Text Input/background.pngbin34931 -> 0 bytes
-rw-r--r--basicsuite/Text Input/main.qml118
2 files changed, 57 insertions, 61 deletions
diff --git a/basicsuite/Text Input/background.png b/basicsuite/Text Input/background.png
deleted file mode 100644
index d85f6ee..0000000
--- a/basicsuite/Text Input/background.png
+++ /dev/null
Binary files differ
diff --git a/basicsuite/Text Input/main.qml b/basicsuite/Text Input/main.qml
index 5c068d9..b67d960 100644
--- a/basicsuite/Text Input/main.qml
+++ b/basicsuite/Text Input/main.qml
@@ -40,77 +40,73 @@
import QtQuick 2.0
-Image {
- source: "background.png"
+Flickable {
+ id: flickable
- Flickable {
- id: flickable
+ property real scrollMarginVertical: 20
- property real scrollMarginVertical: 20
+ anchors.fill: parent
+ contentWidth: content.width
+ contentHeight: content.height
+ interactive: contentHeight > height
+ flickableDirection: Flickable.VerticalFlick
+ children: ScrollBar {}
- anchors.fill: parent
- contentWidth: content.width
- contentHeight: content.height
- interactive: contentHeight > height
- flickableDirection: Flickable.VerticalFlick
- children: ScrollBar {}
+ MouseArea {
+ id: content
- MouseArea {
- id: content
+ width: flickable.width
+ height: textEditors.height + 24
- width: flickable.width
- height: textEditors.height + 24
+ onClicked: focus = true
- onClicked: focus = true
+ Column {
+ id: textEditors
+ spacing: 15
+ x: 12; y: 12
+ width: parent.width - 26
- Column {
- id: textEditors
- spacing: 15
- x: 12; y: 12
- width: parent.width - 26
-
- Text {
- color: "#EEEEEE"
- text: "Tap fields to enter text"
- anchors.horizontalCenter: parent.horizontalCenter
- font.pixelSize: 22
- }
- TextField {
- width: parent.width
- previewText: "One line field"
- enterKeyText: "Next"
- enterKeyEnabled: text.length > 0
- onEnterKeyClicked: passwordField.focus = true
- }
- TextField {
- id: passwordField
+ Text {
+ color: "#EEEEEE"
+ text: "Tap fields to enter text"
+ anchors.horizontalCenter: parent.horizontalCenter
+ font.pixelSize: 22
+ }
+ TextField {
+ width: parent.width
+ previewText: "One line field"
+ enterKeyText: "Next"
+ enterKeyEnabled: text.length > 0
+ onEnterKeyClicked: passwordField.focus = true
+ }
+ TextField {
+ id: passwordField
- width: parent.width
- echoMode: TextInput.PasswordEchoOnEdit
- previewText: "Password field"
- inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText
- enterKeyText: "Next"
- enterKeyEnabled: text.length > 0
- onEnterKeyClicked: numberField.focus = true
- }
- TextField {
- id: numberField
+ width: parent.width
+ echoMode: TextInput.PasswordEchoOnEdit
+ previewText: "Password field"
+ inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText
+ enterKeyText: "Next"
+ enterKeyEnabled: text.length > 0
+ onEnterKeyClicked: numberField.focus = true
+ }
+ TextField {
+ id: numberField
- validator: RegExpValidator { regExp: /^[0-9\+\-\#\*\ ]{6,}$/ }
- width: parent.width
- previewText: "Phone number field"
- inputMethodHints: Qt.ImhDialableCharactersOnly
- enterKeyText: "Next"
- enterKeyEnabled: text.length > 0
- onEnterKeyClicked: textArea.focus = true
- }
- TextArea {
- id: textArea
+ validator: RegExpValidator { regExp: /^[0-9\+\-\#\*\ ]{6,}$/ }
+ width: parent.width
+ previewText: "Phone number field"
+ inputMethodHints: Qt.ImhDialableCharactersOnly
+ enterKeyText: "Next"
+ enterKeyEnabled: text.length > 0
+ onEnterKeyClicked: textArea.focus = true
+ }
+ TextArea {
+ id: textArea
- width: parent.width
- previewText: "Multiple lines field"
- height: Math.max(206, implicitHeight)
- }
+ width: parent.width
+ previewText: "Multiple lines field"
+ height: Math.max(206, implicitHeight)
}
}
}