Merge pull request #10951 from druiz17/tablet-modal-fixes

Allow the tablet to be closed when a modal dialog is open.
This commit is contained in:
Seth Alves 2017-07-14 09:40:58 -07:00 committed by GitHub
commit 741feb7e54

View file

@ -1705,9 +1705,7 @@ QString Application::getUserAgent() {
void Application::toggleTabletUI(bool shouldOpen) const {
auto tabletScriptingInterface = DependencyManager::get<TabletScriptingInterface>();
auto hmd = DependencyManager::get<HMDScriptingInterface>();
TabletProxy* tablet = dynamic_cast<TabletProxy*>(tabletScriptingInterface->getTablet(SYSTEM_TABLET));
bool messageOpen = tablet->isMessageDialogOpen();
if ((!messageOpen || (messageOpen && !hmd->getShouldShowTablet())) && !(shouldOpen && hmd->getShouldShowTablet())) {
if (!(shouldOpen && hmd->getShouldShowTablet())) {
auto HMD = DependencyManager::get<HMDScriptingInterface>();
HMD->toggleShouldShowTablet();
}