Unified · Split
| @@ -1200,7 +1200,6 @@ void Application::initializeUi() { · 1199 unmodified lines | ||
| 1200 | 1200 | // OffscreenUi is a subclass of OffscreenQmlSurface specifically designed to |
| 1201 | 1201 | // support the window management and scripting proxies for VR use |
| 1202 | 1202 | offscreenUi->createDesktop(QString("hifi/Desktop.qml")); |
| 1203 | − connect(offscreenUi.data(), &OffscreenUi::showDesktop, this, &Application::showDesktop); | |
| 1204 | 1203 | |
| 1205 | 1204 | // FIXME either expose so that dialogs can set this themselves or |
| 1206 | 1205 | // do better detection in the offscreen UI of what has focus |
| @@ -2435,6 +2434,17 @@ void Application::idle(uint64_t now) { · 1228 unmodified lines | ||
| 2435 | 2434 | if (_aboutToQuit) { |
| 2436 | 2435 | return; // bail early, nothing to do here. |
| 2437 | 2436 | } |
| 2437 | + | |
| 2438 | + Stats::getInstance()->updateStats(); | |
| 2439 | + AvatarInputs::getInstance()->update(); | |
| 2440 | + | |
| 2441 | + static bool firstIdle = true; | |
| 2442 | + if (firstIdle) { | |
| 2443 | + firstIdle = false; | |
| 2444 | + auto offscreenUi = DependencyManager::get<OffscreenUi>(); | |
| 2445 | + connect(offscreenUi.data(), &OffscreenUi::showDesktop, this, &Application::showDesktop); | |
| 2446 | + } | |
| 2447 | + | |
| 2438 | 2448 | |
| 2439 | 2449 | auto displayPlugin = getActiveDisplayPlugin(); |
| 2440 | 2450 | // depending on whether we're throttling or not. |
| @@ -2998,6 +3008,10 @@ void Application::toggleOverlays() { · 557 unmodified lines | ||
| 2998 | 3008 | _overlayConductor.setEnabled(overlaysVisible); |
| 2999 | 3009 | } |
| 3000 | 3010 | |
| 3011 | +void Application::setOverlaysVisible(bool visible) { | |
| 3012 | + _overlayConductor.setEnabled(visible); | |
| 3013 | +} | |
| 3014 | + | |
| 3001 | 3015 | void Application::cycleCamera() { |
| 3002 | 3016 | auto menu = Menu::getInstance(); |
| 3003 | 3017 | if (menu->isOptionChecked(MenuOption::FullscreenMirror)) { |
| @@ -272,6 +272,7 @@ public slots: · 271 unmodified lines | ||
| 272 | 272 | void cycleCamera(); |
| 273 | 273 | void cameraMenuChanged(); |
| 274 | 274 | void toggleOverlays(); |
| 275 | + void setOverlaysVisible(bool visible); | |
| 275 | 276 | |
| 276 | 277 | void reloadResourceCaches(); |
| 277 | 278 | |
| @@ -257,7 +257,7 @@ Menu::Menu() { · 256 unmodified lines | ||
| 257 | 257 | |
| 258 | 258 | // View > Overlays |
| 259 | 259 | addCheckableActionToQMenuAndActionHash(viewMenu, MenuOption::Overlays, 0, true, |
| 260 | − qApp, SLOT(toggleOverlays())); | |
| 260 | + qApp, SLOT(setOverlaysVisible(bool))); | |
| 261 | 261 | |
| 262 | 262 | // Navigate menu ---------------------------------- |
| 263 | 263 | MenuWrapper* navigateMenu = addMenu("Navigate"); |
| @@ -131,7 +131,7 @@ private: · 130 unmodified lines | ||
| 131 | 131 | float _textureAspectRatio { 1.0f }; |
| 132 | 132 | int _hemiVerticesID { GeometryCache::UNKNOWN_ID }; |
| 133 | 133 | |
| 134 | − float _alpha { 1.0f }; | |
| 134 | + float _alpha { 0.0f }; // hidden by default | |
| 135 | 135 | float _prevAlpha { 1.0f }; |
| 136 | 136 | float _fadeInAlpha { true }; |
| 137 | 137 | float _oculusUIRadius { 1.0f }; |
| @@ -58,10 +58,6 @@ void ApplicationOverlay::renderOverlay(RenderArgs* renderArgs) { · 57 unmodified lines | ||
| 58 | 58 | CHECK_GL_ERROR(); |
| 59 | 59 | PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings), "ApplicationOverlay::displayOverlay()"); |
| 60 | 60 | |
| 61 | − // TODO move to Application::idle()? | |
| 62 | − Stats::getInstance()->updateStats(); | |
| 63 | − AvatarInputs::getInstance()->update(); | |
| 64 | − | |
| 65 | 61 | buildFramebufferObject(); |
| 66 | 62 | |
| 67 | 63 | if (!_overlayFramebuffer) { |
| @@ -110,9 +110,12 @@ void OverlayConductor::setEnabled(bool enabled) { · 109 unmodified lines | ||
| 110 | 110 | return; |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | + qDebug() << "OverlayConductor::setEnabled() enabled:" << enabled; | |
| 113 | 114 | Menu::getInstance()->setIsOptionChecked(MenuOption::Overlays, enabled); |
| 114 | 115 | |
| 115 | − if (_enabled) { | |
| 116 | + _enabled = enabled; // set the new value | |
| 117 | + | |
| 118 | + if (!_enabled) { | |
| 116 | 119 | // alpha fadeOut the overlay mesh. |
| 117 | 120 | qApp->getApplicationCompositor().fadeOut(); |
| 118 | 121 | |
| @@ -122,8 +125,6 @@ void OverlayConductor::setEnabled(bool enabled) { · 3 unmodified lines | ||
| 122 | 125 | // disable QML events |
| 123 | 126 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); |
| 124 | 127 | offscreenUi->getRootItem()->setEnabled(false); |
| 125 | − | |
| 126 | − _enabled = false; | |
| 127 | 128 | } else { |
| 128 | 129 | // alpha fadeIn the overlay mesh. |
| 129 | 130 | qApp->getApplicationCompositor().fadeIn(); |
| @@ -144,8 +145,6 @@ void OverlayConductor::setEnabled(bool enabled) { · 14 unmodified lines | ||
| 144 | 145 | t.setRotation(glm::quat_cast(camMat)); |
| 145 | 146 | qApp->getApplicationCompositor().setModelTransform(t); |
| 146 | 147 | } |
| 147 | − | |
| 148 | − _enabled = true; | |
| 149 | 148 | } |
| 150 | 149 | } |
| 151 | 150 | |
| @@ -29,8 +29,8 @@ private: · 28 unmodified lines | ||
| 29 | 29 | STANDING |
| 30 | 30 | }; |
| 31 | 31 | |
| 32 | − Mode _mode = FLAT; | |
| 33 | − bool _enabled = true; | |
| 32 | + Mode _mode { FLAT }; | |
| 33 | + bool _enabled { false }; | |
| 34 | 34 | }; |
| 35 | 35 | |
| 36 | 36 | #endif |