Merge branch 'master' of github.com:highfidelity/hifi into ignore-touch

This commit is contained in:
Seth Alves 2016-08-02 19:44:28 -07:00
commit ed4b3cde6b
6 changed files with 33 additions and 2 deletions

View file

@ -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

View file

@ -78,7 +78,10 @@ Decoration {
id: closeClickArea
anchors.fill: parent
hoverEnabled: true
onClicked: window.shown = false;
onClicked: {
window.shown = false;
window.windowClosed();
}
}
}
}

View file

@ -30,6 +30,7 @@ Fadable {
//
// Signals
//
signal windowClosed();
signal windowDestroyed();
signal mouseEntered();
signal mouseExited();

View file

@ -107,7 +107,7 @@ public:
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
static QMessageBox::StandardButton question(const QString& title, const QString& text,
QMessageBox::StandardButtons buttons = QMessageBox::Ok,
QMessageBox::StandardButtons buttons = QMessageBox::Yes | QMessageBox::No,
QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
static QMessageBox::StandardButton warning(const QString& title, const QString& text,
QMessageBox::StandardButtons buttons = QMessageBox::Ok,

View file

@ -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() {

View file

@ -62,6 +62,7 @@ signals:
void fromQml(const QVariant& message);
protected slots:
void hasMoved(QVector2D);
void hasClosed();
void qmlToScript(const QVariant& message);