mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Merge pull request #16213 from zfox23/goToTopBar
DEV-576: Allow users to type HiFi locations into the SimplifiedUI top bar just like GOTO
This commit is contained in:
commit
d5ff3cd871
1 changed files with 44 additions and 1 deletions
|
@ -9,6 +9,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import QtQuick 2.10
|
import QtQuick 2.10
|
||||||
|
import hifi.simplifiedUI.simplifiedControls 1.0 as SimplifiedControls
|
||||||
import "../simplifiedConstants" as SimplifiedConstants
|
import "../simplifiedConstants" as SimplifiedConstants
|
||||||
import "../inputDeviceButton" as InputDeviceButton
|
import "../inputDeviceButton" as InputDeviceButton
|
||||||
import stylesUit 1.0 as HifiStylesUit
|
import stylesUit 1.0 as HifiStylesUit
|
||||||
|
@ -157,7 +158,7 @@ Rectangle {
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: avatarButtonImage
|
id: avatarButtonImage
|
||||||
source: "./images/defaultAvatar.svg"
|
source: "../images/defaultAvatar.svg"
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: 32
|
width: 32
|
||||||
height: width
|
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 {
|
Item {
|
||||||
id: hmdButtonContainer
|
id: hmdButtonContainer
|
||||||
|
|
Loading…
Reference in a new issue