diff main/MainWindow.cpp @ 489:c11a29843fe1 fullscreen

Start hacking in some fullscreen stuff (so far, this is just a mess)
author Chris Cannam
date Thu, 19 Jan 2012 15:34:33 +0000
parents a6cbec451508
children 9137b619b652
line wrap: on
line diff
--- a/main/MainWindow.cpp	Thu Jan 19 14:44:35 2012 +0000
+++ b/main/MainWindow.cpp	Thu Jan 19 15:34:33 2012 +0000
@@ -149,6 +149,7 @@
     m_soloAction(0),
     m_soloModified(false),
     m_prevSolo(false),
+    m_exiting(false),
     m_rwdStartAction(0),
     m_rwdSimilarAction(0),
     m_rwdAction(0),
@@ -196,12 +197,12 @@
 
     m_descriptionLabel = new QLabel; //!!! hang on, this is declared in base class -- should be declared and initialised by same class
 
-    QScrollArea *scroll = new QScrollArea(frame);
-    scroll->setWidgetResizable(true);
-    scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-    scroll->setFrameShape(QFrame::NoFrame);
-
-    scroll->setWidget(m_paneStack);
+    m_mainScroll = new QScrollArea(frame);
+    m_mainScroll->setWidgetResizable(true);
+    m_mainScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+    m_mainScroll->setFrameShape(QFrame::NoFrame);
+
+    m_mainScroll->setWidget(m_paneStack);
 
     m_overview = new Overview(frame);
     m_overview->setViewManager(m_viewManager);
@@ -258,7 +259,7 @@
     m_playControlsSpacer = new QFrame;
 
     layout->setSpacing(4);
-    layout->addWidget(scroll, 0, 0, 1, 5);
+    layout->addWidget(m_mainScroll, 0, 0, 1, 5);
     layout->addWidget(m_overview, 1, 1);
     layout->addWidget(m_playControlsSpacer, 1, 2);
     layout->addWidget(m_playSpeed, 1, 3);
@@ -373,6 +374,13 @@
 }
 
 void
+MainWindow::goFullScreen()
+{
+    m_paneStack->setParent(0);
+    m_paneStack->showFullScreen();
+}
+
+void
 MainWindow::setupFileMenu()
 {
     if (m_mainMenusCreated) return;
@@ -2989,6 +2997,11 @@
 void
 MainWindow::closeEvent(QCloseEvent *e)
 {
+    if (m_exiting) {
+        e->accept();
+        return;
+    }
+
 //    SVDEBUG << "MainWindow::closeEvent" << endl;
 
     if (m_openingAudioFile) {
@@ -3021,6 +3034,10 @@
     closeSession();
 
     e->accept();
+
+    m_exiting = true;
+    qApp->closeAllWindows();
+    
     return;
 }