aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicknativestyle/controls/DefaultTextArea.qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicknativestyle/controls/DefaultTextArea.qml')
-rw-r--r--src/quicknativestyle/controls/DefaultTextArea.qml53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/quicknativestyle/controls/DefaultTextArea.qml b/src/quicknativestyle/controls/DefaultTextArea.qml
new file mode 100644
index 0000000000..faab250fae
--- /dev/null
+++ b/src/quicknativestyle/controls/DefaultTextArea.qml
@@ -0,0 +1,53 @@
+// Copyright (C) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Controls.impl
+import QtQuick.Templates as T
+import QtQuick.NativeStyle as NativeStyle
+
+T.TextArea {
+ id: control
+
+ implicitWidth: Math.max(contentWidth + leftPadding + rightPadding,
+ implicitBackgroundWidth + leftInset + rightInset,
+ placeholder.implicitWidth + leftPadding + rightPadding)
+ implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
+ implicitBackgroundHeight + topInset + bottomInset,
+ placeholder.implicitHeight + topPadding + bottomPadding)
+
+ leftPadding: 7
+ rightPadding: 7
+ topPadding: 3
+ bottomPadding: 3
+
+ color: control.palette.text
+ selectionColor: control.palette.highlight
+ selectedTextColor: control.palette.highlightedText
+ placeholderTextColor: control.palette.placeholderText
+ verticalAlignment: TextInput.AlignTop
+
+ readonly property bool __notCustomizable: true
+
+ PlaceholderText {
+ id: placeholder
+ x: control.leftPadding
+ y: control.topPadding
+ width: control.width - (control.leftPadding + control.rightPadding)
+ height: control.height - (control.topPadding + control.bottomPadding)
+ text: control.placeholderText
+ font: control.font
+ color: control.placeholderTextColor
+ verticalAlignment: control.verticalAlignment
+ visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
+ elide: Text.ElideRight
+ renderType: control.renderType
+ }
+
+ background: Rectangle {
+ color: control.palette.light
+
+ readonly property bool __ignoreNotCustomizable: true
+ }
+}