Merge pull request #9580 from zfox23/PAL_VirtualKeyboard

PAL: Raise virtual keyboard when editing DisplayName in HMD
This commit is contained in:
David Kelly 2017-02-01 14:16:03 -07:00 committed by GitHub
commit 82efb97654
2 changed files with 15 additions and 0 deletions

View file

@ -34,6 +34,7 @@ Item {
property bool isMyCard: false
property bool selected: false
property bool isAdmin: false
property bool currentlyEditingDisplayName: false
/* User image commented out for now - will probably be re-introduced later.
Column {
@ -104,6 +105,7 @@ Item {
focus = false
myDisplayName.border.width = 0
color = hifi.colors.darkGray
currentlyEditingDisplayName = false
}
}
MouseArea {
@ -115,10 +117,12 @@ Item {
myDisplayNameText.focus ? myDisplayNameText.cursorPosition = myDisplayNameText.positionAt(mouseX, mouseY, TextInput.CursorOnCharacter) : myDisplayNameText.selectAll();
myDisplayNameText.focus = true
myDisplayNameText.color = "black"
currentlyEditingDisplayName = true
}
onDoubleClicked: {
myDisplayNameText.selectAll();
myDisplayNameText.focus = true;
currentlyEditingDisplayName = true
}
onEntered: myDisplayName.color = hifi.colors.lightGrayText
onExited: myDisplayName.color = hifi.colors.textFieldLightBackground

View file

@ -51,6 +51,7 @@ Rectangle {
// This is the container for the PAL
Rectangle {
property bool punctuationMode: false
id: palContainer
// Size
width: pal.width - 50
@ -421,6 +422,16 @@ Rectangle {
onExited: adminHelpText.color = hifi.colors.redHighlight
}
}
HifiControls.Keyboard {
id: keyboard
raised: myCard.currentlyEditingDisplayName && HMD.active
numeric: parent.punctuationMode
anchors {
bottom: parent.bottom
left: parent.left
right: parent.right
}
}
}
// Timer used when selecting table rows that aren't yet present in the model
// (i.e. when selecting avatars using edit.js or sphere overlays)