mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-08 15:28:49 +02:00
Merge pull request #8663 from howard-stearns/address-bar-text-area-changes
Address bar text area changes
This commit is contained in:
commit
4974c88880
1 changed files with 39 additions and 11 deletions
|
@ -15,6 +15,7 @@ import "styles"
|
||||||
import "windows"
|
import "windows"
|
||||||
import "hifi"
|
import "hifi"
|
||||||
import "hifi/toolbars"
|
import "hifi/toolbars"
|
||||||
|
import "styles-uit" as HifiStyles
|
||||||
import "controls-uit" as HifiControls
|
import "controls-uit" as HifiControls
|
||||||
|
|
||||||
Window {
|
Window {
|
||||||
|
@ -168,7 +169,24 @@ Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME replace with TextField
|
HifiStyles.RalewayLight {
|
||||||
|
id: notice;
|
||||||
|
font.pixelSize: hifi.fonts.pixelSize * root.scale * 0.50;
|
||||||
|
anchors {
|
||||||
|
top: parent.top
|
||||||
|
topMargin: parent.inputAreaStep + 12
|
||||||
|
left: addressLine.left
|
||||||
|
right: addressLine.right
|
||||||
|
}
|
||||||
|
}
|
||||||
|
HifiStyles.FiraSansRegular {
|
||||||
|
id: location;
|
||||||
|
font.pixelSize: addressLine.font.pixelSize;
|
||||||
|
color: "gray";
|
||||||
|
clip: true;
|
||||||
|
anchors.fill: addressLine;
|
||||||
|
visible: !addressLine.activeFocus;
|
||||||
|
}
|
||||||
TextInput {
|
TextInput {
|
||||||
id: addressLine
|
id: addressLine
|
||||||
focus: true
|
focus: true
|
||||||
|
@ -179,14 +197,12 @@ Window {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
leftMargin: forwardArrow.width
|
leftMargin: forwardArrow.width
|
||||||
rightMargin: forwardArrow.width / 2
|
rightMargin: forwardArrow.width / 2
|
||||||
topMargin: parent.inputAreaStep + hifi.layout.spacing
|
topMargin: parent.inputAreaStep + (2 * hifi.layout.spacing)
|
||||||
bottomMargin: parent.inputAreaStep + hifi.layout.spacing
|
bottomMargin: parent.inputAreaStep
|
||||||
}
|
}
|
||||||
font.pixelSize: hifi.fonts.pixelSize * root.scale * 0.75
|
font.pixelSize: hifi.fonts.pixelSize * root.scale * 0.75
|
||||||
helperText: "Go to: place, @user, /path, network address"
|
|
||||||
helperPixelSize: font.pixelSize * 0.75
|
|
||||||
helperItalic: true
|
|
||||||
onTextChanged: filterChoicesByText()
|
onTextChanged: filterChoicesByText()
|
||||||
|
onActiveFocusChanged: updateLocationText(focus)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,12 +360,24 @@ Window {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onVisibleChanged: {
|
function updateLocationText(focus) {
|
||||||
if (visible) {
|
addressLine.text = "";
|
||||||
addressLine.forceActiveFocus()
|
if (focus) {
|
||||||
fillDestinations();
|
notice.text = "Go to a place, @user, path or network address";
|
||||||
|
notice.color = "gray";
|
||||||
} else {
|
} else {
|
||||||
addressLine.text = ""
|
notice.text = AddressManager.isConnected ? "Your location:" : "Not Connected";
|
||||||
|
notice.color = AddressManager.isConnected ? "gray" : "crimson";
|
||||||
|
// Display hostname, which includes ip address, localhost, and other non-placenames.
|
||||||
|
location.text = (AddressManager.hostname || '') + (AddressManager.pathname ? AddressManager.pathname.match(/\/[^\/]+/)[0] : '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
focus = false;
|
||||||
|
updateLocationText(false);
|
||||||
|
if (visible) {
|
||||||
|
fillDestinations();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue