mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Merge branch 'friction' of github.com:RebeccaStankus/hifi into friction
This commit is contained in:
commit
9c03de7af6
2 changed files with 3 additions and 44 deletions
|
@ -453,25 +453,6 @@ void InteractiveWindow::setPosition(const glm::vec2& position) {
|
|||
}
|
||||
}
|
||||
|
||||
void InteractiveWindow::setNativeWindowPosition(const glm::vec2& position) {
|
||||
if (!_qmlWindowProxy) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto qmlWindow = _qmlWindowProxy->getQmlWindow();
|
||||
|
||||
if (!qmlWindow) {
|
||||
return;
|
||||
}
|
||||
const auto nativeWindowProperty = qmlWindow->property("nativeWindow");
|
||||
if (nativeWindowProperty.isNull() || !nativeWindowProperty.isValid()) {
|
||||
return;
|
||||
}
|
||||
const auto nativeWindow = qvariant_cast<QQuickWindow*>(nativeWindowProperty);
|
||||
|
||||
nativeWindow->setPosition(QPoint(position.x, position.y));
|
||||
}
|
||||
|
||||
RelativePositionAnchor InteractiveWindow::getRelativePositionAnchor() const {
|
||||
return _relativePositionAnchor;
|
||||
}
|
||||
|
@ -524,14 +505,14 @@ void InteractiveWindow::setPositionUsingRelativePositionAndAnchor(const QRect& m
|
|||
QMetaObject::invokeMethod(_qmlWindowProxy.get(), "writeProperty", Q_ARG(QString, INTERACTIVE_WINDOW_POSITION_PROPERTY),
|
||||
Q_ARG(QVariant, QPointF(newPosition.x, newPosition.y)));
|
||||
}
|
||||
setNativeWindowPosition(newPosition);
|
||||
setPosition(newPosition);
|
||||
}
|
||||
|
||||
void InteractiveWindow::repositionAndResizeFullScreenWindow() {
|
||||
QRect windowGeometry = qApp->getWindow()->geometry();
|
||||
|
||||
setNativeWindowPosition(glm::vec2(windowGeometry.x(), windowGeometry.y()));
|
||||
setNativeWindowSize(glm::vec2(windowGeometry.width(), windowGeometry.height()));
|
||||
setPosition(glm::vec2(windowGeometry.x(), windowGeometry.y()));
|
||||
setSize(glm::vec2(windowGeometry.width(), windowGeometry.height()));
|
||||
}
|
||||
|
||||
glm::vec2 InteractiveWindow::getSize() const {
|
||||
|
@ -550,26 +531,6 @@ void InteractiveWindow::setSize(const glm::vec2& size) {
|
|||
}
|
||||
}
|
||||
|
||||
void InteractiveWindow::setNativeWindowSize(const glm::vec2& size) {
|
||||
if (!_qmlWindowProxy) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto qmlWindow = _qmlWindowProxy->getQmlWindow();
|
||||
|
||||
if (!qmlWindow) {
|
||||
return;
|
||||
}
|
||||
const auto nativeWindowProperty = qmlWindow->property("nativeWindow");
|
||||
if (nativeWindowProperty.isNull() || !nativeWindowProperty.isValid()) {
|
||||
return;
|
||||
}
|
||||
const auto nativeWindow = qvariant_cast<QQuickWindow*>(nativeWindowProperty);
|
||||
|
||||
nativeWindow->setWidth(size.x);
|
||||
nativeWindow->setHeight(size.y);
|
||||
}
|
||||
|
||||
QString InteractiveWindow::getTitle() const {
|
||||
if (!_qmlWindowProxy) {
|
||||
return QString();
|
||||
|
|
|
@ -146,7 +146,6 @@ private:
|
|||
|
||||
Q_INVOKABLE glm::vec2 getPosition() const;
|
||||
Q_INVOKABLE void setPosition(const glm::vec2& position);
|
||||
Q_INVOKABLE void setNativeWindowPosition(const glm::vec2& position);
|
||||
|
||||
RelativePositionAnchor _relativePositionAnchor{ RelativePositionAnchor::TOP_LEFT };
|
||||
Q_INVOKABLE RelativePositionAnchor getRelativePositionAnchor() const;
|
||||
|
@ -165,7 +164,6 @@ private:
|
|||
|
||||
Q_INVOKABLE glm::vec2 getSize() const;
|
||||
Q_INVOKABLE void setSize(const glm::vec2& size);
|
||||
Q_INVOKABLE void setNativeWindowSize(const glm::vec2& size);
|
||||
|
||||
Q_INVOKABLE void setVisible(bool visible);
|
||||
Q_INVOKABLE bool isVisible() const;
|
||||
|
|
Loading…
Reference in a new issue