mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 10:14:52 +02:00
Make it easier for QML dialogs to access the global menu, manipulate the overlay desktop
This commit is contained in:
parent
41dcc3d52b
commit
e6b59cb0a1
2 changed files with 16 additions and 12 deletions
|
@ -1,11 +1,16 @@
|
|||
import Hifi 1.0
|
||||
import QtQuick 2.3
|
||||
import QtQuick 2.5
|
||||
import QtQuick.Controls 1.4
|
||||
|
||||
// This is our primary 'window' object to which all dialogs and controls will
|
||||
// be childed.
|
||||
Root {
|
||||
id: root
|
||||
objectName: "desktopRoot"
|
||||
anchors.fill: parent
|
||||
property var rootMenu: Menu {
|
||||
objectName: "rootMenu"
|
||||
}
|
||||
|
||||
onParentChanged: {
|
||||
forceActiveFocus();
|
||||
|
|
|
@ -1173,7 +1173,6 @@ void Application::initializeUi() {
|
|||
offscreenUi->setProxyWindow(_window->windowHandle());
|
||||
offscreenUi->setBaseUrl(QUrl::fromLocalFile(PathUtils::resourcesPath() + "/qml/"));
|
||||
offscreenUi->load("Root.qml");
|
||||
offscreenUi->load("RootMenu.qml");
|
||||
// FIXME either expose so that dialogs can set this themselves or
|
||||
// do better detection in the offscreen UI of what has focus
|
||||
offscreenUi->setNavigationFocused(false);
|
||||
|
@ -2033,16 +2032,16 @@ void Application::keyPressEvent(QKeyEvent* event) {
|
|||
|
||||
break;
|
||||
}
|
||||
case Qt::Key_Escape: {
|
||||
getActiveDisplayPlugin()->abandonCalibration();
|
||||
if (!event->isAutoRepeat()) {
|
||||
// this starts the HFCancelEvent
|
||||
HFBackEvent startBackEvent(HFBackEvent::startType());
|
||||
sendEvent(this, &startBackEvent);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
// case Qt::Key_Escape: {
|
||||
// getActiveDisplayPlugin()->abandonCalibration();
|
||||
// if (!event->isAutoRepeat()) {
|
||||
// // this starts the HFCancelEvent
|
||||
// HFBackEvent startBackEvent(HFBackEvent::startType());
|
||||
// sendEvent(this, &startBackEvent);
|
||||
// }
|
||||
//
|
||||
// break;
|
||||
// }
|
||||
|
||||
default:
|
||||
event->ignore();
|
||||
|
|
Loading…
Reference in a new issue