From f954767b8493d0ac0df313484eaa1f56cd703f52 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 30 Mar 2017 14:04:03 +1300 Subject: [PATCH 1/5] Get entities list and entity properties scrollbars working on tablet --- interface/src/ui/overlays/Web3DOverlay.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index e05ae1aacd..94699e7b42 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -350,11 +350,11 @@ void Web3DOverlay::handlePointerEventAsTouch(const PointerEvent& event) { glm::vec2 windowPos = event.getPos2D() * (METERS_TO_INCHES * _dpi); QPointF windowPoint(windowPos.x, windowPos.y); - if (event.getButtons() == PointerEvent::NoButtons && event.getType() == PointerEvent::Move) { - // Forward a mouse move event to the Web surface. + if (event.getType() == PointerEvent::Move) { + // Forward a mouse move event to the Web surface so that hover events are generated. + // Must send a mouse move event that matches up with touch move event in order for scroll bars to work. QMouseEvent* mouseEvent = new QMouseEvent(QEvent::MouseMove, windowPoint, windowPoint, windowPoint, Qt::NoButton, Qt::NoButton, Qt::NoModifier); QCoreApplication::postEvent(_webSurface->getWindow(), mouseEvent); - return; } if (event.getType() == PointerEvent::Press && event.getButton() == PointerEvent::PrimaryButton) { From 06910d18815429f8980c29c321f132c5c9067a65 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 30 Mar 2017 14:20:02 +1300 Subject: [PATCH 2/5] Add comment re scrollbar stability in tablet --- interface/src/ui/overlays/Web3DOverlay.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index 94699e7b42..e50cf3a671 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -353,6 +353,10 @@ void Web3DOverlay::handlePointerEventAsTouch(const PointerEvent& event) { if (event.getType() == PointerEvent::Move) { // Forward a mouse move event to the Web surface so that hover events are generated. // Must send a mouse move event that matches up with touch move event in order for scroll bars to work. + + // Scroll bar dragging is a bit unstable in the tablet (content can jump up and down at times). + // This may be improved in Qt 5.8. Release notes: "Cleaned up touch and mouse event delivery". + QMouseEvent* mouseEvent = new QMouseEvent(QEvent::MouseMove, windowPoint, windowPoint, windowPoint, Qt::NoButton, Qt::NoButton, Qt::NoModifier); QCoreApplication::postEvent(_webSurface->getWindow(), mouseEvent); } From c7f648a6c269d781ab8f77d1705e5cc1d9b5fe99 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 30 Mar 2017 14:20:32 +1300 Subject: [PATCH 3/5] Disable marketplace directory and Clara.io scrollbars in tablet --- scripts/system/marketplaces/marketplaces.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/system/marketplaces/marketplaces.js b/scripts/system/marketplaces/marketplaces.js index c24034b38e..3488352cc0 100644 --- a/scripts/system/marketplaces/marketplaces.js +++ b/scripts/system/marketplaces/marketplaces.js @@ -72,7 +72,7 @@ function showMarketplace() { tablet.webEventReceived.connect(function (message) { if (message === GOTO_DIRECTORY) { - tablet.gotoWebScreen(MARKETPLACES_URL, MARKETPLACES_INJECT_SCRIPT_URL); + tablet.gotoWebScreen(MARKETPLACES_URL, injectURL); } if (message === QUERY_CAN_WRITE_ASSETS) { From 9c4414cff6083c75953940138162de1ccbc5be28 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 30 Mar 2017 14:38:17 +1300 Subject: [PATCH 4/5] No custom styling of marketplaces directory scrollbar --- scripts/system/html/css/marketplaces.css | 87 ++++++++++++++++++++++++ scripts/system/html/marketplaces.html | 1 - 2 files changed, 87 insertions(+), 1 deletion(-) diff --git a/scripts/system/html/css/marketplaces.css b/scripts/system/html/css/marketplaces.css index bb57bea3bc..04c132eab1 100644 --- a/scripts/system/html/css/marketplaces.css +++ b/scripts/system/html/css/marketplaces.css @@ -5,6 +5,93 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html */ + +/* + CSS rules copied from edit-style.css. + Edit-style.css is not used in its entirety because don't want custom scrollbars; default scrollbar styling is used in order + to match other marketplace pages. +*/ + +@font-face { + font-family: Raleway-Regular; + src: url(../../../../resources/fonts/Raleway-Regular.ttf), /* Windows production */ + url(../../../../fonts/Raleway-Regular.ttf), /* OSX production */ + url(../../../../interface/resources/fonts/Raleway-Regular.ttf); /* Development, running script in /HiFi/examples */ +} + +@font-face { + font-family: Raleway-Bold; + src: url(../../../../resources/fonts/Raleway-Bold.ttf), + url(../../../../fonts/Raleway-Bold.ttf), + url(../../../../interface/resources/fonts/Raleway-Bold.ttf); +} + +@font-face { + font-family: Raleway-SemiBold; + src: url(../../../../resources/fonts/Raleway-SemiBold.ttf), + url(../../../../fonts/Raleway-SemiBold.ttf), + url(../../../../interface/resources/fonts/Raleway-SemiBold.ttf); +} + +@font-face { + font-family: FiraSans-SemiBold; + src: url(../../../../resources/fonts/FiraSans-SemiBold.ttf), + url(../../../../fonts/FiraSans-SemiBold.ttf), + url(../../../../interface/resources/fonts/FiraSans-SemiBold.ttf); +} + +* { + margin: 0; + padding: 0; +} + +body { + padding: 21px 21px 21px 21px; + + color: #afafaf; + background-color: #404040; + font-family: Raleway-Regular; + font-size: 15px; + + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + overflow-x: hidden; + overflow-y: auto; +} + +input[type=button] { + font-family: Raleway-Bold; + font-size: 13px; + text-transform: uppercase; + vertical-align: top; + height: 28px; + min-width: 120px; + padding: 0px 18px; + margin-right: 6px; + border-radius: 5px; + border: none; + color: #fff; + background-color: #000; + background: linear-gradient(#343434 20%, #000 100%); + cursor: pointer; +} + +input[type=button].blue { + color: #fff; + background-color: #1080b8; + background: linear-gradient(#00b4ef 20%, #1080b8 100%); +} + + +/* + Marketplaces-specific CSS. +*/ + body { background: white; padding: 0 0 0 0; diff --git a/scripts/system/html/marketplaces.html b/scripts/system/html/marketplaces.html index 976c0f294f..6051a9df96 100644 --- a/scripts/system/html/marketplaces.html +++ b/scripts/system/html/marketplaces.html @@ -10,7 +10,6 @@ Marketplaces - From a5c683192b06727a4675964392be616d44349df1 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 31 Mar 2017 12:26:22 +1300 Subject: [PATCH 5/5] Improve entity properties scroll handle operation in tablet --- scripts/system/html/css/edit-style.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/system/html/css/edit-style.css b/scripts/system/html/css/edit-style.css index 06a60b5405..c033a2d2cd 100644 --- a/scripts/system/html/css/edit-style.css +++ b/scripts/system/html/css/edit-style.css @@ -81,6 +81,19 @@ body { overflow-y: auto; } +/* HACK + Makes entity properties dialog's scrollbar work on tablet such that don't need to keep pointer within scrollbar width when + using scroll handle. +*/ +body { + padding-right: 0; + margin-right: -21px; +} +body > * { + margin-right: 42px; +} +/* END OF HACK */ + table { font-family: FiraSans-SemiBold; font-size: 15px;