From 65dd1940c0d4a367153008b9f4995df6c1d1aa9d Mon Sep 17 00:00:00 2001 From: Ronan Abhamon Date: Thu, 8 Dec 2016 14:13:59 +0100 Subject: [PATCH] feat(ui/modules/Common/Form/TransparentTextInput): background color has the same size that content --- tests/ui/modules/Common/Form/TransparentTextInput.qml | 11 +++++++---- tests/ui/views/App/MainWindow/ContactEdit.qml | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/ui/modules/Common/Form/TransparentTextInput.qml b/tests/ui/modules/Common/Form/TransparentTextInput.qml index 6b93e52c6..b207af6bc 100644 --- a/tests/ui/modules/Common/Form/TransparentTextInput.qml +++ b/tests/ui/modules/Common/Form/TransparentTextInput.qml @@ -25,13 +25,16 @@ Item { } Rectangle { - anchors.fill: parent - color: textInput.activeFocus && !readOnly + color: textInput.activeFocus && !textInput.readOnly ? TransparentTextInputStyle.backgroundColor : // No Style constant, see component name. // It's a `transparent` TextInput. - 'transparent' - z: -1 + 'transparent' + height: parent.height + width: { + var width = textInput.contentWidth + parent.padding * 2 + return width < parent.width ? width : parent.width + } } TextInput { diff --git a/tests/ui/views/App/MainWindow/ContactEdit.qml b/tests/ui/views/App/MainWindow/ContactEdit.qml index 36ba424e0..2a56c0e37 100644 --- a/tests/ui/views/App/MainWindow/ContactEdit.qml +++ b/tests/ui/views/App/MainWindow/ContactEdit.qml @@ -165,6 +165,7 @@ ColumnLayout { id: infoList width: flick.contentWidth + ListForm { defaultData: _contact.sipAddresses placeholder: qsTr('sipAccountsInput')