aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickcontrols/fusion/impl/TextFieldBackground.qml
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@qt.io>2025-09-05 15:43:42 +0800
committerMitch Curtis <mitch.curtis@qt.io>2025-09-09 09:41:23 +0800
commit006c4eedda9c42b4f47a0b9c5c11277dc341369b (patch)
tree3b3439b0eff903b865aad0f15e2f0940a97d2508 /src/quickcontrols/fusion/impl/TextFieldBackground.qml
parentd0b65b954ffa65b0e38703373ab456b06f524a78 (diff)
Fusion: give TextArea a background
This is the same background as TextField. This will cause the implicitWidth for TextArea to be the same as TextField - i.e. a bit wider - whereas before it was only as wide as the text + padding. This fixes it not being visible, especially without placeholder text. Fixes: QTBUG-139715 Pick-to: 6.9 6.10 Change-Id: Ia736c2e282497f0a40bf8726adcc2838082ea5b4 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Diffstat (limited to 'src/quickcontrols/fusion/impl/TextFieldBackground.qml')
-rw-r--r--src/quickcontrols/fusion/impl/TextFieldBackground.qml35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/quickcontrols/fusion/impl/TextFieldBackground.qml b/src/quickcontrols/fusion/impl/TextFieldBackground.qml
new file mode 100644
index 0000000000..5626d9b3dd
--- /dev/null
+++ b/src/quickcontrols/fusion/impl/TextFieldBackground.qml
@@ -0,0 +1,35 @@
+// Copyright (C) 2025 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.impl
+import QtQuick.Controls.Fusion
+
+Rectangle {
+ implicitWidth: 120
+ implicitHeight: 24
+ radius: 2
+ color: control.palette.base
+ border.color: control.activeFocus ? Fusion.highlightedOutline(control.palette) : Fusion.outline(control.palette)
+
+ required property Item control
+
+ Rectangle {
+ x: 1
+ y: 1
+ width: parent.width - 2
+ height: parent.height - 2
+ color: "transparent"
+ border.color: Color.transparent(Fusion.highlightedOutline(control.palette), 40 / 255)
+ visible: control.activeFocus
+ radius: 1.7
+ }
+
+ Rectangle {
+ x: 2
+ y: 1
+ width: parent.width - 4
+ height: 1
+ color: Fusion.topShadow
+ }
+}