mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 17:03:58 +02:00
Merge pull request #9340 from fayeli/tablet-hide-yellow
Ability to disable yellow highlight around Web Overlays
This commit is contained in:
commit
28c8d527df
4 changed files with 18 additions and 5 deletions
|
@ -4076,9 +4076,11 @@ void Application::setKeyboardFocusOverlay(unsigned int overlayID) {
|
|||
}
|
||||
_lastAcceptedKeyPress = usecTimestampNow();
|
||||
|
||||
auto size = overlay->getSize() * FOCUS_HIGHLIGHT_EXPANSION_FACTOR;
|
||||
const float OVERLAY_DEPTH = 0.0105f;
|
||||
setKeyboardFocusHighlight(overlay->getPosition(), overlay->getRotation(), glm::vec3(size.x, size.y, OVERLAY_DEPTH));
|
||||
if (overlay->getProperty("showKeyboardFocusHighlight").toBool()) {
|
||||
auto size = overlay->getSize() * FOCUS_HIGHLIGHT_EXPANSION_FACTOR;
|
||||
const float OVERLAY_DEPTH = 0.0105f;
|
||||
setKeyboardFocusHighlight(overlay->getPosition(), overlay->getRotation(), glm::vec3(size.x, size.y, OVERLAY_DEPTH));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,8 @@ Web3DOverlay::Web3DOverlay(const Web3DOverlay* Web3DOverlay) :
|
|||
_url(Web3DOverlay->_url),
|
||||
_scriptURL(Web3DOverlay->_scriptURL),
|
||||
_dpi(Web3DOverlay->_dpi),
|
||||
_resolution(Web3DOverlay->_resolution)
|
||||
_resolution(Web3DOverlay->_resolution),
|
||||
_showKeyboardFocusHighlight(Web3DOverlay->_showKeyboardFocusHighlight)
|
||||
{
|
||||
_geometryId = DependencyManager::get<GeometryCache>()->allocateID();
|
||||
}
|
||||
|
@ -351,6 +352,11 @@ void Web3DOverlay::setProperties(const QVariantMap& properties) {
|
|||
if (dpi.isValid()) {
|
||||
_dpi = dpi.toFloat();
|
||||
}
|
||||
|
||||
auto showKeyboardFocusHighlight = properties["showKeyboardFocusHighlight"];
|
||||
if (showKeyboardFocusHighlight.isValid()) {
|
||||
_showKeyboardFocusHighlight = showKeyboardFocusHighlight.toBool();
|
||||
}
|
||||
}
|
||||
|
||||
QVariant Web3DOverlay::getProperty(const QString& property) {
|
||||
|
@ -366,6 +372,9 @@ QVariant Web3DOverlay::getProperty(const QString& property) {
|
|||
if (property == "dpi") {
|
||||
return _dpi;
|
||||
}
|
||||
if (property == "showKeyboardFocusHighlight") {
|
||||
return _showKeyboardFocusHighlight;
|
||||
}
|
||||
return Billboard3DOverlay::getProperty(property);
|
||||
}
|
||||
|
||||
|
|
|
@ -68,6 +68,7 @@ private:
|
|||
float _dpi;
|
||||
vec2 _resolution{ 640, 480 };
|
||||
int _geometryId { 0 };
|
||||
bool _showKeyboardFocusHighlight{ true };
|
||||
|
||||
bool _pressed{ false };
|
||||
QTouchDevice _touchDevice;
|
||||
|
|
|
@ -91,7 +91,8 @@ WebTablet = function (url, width, dpi, hand, clientOnly) {
|
|||
color: { red: 255, green: 255, blue: 255 },
|
||||
alpha: 1.0,
|
||||
parentID: this.tabletEntityID,
|
||||
parentJointIndex: -1
|
||||
parentJointIndex: -1,
|
||||
showKeyboardFocusHighlight: false
|
||||
});
|
||||
|
||||
var HOME_BUTTON_Y_OFFSET = -0.25;
|
||||
|
|
Loading…
Reference in a new issue