mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-16 22:00:24 +02:00
getting textfield into focus
This commit is contained in:
parent
1375e85f2c
commit
a24cd41367
7 changed files with 27 additions and 18 deletions
|
@ -166,7 +166,6 @@ Item {
|
||||||
topMargin: loginErrorMessage.height
|
topMargin: loginErrorMessage.height
|
||||||
}
|
}
|
||||||
placeholderText: "Username or Email"
|
placeholderText: "Username or Email"
|
||||||
focus: true
|
|
||||||
activeFocusOnPress: true
|
activeFocusOnPress: true
|
||||||
Keys.onPressed: {
|
Keys.onPressed: {
|
||||||
switch (event.key) {
|
switch (event.key) {
|
||||||
|
@ -489,8 +488,13 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onFocusChanged: {
|
Connections {
|
||||||
emailField.focus = focus;
|
target: loginDialog
|
||||||
|
onFocusEnabled: {
|
||||||
|
Qt.callLater(function() {
|
||||||
|
emailField.forceActiveFocus();
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
|
|
@ -5849,6 +5849,9 @@ void Application::setKeyboardFocusOverlay(const OverlayID& overlayID) {
|
||||||
_keyboardFocusHighlight->setVisible(false);
|
_keyboardFocusHighlight->setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (overlayID == _loginDialogOverlayID) {
|
||||||
|
emit loginDialogFocusEnabled();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8178,9 +8181,9 @@ void Application::loadDomainConnectionDialog() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Application::toggleLogDialog() {
|
void Application::toggleLogDialog() {
|
||||||
//if (getLoginDialogPoppedUp()) {
|
if (getLoginDialogPoppedUp()) {
|
||||||
// return;
|
return;
|
||||||
//}
|
}
|
||||||
if (! _logDialog) {
|
if (! _logDialog) {
|
||||||
_logDialog = new LogDialog(nullptr, getLogger());
|
_logDialog = new LogDialog(nullptr, getLogger());
|
||||||
}
|
}
|
||||||
|
@ -8749,8 +8752,7 @@ void Application::createLoginDialogOverlay() {
|
||||||
overlays.editOverlay(keyboard->getAnchorID(), properties);
|
overlays.editOverlay(keyboard->getAnchorID(), properties);
|
||||||
keyboard->setResetKeyboardPositionOnRaise(false);
|
keyboard->setResetKeyboardPositionOnRaise(false);
|
||||||
}
|
}
|
||||||
auto loginDialogOverlay = std::dynamic_pointer_cast<Web3DOverlay>(getOverlays().getOverlay(_loginDialogOverlayID));
|
setKeyboardFocusOverlay(_loginDialogOverlayID);
|
||||||
loginDialogOverlay->setActiveFocus(true);
|
|
||||||
getApplicationCompositor().getReticleInterface()->setAllowMouseCapture(false);
|
getApplicationCompositor().getReticleInterface()->setAllowMouseCapture(false);
|
||||||
getApplicationCompositor().getReticleInterface()->setVisible(false);
|
getApplicationCompositor().getReticleInterface()->setVisible(false);
|
||||||
if (!_loginStateManager.isSetUp()) {
|
if (!_loginStateManager.isSetUp()) {
|
||||||
|
|
|
@ -344,6 +344,8 @@ signals:
|
||||||
|
|
||||||
void interstitialModeChanged(bool isInInterstitialMode);
|
void interstitialModeChanged(bool isInInterstitialMode);
|
||||||
|
|
||||||
|
void loginDialogFocusEnabled();
|
||||||
|
|
||||||
void miniTabletEnabledChanged(bool enabled);
|
void miniTabletEnabledChanged(bool enabled);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -42,8 +42,9 @@ LoginDialog::LoginDialog(QQuickItem *parent) : OffscreenQmlDialog(parent) {
|
||||||
this, &LoginDialog::handleLoginCompleted);
|
this, &LoginDialog::handleLoginCompleted);
|
||||||
connect(accountManager.data(), &AccountManager::loginFailed,
|
connect(accountManager.data(), &AccountManager::loginFailed,
|
||||||
this, &LoginDialog::handleLoginFailed);
|
this, &LoginDialog::handleLoginFailed);
|
||||||
#endif
|
connect(qApp, SIGNAL(loginDialogFocusEnabled()), this, SLOT(onFocusEnabled()));
|
||||||
connect(this, SIGNAL(dismissedLoginDialog()), qApp, SLOT(onDismissedLoginDialog()));
|
connect(this, SIGNAL(dismissedLoginDialog()), qApp, SLOT(onDismissedLoginDialog()));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
LoginDialog::~LoginDialog() {
|
LoginDialog::~LoginDialog() {
|
||||||
|
@ -307,3 +308,8 @@ void LoginDialog::signupFailed(QNetworkReply* reply) {
|
||||||
emit handleSignupFailed(DEFAULT_SIGN_UP_FAILURE_MESSAGE);
|
emit handleSignupFailed(DEFAULT_SIGN_UP_FAILURE_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LoginDialog::onFocusEnabled() {
|
||||||
|
forceActiveFocus();
|
||||||
|
emit focusEnabled();
|
||||||
|
}
|
||||||
|
|
|
@ -48,6 +48,8 @@ signals:
|
||||||
// occurs upon dismissing the encouraging log in.
|
// occurs upon dismissing the encouraging log in.
|
||||||
void dismissedLoginDialog();
|
void dismissedLoginDialog();
|
||||||
|
|
||||||
|
void focusEnabled();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void linkCompleted(QNetworkReply* reply);
|
void linkCompleted(QNetworkReply* reply);
|
||||||
void linkFailed(QNetworkReply* reply);
|
void linkFailed(QNetworkReply* reply);
|
||||||
|
@ -58,6 +60,8 @@ public slots:
|
||||||
void signupCompleted(QNetworkReply* reply);
|
void signupCompleted(QNetworkReply* reply);
|
||||||
void signupFailed(QNetworkReply* reply);
|
void signupFailed(QNetworkReply* reply);
|
||||||
|
|
||||||
|
void onFocusEnabled();
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
Q_INVOKABLE void dismissLoginDialog();
|
Q_INVOKABLE void dismissLoginDialog();
|
||||||
|
|
||||||
|
|
|
@ -473,14 +473,6 @@ void Web3DOverlay::handlePointerEventAsMouse(const PointerEvent& event) {
|
||||||
QCoreApplication::sendEvent(_webSurface->getWindow(), &mouseEvent);
|
QCoreApplication::sendEvent(_webSurface->getWindow(), &mouseEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Web3DOverlay::setActiveFocus(bool focus) {
|
|
||||||
if (_webSurface && focus) {
|
|
||||||
if (focus) {
|
|
||||||
_webSurface->getRootItem()->forceActiveFocus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Web3DOverlay::setProperties(const QVariantMap& properties) {
|
void Web3DOverlay::setProperties(const QVariantMap& properties) {
|
||||||
Billboard3DOverlay::setProperties(properties);
|
Billboard3DOverlay::setProperties(properties);
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,6 @@ public:
|
||||||
Q_INVOKABLE void handlePointerEvent(const PointerEvent& event);
|
Q_INVOKABLE void handlePointerEvent(const PointerEvent& event);
|
||||||
void handlePointerEventAsTouch(const PointerEvent& event);
|
void handlePointerEventAsTouch(const PointerEvent& event);
|
||||||
void handlePointerEventAsMouse(const PointerEvent& event);
|
void handlePointerEventAsMouse(const PointerEvent& event);
|
||||||
void setActiveFocus(bool focus);
|
|
||||||
|
|
||||||
// setters
|
// setters
|
||||||
void setURL(const QString& url);
|
void setURL(const QString& url);
|
||||||
|
|
Loading…
Reference in a new issue