summaryrefslogtreecommitdiff
path: root/src/controls
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@digia.com>2013-08-02 19:55:17 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-03 14:09:02 +0200
commit117c0dc47a1a255987dda498f9727672c9106b48 (patch)
treeb3bad97e1180af192f0c5cb6dc92f1cf606403fc /src/controls
parent7a9e41ac5014454dba9df5285777e91846b9b3ea (diff)
downloadqtquickcontrols-117c0dc47a1a255987dda498f9727672c9106b48.tar.gz
Be bit more clever with when we clip.
Clipping breaks every optimization the scene graph can do, so we should avoid it when possible. Change-Id: I774bfedb19e0fa9f48c35a8db84a81f5528a4ef8 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'src/controls')
-rw-r--r--src/controls/SpinBox.qml2
-rw-r--r--src/controls/TextField.qml5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/controls/SpinBox.qml b/src/controls/SpinBox.qml
index b1f87cec..a952838c 100644
--- a/src/controls/SpinBox.qml
+++ b/src/controls/SpinBox.qml
@@ -213,7 +213,7 @@ Control {
TextInput {
id: input
- clip: true
+ clip: contentWidth > width
anchors.fill: parent
anchors.leftMargin: __style ? __style.padding.left : 0
anchors.topMargin: __style ? __style.padding.top : 0
diff --git a/src/controls/TextField.qml b/src/controls/TextField.qml
index e9ea9bf9..1648ac57 100644
--- a/src/controls/TextField.qml
+++ b/src/controls/TextField.qml
@@ -559,7 +559,7 @@ Control {
verticalAlignment: textInput.verticalAlignment
opacity: !textInput.text.length ? 1 : 0
color: __panel ? __panel.placeholderTextColor : "darkgray"
- clip: true
+ clip: contentWidth > width;
elide: Text.ElideRight
renderType: Text.NativeRendering
Behavior on opacity { NumberAnimation { duration: 90 } }
@@ -582,7 +582,8 @@ Control {
verticalAlignment: Text.AlignVCenter
color: __panel ? __panel.textColor : "darkgray"
- clip: true
+ clip: contentWidth > width
+
renderType: Text.NativeRendering
onAccepted: textfield.accepted()