mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 00:54:08 +02:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
8db8d1e31d
9 changed files with 58 additions and 18 deletions
interface
libraries
|
@ -17,7 +17,7 @@ import "windows"
|
|||
Window {
|
||||
id: root
|
||||
HifiConstants { id: hifi }
|
||||
anchors.centerIn: parent
|
||||
|
||||
objectName: "AddressBarDialog"
|
||||
frame: HiddenFrame {}
|
||||
|
||||
|
@ -29,6 +29,19 @@ Window {
|
|||
width: addressBarDialog.implicitWidth
|
||||
height: addressBarDialog.implicitHeight
|
||||
|
||||
Component.onCompleted: {
|
||||
root.parentChanged.connect(center);
|
||||
center();
|
||||
}
|
||||
Component.onDestruction: {
|
||||
root.parentChanged.disconnect(center);
|
||||
}
|
||||
|
||||
function center() {
|
||||
// Explicitly center in order to avoid warnings at shutdown
|
||||
anchors.centerIn = parent;
|
||||
}
|
||||
|
||||
AddressBarDialog {
|
||||
id: addressBarDialog
|
||||
implicitWidth: backgroundImage.width
|
||||
|
|
|
@ -3,10 +3,24 @@ import QtQuick 2.3
|
|||
import QtQuick.Controls 1.2
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
id: stats
|
||||
|
||||
anchors.leftMargin: 300
|
||||
objectName: "StatsItem"
|
||||
|
||||
Component.onCompleted: {
|
||||
stats.parentChanged.connect(fill);
|
||||
fill();
|
||||
}
|
||||
Component.onDestruction: {
|
||||
stats.parentChanged.disconnect(fill);
|
||||
}
|
||||
|
||||
function fill() {
|
||||
// Explicitly fill in order to avoid warnings at shutdown
|
||||
anchors.fill = parent;
|
||||
}
|
||||
|
||||
Hifi.Stats {
|
||||
id: root
|
||||
objectName: "Stats"
|
||||
|
|
|
@ -248,9 +248,15 @@ Fadable {
|
|||
|
||||
children: [ swallower, frame, pane, activator ]
|
||||
|
||||
Component.onCompleted: { raise(); setDefaultFocus(); }
|
||||
Component.onDestruction: windowDestroyed();
|
||||
onParentChanged: raise();
|
||||
Component.onCompleted: {
|
||||
window.parentChanged.connect(raise);
|
||||
raise();
|
||||
setDefaultFocus();
|
||||
}
|
||||
Component.onDestruction: {
|
||||
window.parentChanged.disconnect(raise); // Prevent warning on shutdown
|
||||
windowDestroyed();
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
if (!visible && destroyOnInvisible) {
|
||||
|
|
|
@ -114,9 +114,14 @@ Fadable {
|
|||
|
||||
children: [ swallower, frame, content, activator ]
|
||||
|
||||
Component.onCompleted: raise();
|
||||
Component.onDestruction: windowDestroyed();
|
||||
onParentChanged: raise();
|
||||
Component.onCompleted: {
|
||||
window.parentChanged.connect(raise);
|
||||
raise();
|
||||
}
|
||||
Component.onDestruction: {
|
||||
window.parentChanged.disconnect(raise); // Prevent warning on shutdown
|
||||
windowDestroyed();
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
if (!visible && destroyOnInvisible) {
|
||||
|
|
|
@ -1150,6 +1150,9 @@ void Application::aboutToQuit() {
|
|||
|
||||
getActiveDisplayPlugin()->deactivate();
|
||||
|
||||
// Hide Running Scripts dialog so that it gets destroyed in an orderly manner; prevents warnings at shutdown.
|
||||
DependencyManager::get<OffscreenUi>()->hide("RunningScripts");
|
||||
|
||||
_aboutToQuit = true;
|
||||
|
||||
cleanupBeforeQuit();
|
||||
|
|
|
@ -221,13 +221,6 @@ Texture* Texture::create(Type type, const Element& texelFormat, uint16 width, ui
|
|||
return tex;
|
||||
}
|
||||
|
||||
Texture* Texture::createFromStorage(Storage* storage) {
|
||||
Texture* tex = new Texture();
|
||||
tex->_storage.reset(storage);
|
||||
storage->assignTexture(tex);
|
||||
return tex;
|
||||
}
|
||||
|
||||
Texture::Texture():
|
||||
Resource()
|
||||
{
|
||||
|
|
|
@ -260,7 +260,7 @@ public:
|
|||
Stamp bumpStamp() { return ++_stamp; }
|
||||
protected:
|
||||
Stamp _stamp = 0;
|
||||
Texture* _texture = nullptr;
|
||||
Texture* _texture = nullptr; // Points to the parent texture (not owned)
|
||||
Texture::Type _type = Texture::TEX_2D; // The type of texture is needed to know the number of faces to expect
|
||||
std::vector<std::vector<PixelsPointer>> _mips; // an array of mips, each mip is an array of faces
|
||||
|
||||
|
@ -280,8 +280,6 @@ public:
|
|||
static Texture* create3D(const Element& texelFormat, uint16 width, uint16 height, uint16 depth, const Sampler& sampler = Sampler());
|
||||
static Texture* createCube(const Element& texelFormat, uint16 width, const Sampler& sampler = Sampler());
|
||||
|
||||
static Texture* createFromStorage(Storage* storage);
|
||||
|
||||
Texture();
|
||||
Texture(const Texture& buf); // deep copy of the sysmem texture
|
||||
Texture& operator=(const Texture& buf); // deep copy of the sysmem texture
|
||||
|
|
|
@ -143,6 +143,13 @@ void OffscreenUi::toggle(const QUrl& url, const QString& name, std::function<voi
|
|||
}
|
||||
}
|
||||
|
||||
void OffscreenUi::hide(const QString& name) {
|
||||
QQuickItem* item = getRootItem()->findChild<QQuickItem*>(name);
|
||||
if (item) {
|
||||
item->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
class ModalDialogListener : public QObject {
|
||||
Q_OBJECT
|
||||
friend class OffscreenUi;
|
||||
|
|
|
@ -37,6 +37,7 @@ public:
|
|||
virtual void create(QOpenGLContext* context) override;
|
||||
void createDesktop(const QUrl& url);
|
||||
void show(const QUrl& url, const QString& name, std::function<void(QQmlContext*, QObject*)> f = [](QQmlContext*, QObject*) {});
|
||||
void hide(const QString& name);
|
||||
void toggle(const QUrl& url, const QString& name, std::function<void(QQmlContext*, QObject*)> f = [](QQmlContext*, QObject*) {});
|
||||
bool shouldSwallowShortcut(QEvent* event);
|
||||
bool navigationFocused();
|
||||
|
|
Loading…
Reference in a new issue