show menu after requesting it

This commit is contained in:
Zach Pomerantz 2017-05-28 17:28:51 -04:00
parent 156b3f9738
commit 03d3666c0c
2 changed files with 6 additions and 3 deletions

View file

@ -1522,12 +1522,12 @@ QString Application::getUserAgent() {
return userAgent;
}
void Application::toggleTabletUI() const {
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())) {
if ((!messageOpen || (messageOpen && !hmd->getShouldShowTablet())) && !(shouldOpen && hmd->getShouldShowTablet())) {
auto HMD = DependencyManager::get<HMDScriptingInterface>();
HMD->toggleShouldShowTablet();
}
@ -5771,6 +5771,9 @@ void Application::showDialog(const QUrl& widgetUrl, const QUrl& tabletUrl, const
if (!tablet->getToolbarMode()) {
onTablet = tablet->pushOntoStack(tabletUrl);
if (onTablet) {
toggleTabletUI(true);
}
}
if (!onTablet) {

View file

@ -504,7 +504,7 @@ private:
static void dragEnterEvent(QDragEnterEvent* event);
void maybeToggleMenuVisible(QMouseEvent* event) const;
void toggleTabletUI() const;
void toggleTabletUI(bool shouldOpen = false) const;
MainWindow* _window;
QElapsedTimer& _sessionRunTimer;