Mercurial > hg > sonic-visualiser
comparison main/MainWindow.cpp @ 493:3a85461ab9a7 fullscreen
Make it possible to toggle full-screen through the menu
author | Chris Cannam |
---|---|
date | Fri, 20 Jan 2012 20:21:28 +0000 |
parents | ab3bcd06b5c2 |
children | 238a97d2a8f4 |
comparison
equal
deleted
inserted
replaced
492:ab3bcd06b5c2 | 493:3a85461ab9a7 |
---|---|
379 QWidget *ps = m_mainScroll->takeWidget(); | 379 QWidget *ps = m_mainScroll->takeWidget(); |
380 // m_mainScroll->setWidget(0); | 380 // m_mainScroll->setWidget(0); |
381 ps->setParent(0); | 381 ps->setParent(0); |
382 ps->showFullScreen(); | 382 ps->showFullScreen(); |
383 // ps->showMaximized(); | 383 // ps->showMaximized(); |
384 //!!! we don't really want to create this every time! | |
385 QShortcut *sc = new QShortcut(QKeySequence("Esc"), ps); | 384 QShortcut *sc = new QShortcut(QKeySequence("Esc"), ps); |
386 connect(sc, SIGNAL(activated()), this, SLOT(endFullScreen())); | 385 connect(sc, SIGNAL(activated()), this, SLOT(endFullScreen())); |
387 // QApplication::processEvents(); | 386 // QApplication::processEvents(); |
388 // m_paneStack->adjustSize(); | 387 // m_paneStack->adjustSize(); |
389 } | 388 } |
390 | 389 |
391 void | 390 void |
392 MainWindow::endFullScreen() | 391 MainWindow::endFullScreen() |
393 { | 392 { |
393 QShortcut *sc = dynamic_cast<QShortcut *>(sender()); | |
394 if (sc) delete sc; // it was only created in goFullScreen | |
394 m_mainScroll->setWidget(m_paneStack); | 395 m_mainScroll->setWidget(m_paneStack); |
395 } | 396 } |
396 | 397 |
397 void | 398 void |
398 MainWindow::setupFileMenu() | 399 MainWindow::setupFileMenu() |
961 menu->addAction(action); | 962 menu->addAction(action); |
962 | 963 |
963 action = new QAction(tr("Show Acti&vity Log"), this); | 964 action = new QAction(tr("Show Acti&vity Log"), this); |
964 action->setStatusTip(tr("Open a window listing interactions and other events")); | 965 action->setStatusTip(tr("Open a window listing interactions and other events")); |
965 connect(action, SIGNAL(triggered()), this, SLOT(showActivityLog())); | 966 connect(action, SIGNAL(triggered()), this, SLOT(showActivityLog())); |
967 menu->addAction(action); | |
968 | |
969 //!!! | |
970 action = new QAction(tr("Go Full-Screen"), this); | |
971 connect(action, SIGNAL(triggered()), this, SLOT(goFullScreen())); | |
966 menu->addAction(action); | 972 menu->addAction(action); |
967 } | 973 } |
968 | 974 |
969 void | 975 void |
970 MainWindow::setupPaneAndLayerMenus() | 976 MainWindow::setupPaneAndLayerMenus() |