diff --git a/src/drivers/Qt/ConsoleWindow.cpp b/src/drivers/Qt/ConsoleWindow.cpp index a0bc0e39..f5543b4d 100644 --- a/src/drivers/Qt/ConsoleWindow.cpp +++ b/src/drivers/Qt/ConsoleWindow.cpp @@ -491,12 +491,20 @@ void consoleWin_t::createMainMenu(void) fullscreen = new QAction(tr("Fullscreen"), this); fullscreen->setShortcut( QKeySequence(tr("Alt+Return"))); fullscreen->setStatusTip(tr("Fullscreen")); - //fullscreen->setIcon( style->standardIcon( QStyle::SP_TitleBarMaxButton ) ); fullscreen->setIcon( QIcon(":icons/view-fullscreen.png") ); connect(fullscreen, SIGNAL(triggered()), this, SLOT(toggleFullscreen(void)) ); optMenu->addAction(fullscreen); + // Options -> Hide Menu Screen + act = new QAction(tr("Hide Menu"), this); + act->setShortcut( QKeySequence(tr("Alt+M"))); + act->setStatusTip(tr("Hide Menu")); + act->setIcon( style->standardIcon( QStyle::SP_TitleBarMaxButton ) ); + connect(act, SIGNAL(triggered()), this, SLOT(toggleMenuVis(void)) ); + + optMenu->addAction(act); + //----------------------------------------------------------------------- // Emulation emuMenu = menuBar()->addMenu(tr("Emulation")); @@ -841,6 +849,18 @@ void consoleWin_t::createMainMenu(void) helpMenu->addAction(msgLogAct); }; //--------------------------------------------------------------------------- +void consoleWin_t::toggleMenuVis(void) +{ + if ( menuBar()->isVisible() ) + { + menuBar()->setVisible( false ); + } + else + { + menuBar()->setVisible( true ); + } +} +//--------------------------------------------------------------------------- void consoleWin_t::closeApp(void) { nes_shm->runEmulator = 0; diff --git a/src/drivers/Qt/ConsoleWindow.h b/src/drivers/Qt/ConsoleWindow.h index 4acb75d9..f59756e0 100644 --- a/src/drivers/Qt/ConsoleWindow.h +++ b/src/drivers/Qt/ConsoleWindow.h @@ -168,6 +168,8 @@ class consoleWin_t : public QMainWindow void openDebugWindow(void); void openHexEditor(void); void openGamePadConfWin(void); + void toggleFullscreen(void); + void toggleMenuVis(void); private slots: void closeApp(void); void openROMFile(void); @@ -192,7 +194,6 @@ class consoleWin_t : public QMainWindow void openCodeDataLogger(void); void openTraceLogger(void); void toggleAutoResume(void); - void toggleFullscreen(void); void updatePeriodic(void); void changeState0(void); void changeState1(void); diff --git a/src/drivers/Qt/input.cpp b/src/drivers/Qt/input.cpp index 45193767..cd29ffc8 100644 --- a/src/drivers/Qt/input.cpp +++ b/src/drivers/Qt/input.cpp @@ -588,21 +588,33 @@ static void KeyboardCommands (void) } // Alt-Enter to toggle full-screen - // This is already handled by GTK Accelerator - //if (keyonly (ENTER) && is_alt) - //{ - // ToggleFS (); - //} - // + // This is already handled by Qt Menu Actions + // So only process if menu is hidden or disabled. + if ( is_alt ) + { + if (keyonly (ENTER)) + { + if ( consoleWindow ) + { + if ( !consoleWindow->menuBar()->isVisible() ) + { + consoleWindow->toggleFullscreen(); + } + } + } + } // Alt-M to toggle Main Menu Visibility - //if ( is_alt ) - //{ - // if (keyonly (M)) - // { - // toggleMenuVis(); // TODO - // } - //} + if ( is_alt ) + { + if (keyonly (M)) + { + if ( consoleWindow ) + { + consoleWindow->toggleMenuVis(); + } + } + } // Toggle Movie auto-backup if ( is_shift )