From cb471582e57fde50d1e60112b3b613179afccae1 Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Sun, 10 Dec 2017 01:34:03 +0300 Subject: [PATCH] 10334 Unable to type in Go To app search bar after UI reappears from moving Avatar --- .../qml/hifi/tablet/TabletAddressDialog.qml | 40 ++++++++++++++----- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml index 6aa3b8e7fe..160151144b 100644 --- a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml +++ b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml @@ -20,6 +20,8 @@ import "../" import "../toolbars" import "../../styles-uit" as HifiStyles import "../../controls-uit" as HifiControls +import QtQuick.Controls 2.2 as QQC2 +import QtQuick.Templates 2.2 as T // references HMD, AddressManager, AddressBarDialog from root context @@ -223,7 +225,7 @@ StackView { visible: addressLine.text.length === 0 } - TextField { + QQC2.TextField { id: addressLine width: addressLineContainer.width - addressLineContainer.anchors.leftMargin - addressLineContainer.anchors.rightMargin; anchors { @@ -238,16 +240,36 @@ StackView { addressBarDialog.keyboardEnabled = false; toggleOrGo(); } - placeholderText: "Type domain address here" + + // unfortunately TextField from Quick Controls 2 disallow customization of placeHolderText color without creation of new style + property string placeholderText2: "Type domain address here" verticalAlignment: TextInput.AlignBottom - style: TextFieldStyle { - textColor: hifi.colors.text - placeholderTextColor: "gray" - font { - family: hifi.fonts.fontFamily - pixelSize: hifi.fonts.pixelSize * 0.75 + + font { + family: hifi.fonts.fontFamily + pixelSize: hifi.fonts.pixelSize * 0.75 + } + + color: hifi.colors.text + background: Item {} + + QQC2.Label { + T.TextField { + id: control + + padding: 6 // numbers taken from Qt\5.9.2\Src\qtquickcontrols2\src\imports\controls\TextField.qml + leftPadding: padding + 4 } - background: Item {} + + font: parent.font + + x: control.leftPadding + y: control.topPadding + + text: parent.placeholderText2 + verticalAlignment: "AlignVCenter" + color: 'gray' + visible: parent.text === '' } }