mirror of
https://github.com/lubosz/overte.git
synced 2025-04-16 17:38:15 +02:00
DEV-576: Allow users to type HiFi locations into the SimplifiedUI top bar just like GOTO
This commit is contained in:
parent
8a8af6b14a
commit
f92c5d0882
1 changed files with 44 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
|||
//
|
||||
|
||||
import QtQuick 2.10
|
||||
import hifi.simplifiedUI.simplifiedControls 1.0 as SimplifiedControls
|
||||
import "../simplifiedConstants" as SimplifiedConstants
|
||||
import "../inputDeviceButton" as InputDeviceButton
|
||||
import stylesUit 1.0 as HifiStylesUit
|
||||
|
@ -157,7 +158,7 @@ Rectangle {
|
|||
|
||||
Image {
|
||||
id: avatarButtonImage
|
||||
source: "./images/defaultAvatar.svg"
|
||||
source: "../images/defaultAvatar.svg"
|
||||
anchors.centerIn: parent
|
||||
width: 32
|
||||
height: width
|
||||
|
@ -350,6 +351,48 @@ Rectangle {
|
|||
}
|
||||
|
||||
|
||||
TextMetrics {
|
||||
id: goToTextFieldMetrics
|
||||
font: goToTextField.font
|
||||
text: goToTextField.longPlaceholderText
|
||||
}
|
||||
|
||||
|
||||
Item {
|
||||
id: goToTextFieldContainer
|
||||
anchors.left: statusButtonContainer.right
|
||||
anchors.leftMargin: 12
|
||||
anchors.right: (hmdButtonContainer.visible ? hmdButtonContainer.left : helpButtonContainer.left)
|
||||
anchors.rightMargin: 12
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
height: parent.height
|
||||
|
||||
SimplifiedControls.TextField {
|
||||
id: goToTextField
|
||||
readonly property string shortPlaceholderText: "Jump to..."
|
||||
readonly property string longPlaceholderText: "Type the name of a location to quickly jump there..."
|
||||
anchors.centerIn: parent
|
||||
width: Math.min(parent.width, 600)
|
||||
height: parent.height - 11
|
||||
leftPadding: 8
|
||||
rightPadding: 8
|
||||
bottomBorderVisible: false
|
||||
backgroundColor: "#313131"
|
||||
placeholderText: width - leftPadding - rightPadding < goToTextFieldMetrics.width ? shortPlaceholderText : longPlaceholderText
|
||||
clip: true
|
||||
selectByMouse: true
|
||||
autoScroll: true
|
||||
onAccepted: {
|
||||
if (goToTextField.length > 0) {
|
||||
AddressManager.handleLookupString(goToTextField.text);
|
||||
goToTextField.text = "";
|
||||
parent.forceActiveFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Item {
|
||||
id: hmdButtonContainer
|
||||
|
|
Loading…
Reference in a new issue