diff --git a/interface/resources/qml/hifi/Audio.qml b/interface/resources/qml/hifi/Audio.qml index deb44b9bd5..d0c3122100 100644 --- a/interface/resources/qml/hifi/Audio.qml +++ b/interface/resources/qml/hifi/Audio.qml @@ -127,7 +127,7 @@ Rectangle { text: hifi.glyphs.mic color: hifi.colors.primaryHighlight anchors.verticalCenter: parent.verticalCenter - font.pointSize: 27 + size: 32 } RalewayRegular { anchors.verticalCenter: parent.verticalCenter @@ -182,7 +182,7 @@ Rectangle { text: hifi.glyphs.unmuted color: hifi.colors.primaryHighlight anchors.verticalCenter: parent.verticalCenter - font.pointSize: 27 + size: 32 } RalewayRegular { anchors.verticalCenter: parent.verticalCenter diff --git a/interface/resources/qml/hifi/dialogs/TabletAssetServer.qml b/interface/resources/qml/hifi/dialogs/TabletAssetServer.qml index 2460fc39d5..85f8a2f59e 100644 --- a/interface/resources/qml/hifi/dialogs/TabletAssetServer.qml +++ b/interface/resources/qml/hifi/dialogs/TabletAssetServer.qml @@ -21,6 +21,9 @@ Rectangle { id: root objectName: "AssetServer" + property string title: "Asset Browser" + property bool keyboardRaised: false + property var eventBridge; signal sendToScript(var message); property bool isHMD: false @@ -415,7 +418,6 @@ Rectangle { Column { width: parent.width - y: hifi.dimensions.tabletMenuHeader //-bgNavBar spacing: 10 HifiControls.TabletContentSection { diff --git a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml index dee0d0e21f..d826b40ad1 100644 --- a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml @@ -20,7 +20,7 @@ import "../../windows" Rectangle { id: root objectName: "RunningScripts" - property var title: "Running Scripts" + property string title: "Running Scripts" HifiConstants { id: hifi } signal sendToScript(var message); property var eventBridge; @@ -81,9 +81,9 @@ Rectangle { Flickable { id: flickable - width: parent.width + width: tabletRoot.width height: parent.height - (keyboard.raised ? keyboard.raisedHeight : 0) - contentWidth: parent.width + contentWidth: column.width contentHeight: column.childrenRect.height clip: true @@ -121,9 +121,8 @@ Rectangle { model: runningScriptsModel id: table height: 185 + width: parent.width colorScheme: hifi.colorSchemes.dark - anchors.left: parent.left - anchors.right: parent.right expandSelectedRow: true itemDelegate: Item { diff --git a/interface/resources/qml/hifi/tablet/Tablet.qml b/interface/resources/qml/hifi/tablet/Tablet.qml index 3fb70f9cca..8ad6339d88 100644 --- a/interface/resources/qml/hifi/tablet/Tablet.qml +++ b/interface/resources/qml/hifi/tablet/Tablet.qml @@ -202,7 +202,7 @@ Item { RalewaySemiBold { id: usernameText - text: tablet.parent.parent.username + text: tabletRoot.username anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right anchors.rightMargin: 20 diff --git a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml index b0b8c68789..489fbdb3c9 100644 --- a/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml +++ b/interface/resources/qml/hifi/tablet/TabletAddressDialog.qml @@ -25,8 +25,8 @@ StackView { HifiConstants { id: hifi } HifiStyles.HifiConstants { id: hifiStyleConstants } initialItem: addressBarDialog - width: parent.width - height: parent.height + width: parent !== null ? parent.width : undefined + height: parent !== null ? parent.height : undefined property var eventBridge; property var allStories: []; property int cardWidth: 460; @@ -107,7 +107,7 @@ StackView { imageURL: "../../../images/home.svg" onClicked: { addressBarDialog.loadHome(); - root.shown = false; + tabletRoot.shown = false; } anchors { left: parent.left @@ -142,7 +142,9 @@ StackView { anchors { top: navBar.bottom right: parent.right + rightMargin: 16 left: parent.left + leftMargin: 16 } property int inputAreaHeight: 70 @@ -291,8 +293,6 @@ StackView { left: parent.left right: parent.right leftMargin: 10 - verticalCenter: parent.verticalCenter; - horizontalCenter: parent.horizontalCenter; } model: suggestions orientation: ListView.Vertical @@ -547,14 +547,14 @@ StackView { if (addressLine.text !== "") { addressBarDialog.loadAddress(addressLine.text, fromSuggestions) } - root.shown = false; + tabletRoot.shown = false; } Keys.onPressed: { switch (event.key) { case Qt.Key_Escape: case Qt.Key_Back: - root.shown = false + tabletRoot.shown = false clearAddressLineTimer.start(); event.accepted = true break diff --git a/interface/resources/qml/hifi/tablet/TabletRoot.qml b/interface/resources/qml/hifi/tablet/TabletRoot.qml index 8037c1280e..f5144e698f 100644 --- a/interface/resources/qml/hifi/tablet/TabletRoot.qml +++ b/interface/resources/qml/hifi/tablet/TabletRoot.qml @@ -13,6 +13,7 @@ Item { property var openMessage: null; property string subMenu: "" signal showDesktop(); + property bool shown: true function setOption(value) { option = value; diff --git a/interface/src/ui/JSConsole.cpp b/interface/src/ui/JSConsole.cpp index 5d197f5ddc..7700874d9a 100644 --- a/interface/src/ui/JSConsole.cpp +++ b/interface/src/ui/JSConsole.cpp @@ -76,8 +76,8 @@ void JSConsole::setScriptEngine(ScriptEngine* scriptEngine) { return; } if (_scriptEngine != NULL) { - disconnect(_scriptEngine, SIGNAL(printedMessage(const QString&)), this, SLOT(handlePrint(const QString&))); - disconnect(_scriptEngine, SIGNAL(errorMessage(const QString&)), this, SLOT(handleError(const QString&))); + disconnect(_scriptEngine, &ScriptEngine::printedMessage, this, &JSConsole::handlePrint); + disconnect(_scriptEngine, &ScriptEngine::errorMessage, this, &JSConsole::handleError); if (_ownScriptEngine) { _scriptEngine->deleteLater(); } @@ -87,8 +87,8 @@ void JSConsole::setScriptEngine(ScriptEngine* scriptEngine) { _ownScriptEngine = scriptEngine == NULL; _scriptEngine = _ownScriptEngine ? DependencyManager::get()->loadScript(QString(), false) : scriptEngine; - connect(_scriptEngine, SIGNAL(printedMessage(const QString&)), this, SLOT(handlePrint(const QString&))); - connect(_scriptEngine, SIGNAL(errorMessage(const QString&)), this, SLOT(handleError(const QString&))); + connect(_scriptEngine, &ScriptEngine::printedMessage, this, &JSConsole::handlePrint); + connect(_scriptEngine, &ScriptEngine::errorMessage, this, &JSConsole::handleError); } void JSConsole::executeCommand(const QString& command) { @@ -134,11 +134,13 @@ void JSConsole::commandFinished() { resetCurrentCommandHistory(); } -void JSConsole::handleError(const QString& message) { +void JSConsole::handleError(const QString& scriptName, const QString& message) { + Q_UNUSED(scriptName); appendMessage(GUTTER_ERROR, "" + message.toHtmlEscaped() + ""); } -void JSConsole::handlePrint(const QString& message) { +void JSConsole::handlePrint(const QString& scriptName, const QString& message) { + Q_UNUSED(scriptName); appendMessage("", message); } diff --git a/interface/src/ui/JSConsole.h b/interface/src/ui/JSConsole.h index 47878fea99..d5f5aff301 100644 --- a/interface/src/ui/JSConsole.h +++ b/interface/src/ui/JSConsole.h @@ -47,8 +47,8 @@ protected: protected slots: void scrollToBottom(); void resizeTextInput(); - void handlePrint(const QString& message); - void handleError(const QString& message); + void handlePrint(const QString& scriptName, const QString& message); + void handleError(const QString& scriptName, const QString& message); void commandFinished(); private: diff --git a/libraries/gl/src/gl/OffscreenGLCanvas.cpp b/libraries/gl/src/gl/OffscreenGLCanvas.cpp index e54846196b..e5c630d97e 100644 --- a/libraries/gl/src/gl/OffscreenGLCanvas.cpp +++ b/libraries/gl/src/gl/OffscreenGLCanvas.cpp @@ -60,6 +60,7 @@ bool OffscreenGLCanvas::create(QOpenGLContext* sharedContext) { bool OffscreenGLCanvas::makeCurrent() { bool result = _context->makeCurrent(_offscreenSurface); Q_ASSERT(result); + std::call_once(_reportOnce, [this]{ qCDebug(glLogging) << "GL Version: " << QString((const char*) glGetString(GL_VERSION)); qCDebug(glLogging) << "GL Shader Language Version: " << QString((const char*) glGetString(GL_SHADING_LANGUAGE_VERSION)); diff --git a/libraries/gl/src/gl/OffscreenQmlSurface.cpp b/libraries/gl/src/gl/OffscreenQmlSurface.cpp index 3bbd26e010..16e32ab42e 100644 --- a/libraries/gl/src/gl/OffscreenQmlSurface.cpp +++ b/libraries/gl/src/gl/OffscreenQmlSurface.cpp @@ -612,7 +612,11 @@ QObject* OffscreenQmlSurface::finishQmlLoad(std::functionmetaObject()->indexOfSignal("sendToScript"); + if (sendToScriptIndex != -1) { + connect(newItem, SIGNAL(sendToScript(QVariant)), this, SIGNAL(fromQml(QVariant))); + } // The root item is ready. Associate it with the window. _rootItem = newItem; diff --git a/libraries/ui/src/QmlWindowClass.cpp b/libraries/ui/src/QmlWindowClass.cpp index c60e4fa698..c0e94058ae 100644 --- a/libraries/ui/src/QmlWindowClass.cpp +++ b/libraries/ui/src/QmlWindowClass.cpp @@ -122,12 +122,15 @@ void QmlWindowClass::initQml(QVariantMap properties) { object->setProperty(OFFSCREEN_VISIBILITY_PROPERTY, visible); object->setProperty(SOURCE_PROPERTY, _source); + const QMetaObject *metaObject = _qmlWindow->metaObject(); // Forward messages received from QML on to the script connect(_qmlWindow, SIGNAL(sendToScript(QVariant)), this, SLOT(qmlToScript(const QVariant&)), Qt::QueuedConnection); connect(_qmlWindow, SIGNAL(visibleChanged()), this, SIGNAL(visibleChanged()), Qt::QueuedConnection); - connect(_qmlWindow, SIGNAL(resized(QSizeF)), this, SIGNAL(resized(QSizeF)), Qt::QueuedConnection); - connect(_qmlWindow, SIGNAL(moved(QVector2D)), this, SLOT(hasMoved(QVector2D)), Qt::QueuedConnection); + if (metaObject->indexOfSignal("resized") >= 0) + connect(_qmlWindow, SIGNAL(resized(QSizeF)), this, SIGNAL(resized(QSizeF)), Qt::QueuedConnection); + if (metaObject->indexOfSignal("moved") >= 0) + connect(_qmlWindow, SIGNAL(moved(QVector2D)), this, SLOT(hasMoved(QVector2D)), Qt::QueuedConnection); connect(_qmlWindow, SIGNAL(windowClosed()), this, SLOT(hasClosed()), Qt::QueuedConnection); }); } diff --git a/scripts/developer/debugging/debugWindow.qml b/scripts/developer/debugging/debugWindow.qml index f046a949ef..20fa24358d 100644 --- a/scripts/developer/debugging/debugWindow.qml +++ b/scripts/developer/debugging/debugWindow.qml @@ -18,6 +18,9 @@ Rectangle { width: parent ? parent.width : 100 height: parent ? parent.height : 100 + signal moved(vector2d position); + signal resized(size size); + property var channel; TextArea {