From c7ad875485f813cc57e165bf1a9a47357265eee9 Mon Sep 17 00:00:00 2001 From: Zach Fox Date: Tue, 29 Aug 2017 15:27:53 -0700 Subject: [PATCH] Virtual keyboard and logic --- .../qml/hifi/commerce/checkout/Checkout.qml | 2 +- .../commerce/wallet/PassphraseSelection.qml | 40 ++++++ .../qml/hifi/commerce/wallet/Wallet.qml | 118 +++++++++++++----- .../commerce/wallet/images/lowerKeyboard.png | Bin 0 -> 721 bytes 4 files changed, 125 insertions(+), 35 deletions(-) create mode 100644 interface/resources/qml/hifi/commerce/wallet/images/lowerKeyboard.png diff --git a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml index 5329099df5..ce75c40458 100644 --- a/interface/resources/qml/hifi/commerce/checkout/Checkout.qml +++ b/interface/resources/qml/hifi/commerce/checkout/Checkout.qml @@ -877,7 +877,7 @@ Rectangle { if (root.purchasesReceived && root.balanceReceived) { if (root.balanceAfterPurchase < 0) { if (root.alreadyOwned) { - buyText.text = "You do not have enough HFC to purchase this item again. Go to your Purchases to view the copy you own."; + buyText.text = "You do not have enough HFC to purchase this item again. Go to your Purchases to view the copy you own."; } else { buyText.text = "You do not have enough HFC to purchase this item."; } diff --git a/interface/resources/qml/hifi/commerce/wallet/PassphraseSelection.qml b/interface/resources/qml/hifi/commerce/wallet/PassphraseSelection.qml index 70a627846b..23cf8c6ac2 100644 --- a/interface/resources/qml/hifi/commerce/wallet/PassphraseSelection.qml +++ b/interface/resources/qml/hifi/commerce/wallet/PassphraseSelection.qml @@ -74,6 +74,26 @@ Item { text = ""; } } + + onFocusChanged: { + if (focus) { + sendMessageToLightbox({method: 'walletSetup_raiseKeyboard'}); + } else if (!passphraseFieldAgain.focus) { + sendMessageToLightbox({method: 'walletSetup_lowerKeyboard'}); + } + } + + MouseArea { + anchors.fill: parent; + onClicked: { + parent.focus = true; + sendMessageToLightbox({method: 'walletSetup_raiseKeyboard'}); + } + } + + onAccepted: { + passphraseFieldAgain.focus = true; + } } HifiControlsUit.TextField { id: passphraseFieldAgain; @@ -90,6 +110,26 @@ Item { text = ""; } } + + onFocusChanged: { + if (focus) { + sendMessageToLightbox({method: 'walletSetup_raiseKeyboard'}); + } else if (!passphraseField.focus) { + sendMessageToLightbox({method: 'walletSetup_lowerKeyboard'}); + } + } + + MouseArea { + anchors.fill: parent; + onClicked: { + parent.focus = true; + sendMessageToLightbox({method: 'walletSetup_raiseKeyboard'}); + } + } + + onAccepted: { + focus = false; + } } // Security Image diff --git a/interface/resources/qml/hifi/commerce/wallet/Wallet.qml b/interface/resources/qml/hifi/commerce/wallet/Wallet.qml index 4fd085fafd..3a46082988 100644 --- a/interface/resources/qml/hifi/commerce/wallet/Wallet.qml +++ b/interface/resources/qml/hifi/commerce/wallet/Wallet.qml @@ -28,6 +28,7 @@ Rectangle { property string activeView: "initialize"; property bool securityImageResultReceived: false; property bool keyFilePathIfExistsResultReceived: false; + property bool keyboardRaised: false; // Style color: hifi.colors.baseGray; @@ -57,27 +58,6 @@ Rectangle { id: securityImageModel; } - Connections { - target: walletSetupLightbox; - onSendSignalToWallet: { - if (msg.method === 'walletSetup_cancelClicked') { - walletSetupLightbox.visible = false; - } else if (msg.method === 'walletSetup_finished') { - root.activeView = "walletHome"; - } else { - sendToScript(msg); - } - } - } - Connections { - target: notSetUp; - onSendSignalToWallet: { - if (msg.method === 'setUpClicked') { - walletSetupLightbox.visible = true; - } - } - } - Rectangle { id: walletSetupLightboxContainer; visible: walletSetupLightbox.visible || passphraseSelectionLightbox.visible || securityImageSelectionLightbox.visible; @@ -89,29 +69,51 @@ Rectangle { WalletSetupLightbox { id: walletSetupLightbox; visible: false; - z: 999; + z: 998; anchors.centerIn: walletSetupLightboxContainer; width: walletSetupLightboxContainer.width - 50; height: walletSetupLightboxContainer.height - 50; + + Connections { + onSendSignalToWallet: { + if (msg.method === 'walletSetup_cancelClicked') { + walletSetupLightbox.visible = false; + } else if (msg.method === 'walletSetup_finished') { + root.activeView = "walletHome"; + } else if (msg.method === 'walletSetup_raiseKeyboard') { + root.keyboardRaised = true; + } else if (msg.method === 'walletSetup_lowerKeyboard') { + root.keyboardRaised = false; + } else { + sendToScript(msg); + } + } + } } PassphraseSelectionLightbox { id: passphraseSelectionLightbox; visible: false; - z: 999; + z: 998; anchors.centerIn: walletSetupLightboxContainer; width: walletSetupLightboxContainer.width - 50; height: walletSetupLightboxContainer.height - 50; Connections { onSendSignalToWallet: { - sendToScript(msg); + if (msg.method === 'walletSetup_raiseKeyboard') { + root.keyboardRaised = true; + } else if (msg.method === 'walletSetup_lowerKeyboard') { + root.keyboardRaised = false; + } else { + sendToScript(msg); + } } } } SecurityImageSelectionLightbox { id: securityImageSelectionLightbox; visible: false; - z: 999; + z: 998; anchors.centerIn: walletSetupLightboxContainer; width: walletSetupLightboxContainer.width - 50; height: walletSetupLightboxContainer.height - 50; @@ -192,6 +194,14 @@ Rectangle { anchors.bottom: tabButtonsContainer.top; anchors.left: parent.left; anchors.right: parent.right; + + Connections { + onSendSignalToWallet: { + if (msg.method === 'setUpClicked') { + walletSetupLightbox.visible = true; + } + } + } } WalletHome { @@ -231,14 +241,14 @@ Rectangle { anchors.leftMargin: 16; anchors.right: parent.right; anchors.rightMargin: 16; - } - Connections { - target: security; - onSendSignalToWallet: { - if (msg.method === 'walletSecurity_changePassphrase') { - passphraseSelectionLightbox.visible = true; - } else if (msg.method === 'walletSecurity_changeSecurityImage') { - securityImageSelectionLightbox.visible = true; + + Connections { + onSendSignalToWallet: { + if (msg.method === 'walletSecurity_changePassphrase') { + passphraseSelectionLightbox.visible = true; + } else if (msg.method === 'walletSecurity_changeSecurityImage') { + securityImageSelectionLightbox.visible = true; + } } } } @@ -467,7 +477,47 @@ Rectangle { } // // TAB BUTTONS END - // + // + + Item { + id: keyboardContainer; + z: 999; + visible: keyboard.raised; + anchors { + bottom: parent.bottom; + left: parent.left; + right: parent.right; + } + + Image { + id: lowerKeyboardButton; + source: "images/lowerKeyboard.png"; + anchors.horizontalCenter: parent.horizontalCenter; + anchors.bottom: keyboard.top; + height: 30; + width: 120; + + MouseArea { + anchors.fill: parent; + + onClicked: { + root.keyboardRaised = false; + } + } + } + + HifiControlsUit.Keyboard { + id: keyboard; + property bool punctuationMode: false; + raised: HMD.mounted && root.keyboardRaised; + numeric: keyboard.punctuationMode; + anchors { + bottom: parent.bottom; + left: parent.left; + right: parent.right; + } + } + } // // FUNCTION DEFINITIONS START diff --git a/interface/resources/qml/hifi/commerce/wallet/images/lowerKeyboard.png b/interface/resources/qml/hifi/commerce/wallet/images/lowerKeyboard.png new file mode 100644 index 0000000000000000000000000000000000000000..9fc88262dbc869891f0cad5cc39b031f632206df GIT binary patch literal 721 zcmV;?0xtcDP)m0000TX;fHrLvL+uWo~o;00000Lvm$d zbY)~9cWHEJAV*0}P-HG;2LJ#9M@d9MRA}Dq+PkXaKo|$`nOroYQ83~K!OjFlEEF$j zBR1OD31Vg81NjKPfR$L-r%;5Ty@fUwB5FvCsN`~r1Ix0zoZZ8kWCHm=z+~o^Zzk|% zU^<-!Zp;tn61dPVv>O-Ng?6FcSQ5gNK?x!l43Z=%isJM6bOZ#B;~tOa^?GTVX3F>s z!@OOYW!Y}G+iJDq@%Z_CRusiB43voziA1GR$!4>vs*0j$#%$jYP1AIz(-{l~xm>PT zEOHzN0FWf>ynC;wO5X-W>SS-fl@pL*BMbV6>L-U$Sf83rBLQT_dx0{uR2?{fT zW_R!GT_id$8(PyQwSK|q5L*gu<>FBzwgK8~2sDXpgEj*NWn!D5-vxv|F%r=KgXI)r zgrL6*2LNyoF>=uV$j$RSK@hcCtxza9f*4WgzjCXp3Lzv(5&+-`Vx*zJ=Kj%Ck!2Zu zVh2F~&Rr^%0)fD1Aq#>qnM}|pHmiI0_85jC%kp-+6$D|o+fft+0N{CkG#V|JOG%PY z{(a-5ivFd#qtR$25;+_Wm&?ULGl%ZoJ8R-zH?Sxl(Ri1E<~snK00000NkvXXu0mjf DnHD~- literal 0 HcmV?d00001