Merge pull request #9340 from fayeli/tablet-hide-yellow

Ability to disable yellow highlight around Web Overlays
This commit is contained in:
druiz17 2017-01-10 09:11:51 -08:00 committed by GitHub
commit 28c8d527df
4 changed files with 18 additions and 5 deletions

View file

@ -4076,9 +4076,11 @@ void Application::setKeyboardFocusOverlay(unsigned int overlayID) {
} }
_lastAcceptedKeyPress = usecTimestampNow(); _lastAcceptedKeyPress = usecTimestampNow();
auto size = overlay->getSize() * FOCUS_HIGHLIGHT_EXPANSION_FACTOR; if (overlay->getProperty("showKeyboardFocusHighlight").toBool()) {
const float OVERLAY_DEPTH = 0.0105f; auto size = overlay->getSize() * FOCUS_HIGHLIGHT_EXPANSION_FACTOR;
setKeyboardFocusHighlight(overlay->getPosition(), overlay->getRotation(), glm::vec3(size.x, size.y, OVERLAY_DEPTH)); const float OVERLAY_DEPTH = 0.0105f;
setKeyboardFocusHighlight(overlay->getPosition(), overlay->getRotation(), glm::vec3(size.x, size.y, OVERLAY_DEPTH));
}
} }
} }
} }

View file

@ -50,7 +50,8 @@ Web3DOverlay::Web3DOverlay(const Web3DOverlay* Web3DOverlay) :
_url(Web3DOverlay->_url), _url(Web3DOverlay->_url),
_scriptURL(Web3DOverlay->_scriptURL), _scriptURL(Web3DOverlay->_scriptURL),
_dpi(Web3DOverlay->_dpi), _dpi(Web3DOverlay->_dpi),
_resolution(Web3DOverlay->_resolution) _resolution(Web3DOverlay->_resolution),
_showKeyboardFocusHighlight(Web3DOverlay->_showKeyboardFocusHighlight)
{ {
_geometryId = DependencyManager::get<GeometryCache>()->allocateID(); _geometryId = DependencyManager::get<GeometryCache>()->allocateID();
} }
@ -351,6 +352,11 @@ void Web3DOverlay::setProperties(const QVariantMap& properties) {
if (dpi.isValid()) { if (dpi.isValid()) {
_dpi = dpi.toFloat(); _dpi = dpi.toFloat();
} }
auto showKeyboardFocusHighlight = properties["showKeyboardFocusHighlight"];
if (showKeyboardFocusHighlight.isValid()) {
_showKeyboardFocusHighlight = showKeyboardFocusHighlight.toBool();
}
} }
QVariant Web3DOverlay::getProperty(const QString& property) { QVariant Web3DOverlay::getProperty(const QString& property) {
@ -366,6 +372,9 @@ QVariant Web3DOverlay::getProperty(const QString& property) {
if (property == "dpi") { if (property == "dpi") {
return _dpi; return _dpi;
} }
if (property == "showKeyboardFocusHighlight") {
return _showKeyboardFocusHighlight;
}
return Billboard3DOverlay::getProperty(property); return Billboard3DOverlay::getProperty(property);
} }

View file

@ -68,6 +68,7 @@ private:
float _dpi; float _dpi;
vec2 _resolution{ 640, 480 }; vec2 _resolution{ 640, 480 };
int _geometryId { 0 }; int _geometryId { 0 };
bool _showKeyboardFocusHighlight{ true };
bool _pressed{ false }; bool _pressed{ false };
QTouchDevice _touchDevice; QTouchDevice _touchDevice;

View file

@ -91,7 +91,8 @@ WebTablet = function (url, width, dpi, hand, clientOnly) {
color: { red: 255, green: 255, blue: 255 }, color: { red: 255, green: 255, blue: 255 },
alpha: 1.0, alpha: 1.0,
parentID: this.tabletEntityID, parentID: this.tabletEntityID,
parentJointIndex: -1 parentJointIndex: -1,
showKeyboardFocusHighlight: false
}); });
var HOME_BUTTON_Y_OFFSET = -0.25; var HOME_BUTTON_Y_OFFSET = -0.25;