diff options
Diffstat (limited to 'src/imports/controls/material/TextArea.qml')
-rw-r--r-- | src/imports/controls/material/TextArea.qml | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/imports/controls/material/TextArea.qml b/src/imports/controls/material/TextArea.qml index 40c8c412..38502ed6 100644 --- a/src/imports/controls/material/TextArea.qml +++ b/src/imports/controls/material/TextArea.qml @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Labs Controls module of the Qt Toolkit. +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL3$ ** Commercial License Usage @@ -35,8 +35,8 @@ ****************************************************************************/ import QtQuick 2.6 -import Qt.labs.templates 1.0 as T -import Qt.labs.controls.material 1.0 +import QtQuick.Templates 2.0 as T +import QtQuick.Controls.Material 2.0 T.TextArea { id: control @@ -56,6 +56,7 @@ T.TextArea { selectedTextColor: Material.primaryHighlightedTextColor cursorDelegate: Rectangle { id: cursor + clip: true // TODO color: control.Material.accentColor width: 2 visible: control.activeFocus && control.selectionStart === control.selectionEnd @@ -73,14 +74,13 @@ T.TextArea { id: timer running: control.activeFocus repeat: true - interval: Qt.styleHints.cursorFlashTime + interval: Qt.styleHints.cursorFlashTime / 2 onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0 // force the cursor visible when gaining focus onRunningChanged: cursor.opacity = 1 } } - //! [placeholder] Text { id: placeholder x: control.leftPadding @@ -93,16 +93,13 @@ T.TextArea { horizontalAlignment: control.horizontalAlignment verticalAlignment: control.verticalAlignment elide: Text.ElideRight - visible: !control.length && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) + visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) } - //! [placeholder] - //! [background] background: Rectangle { - y: control.height - height - control.bottomPadding / 2 + y: parent.height - height - control.bottomPadding / 2 implicitWidth: 120 height: control.activeFocus ? 2 : 1 color: control.activeFocus ? control.Material.accentColor : control.Material.hintTextColor } - //! [background] } |