mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 09:08:47 +02:00
Merge pull request #9579 from hyperlogic/bug-fix/tablet-ui-keyboard-focus
tablet-ui: Fix for keyboard focus
This commit is contained in:
commit
eabd41d0e9
1 changed files with 7 additions and 2 deletions
|
@ -1202,8 +1202,11 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
|
||||||
connect(entityScriptingInterface.data(), &EntityScriptingInterface::clickDownOnEntity,
|
connect(entityScriptingInterface.data(), &EntityScriptingInterface::clickDownOnEntity,
|
||||||
[this](const EntityItemID& entityItemID, const PointerEvent& event) {
|
[this](const EntityItemID& entityItemID, const PointerEvent& event) {
|
||||||
setKeyboardFocusOverlay(UNKNOWN_OVERLAY_ID);
|
auto entity = getEntities()->getTree()->findEntityByID(entityItemID);
|
||||||
setKeyboardFocusEntity(entityItemID);
|
if (entity && entity->wantsKeyboardFocus()) {
|
||||||
|
setKeyboardFocusOverlay(UNKNOWN_OVERLAY_ID);
|
||||||
|
setKeyboardFocusEntity(entityItemID);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(entityScriptingInterface.data(), &EntityScriptingInterface::deletingEntity, [=](const EntityItemID& entityItemID) {
|
connect(entityScriptingInterface.data(), &EntityScriptingInterface::deletingEntity, [=](const EntityItemID& entityItemID) {
|
||||||
|
@ -4165,6 +4168,8 @@ void Application::setKeyboardFocusOverlay(unsigned int overlayID) {
|
||||||
auto size = overlay->getSize() * FOCUS_HIGHLIGHT_EXPANSION_FACTOR;
|
auto size = overlay->getSize() * FOCUS_HIGHLIGHT_EXPANSION_FACTOR;
|
||||||
const float OVERLAY_DEPTH = 0.0105f;
|
const float OVERLAY_DEPTH = 0.0105f;
|
||||||
setKeyboardFocusHighlight(overlay->getPosition(), overlay->getRotation(), glm::vec3(size.x, size.y, OVERLAY_DEPTH));
|
setKeyboardFocusHighlight(overlay->getPosition(), overlay->getRotation(), glm::vec3(size.x, size.y, OVERLAY_DEPTH));
|
||||||
|
} else if (_keyboardFocusHighlight) {
|
||||||
|
_keyboardFocusHighlight->setVisible(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue