mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-04-16 08:48:56 +02:00
Tinkering with toolbar visibility signal - not quite working
This commit is contained in:
parent
35cdd19456
commit
51c2cc793a
5 changed files with 28 additions and 1 deletions
|
@ -12,6 +12,8 @@ import controlsUit 1.0
|
|||
OriginalDesktop.Desktop {
|
||||
id: desktop
|
||||
|
||||
property alias toolbarObjectName: sysToolbar.objectName
|
||||
|
||||
MouseArea {
|
||||
id: hoverWatch
|
||||
anchors.fill: parent
|
||||
|
@ -70,7 +72,13 @@ OriginalDesktop.Desktop {
|
|||
x: sysToolbar.x
|
||||
buttonModel: tablet ? tablet.buttons : null;
|
||||
shown: tablet ? tablet.toolbarMode : false;
|
||||
|
||||
onVisibleChanged: {
|
||||
console.log("ZRF HERE DESKTOP.QML: " + visible);
|
||||
desktop.toolbarVisibleChanged(visible);
|
||||
}
|
||||
}
|
||||
signal toolbarVisibleChanged(bool isVisible);
|
||||
|
||||
QtSettings.Settings {
|
||||
id: settings;
|
||||
|
|
|
@ -688,6 +688,12 @@ void OffscreenUi::createDesktop(const QUrl& url) {
|
|||
menuInitializer(_vrMenu);
|
||||
}
|
||||
|
||||
|
||||
QString toolbarName = newObject->property("toolbarObjectName").toString(); // will return "com.highfidelity.interface.toolbar.system"
|
||||
auto toolbarScriptingInterface = DependencyManager::get<ToolbarScriptingInterface>();
|
||||
_currentToolbarProxy = dynamic_cast<ToolbarProxy*>(toolbarScriptingInterface->getToolbar(toolbarName));
|
||||
connect(_desktop, SIGNAL(toolbarVisibleChanged(bool)), _currentToolbarProxy, SLOT(onToolbarVisibleChanged(bool)));
|
||||
|
||||
auto keyboardFocus = new KeyboardFocusHack();
|
||||
connect(_desktop, SIGNAL(showDesktop()), this, SIGNAL(showDesktop()));
|
||||
emit desktopReady();
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <DependencyManager.h>
|
||||
|
||||
#include "ui/OffscreenQmlSurface.h"
|
||||
#include "ui/ToolbarScriptingInterface.h"
|
||||
#include "OffscreenQmlElement.h"
|
||||
|
||||
class VrMenu;
|
||||
|
@ -270,7 +271,8 @@ private:
|
|||
QList<QObject*> _modalDialogListeners;
|
||||
std::unordered_map<int, bool> _pressedKeys;
|
||||
VrMenu* _vrMenu { nullptr };
|
||||
QQueue<std::function<void(VrMenu*)>> _queuedMenuInitializers;
|
||||
QQueue<std::function<void(VrMenu*)>> _queuedMenuInitializers;
|
||||
ToolbarProxy* _currentToolbarProxy;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -63,6 +63,11 @@ void ToolbarButtonProxy::editProperties(const QVariantMap& properties) {
|
|||
}
|
||||
}
|
||||
|
||||
void ToolbarProxy::onToolbarVisibleChanged(bool isVisible) {
|
||||
qDebug() << "ZRF HERE IN ENGINE SLOT";
|
||||
emit ToolbarProxy::toolbarVisibleChanged(isVisible);
|
||||
}
|
||||
|
||||
ToolbarProxy::ToolbarProxy(QObject* qmlObject, QObject* parent) : QmlWrapper(qmlObject, parent) {
|
||||
Q_ASSERT(QThread::currentThread() == qApp->thread());
|
||||
}
|
||||
|
|
|
@ -129,6 +129,12 @@ public:
|
|||
* @param {string[]} propertyList
|
||||
* @returns {object}
|
||||
*/
|
||||
|
||||
public slots:
|
||||
void onToolbarVisibleChanged(bool isVisible);
|
||||
|
||||
signals:
|
||||
void toolbarVisibleChanged(bool isVisible);
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(ToolbarProxy*);
|
||||
|
|
Loading…
Reference in a new issue