History

handle startup overlay visibility correctly

Brad Hefta-Gaub committed 10 years ago

Commit 366aa391 parent 526f9dc7 files · +24 −14Browse files

Showing the changes to interface/src/ui/OverlayConductor.cpp (1 of 7 files). Show all

Unified · Split

interface/src/ui/OverlayConductor.cpp+4−5
@@ -110,9 +110,12 @@ void OverlayConductor::setEnabled(bool enabled) { · 109 unmodified lines
110110 return;
111111 }
112112
113+ qDebug() << "OverlayConductor::setEnabled() enabled:" << enabled;
113114 Menu::getInstance()->setIsOptionChecked(MenuOption::Overlays, enabled);
114115
115− if (_enabled) {
116+ _enabled = enabled; // set the new value
117+
118+ if (!_enabled) {
116119 // alpha fadeOut the overlay mesh.
117120 qApp->getApplicationCompositor().fadeOut();
118121
@@ -122,8 +125,6 @@ void OverlayConductor::setEnabled(bool enabled) { · 3 unmodified lines
122125 // disable QML events
123126 auto offscreenUi = DependencyManager::get<OffscreenUi>();
124127 offscreenUi->getRootItem()->setEnabled(false);
125−
126− _enabled = false;
127128 } else {
128129 // alpha fadeIn the overlay mesh.
129130 qApp->getApplicationCompositor().fadeIn();
@@ -144,8 +145,6 @@ void OverlayConductor::setEnabled(bool enabled) { · 14 unmodified lines
144145 t.setRotation(glm::quat_cast(camMat));
145146 qApp->getApplicationCompositor().setModelTransform(t);
146147 }
147−
148− _enabled = true;
149148 }
150149 }
151150