From b70eac353b9cfcec402b7a081b31be4619fb114b Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 6 Oct 2016 15:18:07 +1300 Subject: [PATCH] Enable address entry by typing without clicking in address bar --- interface/resources/qml/AddressBarDialog.qml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/interface/resources/qml/AddressBarDialog.qml b/interface/resources/qml/AddressBarDialog.qml index 1164a0f01e..437632eb98 100644 --- a/interface/resources/qml/AddressBarDialog.qml +++ b/interface/resources/qml/AddressBarDialog.qml @@ -185,7 +185,7 @@ Window { color: "gray"; clip: true; anchors.fill: addressLine; - visible: !addressLine.activeFocus; + visible: addressLine.text.length === 0 } TextInput { id: addressLine @@ -201,8 +201,10 @@ Window { bottomMargin: parent.inputAreaStep } font.pixelSize: hifi.fonts.pixelSize * root.scale * 0.75 - onTextChanged: filterChoicesByText() - onActiveFocusChanged: updateLocationText(focus) + onTextChanged: { + filterChoicesByText(); + updateLocationText(text.length > 0); + } } } @@ -360,9 +362,8 @@ Window { }); } - function updateLocationText(focus) { - addressLine.text = ""; - if (focus) { + function updateLocationText(visible) { + if (visible) { notice.text = "Go to a place, @user, path or network address"; notice.color = "gray"; } else { @@ -374,9 +375,9 @@ Window { } onVisibleChanged: { - focus = false; updateLocationText(false); if (visible) { + addressLine.forceActiveFocus(); fillDestinations(); } }