# HG changeset patch # User Chris Cannam # Date 1327090888 0 # Node ID 3a85461ab9a7ec7735cd50e6fcaf928ceede3488 # Parent ab3bcd06b5c20fc789d21761903b738fd9a9ba6f Make it possible to toggle full-screen through the menu diff -r ab3bcd06b5c2 -r 3a85461ab9a7 main/MainWindow.cpp --- a/main/MainWindow.cpp Fri Jan 20 17:08:47 2012 +0000 +++ b/main/MainWindow.cpp Fri Jan 20 20:21:28 2012 +0000 @@ -381,7 +381,6 @@ ps->setParent(0); ps->showFullScreen(); // ps->showMaximized(); - //!!! we don't really want to create this every time! QShortcut *sc = new QShortcut(QKeySequence("Esc"), ps); connect(sc, SIGNAL(activated()), this, SLOT(endFullScreen())); // QApplication::processEvents(); @@ -391,6 +390,8 @@ void MainWindow::endFullScreen() { + QShortcut *sc = dynamic_cast(sender()); + if (sc) delete sc; // it was only created in goFullScreen m_mainScroll->setWidget(m_paneStack); } @@ -964,6 +965,11 @@ action->setStatusTip(tr("Open a window listing interactions and other events")); connect(action, SIGNAL(triggered()), this, SLOT(showActivityLog())); menu->addAction(action); + + //!!! + action = new QAction(tr("Go Full-Screen"), this); + connect(action, SIGNAL(triggered()), this, SLOT(goFullScreen())); + menu->addAction(action); } void diff -r ab3bcd06b5c2 -r 3a85461ab9a7 main/main.cpp --- a/main/main.cpp Fri Jan 20 17:08:47 2012 +0000 +++ b/main/main.cpp Fri Jan 20 20:21:28 2012 +0000 @@ -352,7 +352,6 @@ settings.endGroup(); gui->show(); - gui->goFullScreen(); // The MainWindow class seems to have trouble dealing with this if // it tries to adapt to this preference before the constructor is