From 5a362f80d9da6d2d36efc127588f3c427211f98c Mon Sep 17 00:00:00 2001 From: Rainer Keller Date: Tue, 17 Dec 2013 15:46:00 +0100 Subject: Remove background image of text input application The image does not scale well and looks horribly. Change-Id: I3c0b34588e74315623dfb68c260706151be2bade Reviewed-by: Eirik Aavitsland --- basicsuite/Text Input/background.png | Bin 34931 -> 0 bytes basicsuite/Text Input/main.qml | 118 +++++++++++++++++------------------ 2 files changed, 57 insertions(+), 61 deletions(-) delete mode 100644 basicsuite/Text Input/background.png diff --git a/basicsuite/Text Input/background.png b/basicsuite/Text Input/background.png deleted file mode 100644 index d85f6ee..0000000 Binary files a/basicsuite/Text Input/background.png and /dev/null 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) } } } -- cgit v1.2.3