diff --git a/interface/resources/qml/QmlWebWindow.qml b/interface/resources/qml/QmlWebWindow.qml index 542b44b95e..153498e2f7 100644 --- a/interface/resources/qml/QmlWebWindow.qml +++ b/interface/resources/qml/QmlWebWindow.qml @@ -39,6 +39,23 @@ Windows.ScrollingWindow { // missing signal signal sendToScript(var message); + signal moved(vector2d position); + signal resized(size size); + + function notifyMoved() { + moved(Qt.vector2d(x, y)); + } + + function notifyResized() { + resized(Qt.size(width, height)); + } + + onXChanged: notifyMoved(); + onYChanged: notifyMoved(); + + onWidthChanged: notifyResized(); + onHeightChanged: notifyResized(); + Item { width: pane.contentWidth implicitHeight: pane.scrollHeight diff --git a/interface/resources/qml/windows/DefaultFrameDecoration.qml b/interface/resources/qml/windows/DefaultFrameDecoration.qml index ce47b818b1..40e32aaa6b 100644 --- a/interface/resources/qml/windows/DefaultFrameDecoration.qml +++ b/interface/resources/qml/windows/DefaultFrameDecoration.qml @@ -78,7 +78,10 @@ Decoration { id: closeClickArea anchors.fill: parent hoverEnabled: true - onClicked: window.shown = false; + onClicked: { + window.shown = false; + window.windowClosed(); + } } } } diff --git a/interface/resources/qml/windows/Window.qml b/interface/resources/qml/windows/Window.qml index c873872692..40ef74c59b 100644 --- a/interface/resources/qml/windows/Window.qml +++ b/interface/resources/qml/windows/Window.qml @@ -30,6 +30,7 @@ Fadable { // // Signals // + signal windowClosed(); signal windowDestroyed(); signal mouseEntered(); signal mouseExited(); diff --git a/libraries/ui/src/QmlWindowClass.cpp b/libraries/ui/src/QmlWindowClass.cpp index 7d56e51495..c3ca5f54d9 100644 --- a/libraries/ui/src/QmlWindowClass.cpp +++ b/libraries/ui/src/QmlWindowClass.cpp @@ -124,6 +124,10 @@ void QmlWindowClass::initQml(QVariantMap properties) { // 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); + connect(_qmlWindow, SIGNAL(windowClosed()), this, SLOT(hasClosed()), Qt::QueuedConnection); }); } Q_ASSERT(_qmlWindow); @@ -259,7 +263,12 @@ void QmlWindowClass::close() { } } +void QmlWindowClass::hasMoved(QVector2D position) { + emit moved(glm::vec2(position.x(), position.y())); +} + void QmlWindowClass::hasClosed() { + emit closed(); } void QmlWindowClass::raise() { diff --git a/libraries/ui/src/QmlWindowClass.h b/libraries/ui/src/QmlWindowClass.h index c30027df6e..07cf736334 100644 --- a/libraries/ui/src/QmlWindowClass.h +++ b/libraries/ui/src/QmlWindowClass.h @@ -62,6 +62,7 @@ signals: void fromQml(const QVariant& message); protected slots: + void hasMoved(QVector2D); void hasClosed(); void qmlToScript(const QVariant& message);