mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 00:13:29 +02:00
Enable address entry by typing without clicking in address bar
This commit is contained in:
parent
808419d988
commit
b70eac353b
1 changed files with 8 additions and 7 deletions
|
@ -185,7 +185,7 @@ Window {
|
||||||
color: "gray";
|
color: "gray";
|
||||||
clip: true;
|
clip: true;
|
||||||
anchors.fill: addressLine;
|
anchors.fill: addressLine;
|
||||||
visible: !addressLine.activeFocus;
|
visible: addressLine.text.length === 0
|
||||||
}
|
}
|
||||||
TextInput {
|
TextInput {
|
||||||
id: addressLine
|
id: addressLine
|
||||||
|
@ -201,8 +201,10 @@ Window {
|
||||||
bottomMargin: parent.inputAreaStep
|
bottomMargin: parent.inputAreaStep
|
||||||
}
|
}
|
||||||
font.pixelSize: hifi.fonts.pixelSize * root.scale * 0.75
|
font.pixelSize: hifi.fonts.pixelSize * root.scale * 0.75
|
||||||
onTextChanged: filterChoicesByText()
|
onTextChanged: {
|
||||||
onActiveFocusChanged: updateLocationText(focus)
|
filterChoicesByText();
|
||||||
|
updateLocationText(text.length > 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,9 +362,8 @@ Window {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateLocationText(focus) {
|
function updateLocationText(visible) {
|
||||||
addressLine.text = "";
|
if (visible) {
|
||||||
if (focus) {
|
|
||||||
notice.text = "Go to a place, @user, path or network address";
|
notice.text = "Go to a place, @user, path or network address";
|
||||||
notice.color = "gray";
|
notice.color = "gray";
|
||||||
} else {
|
} else {
|
||||||
|
@ -374,9 +375,9 @@ Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
focus = false;
|
|
||||||
updateLocationText(false);
|
updateLocationText(false);
|
||||||
if (visible) {
|
if (visible) {
|
||||||
|
addressLine.forceActiveFocus();
|
||||||
fillDestinations();
|
fillDestinations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue