]> git.sur5r.net Git - minitube/commitdiff
Fixed fullscreen keyboard shortcut
authorFlavio Tordini <flavio.tordini@gmail.com>
Sat, 25 Jul 2009 15:43:15 +0000 (17:43 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Sat, 25 Jul 2009 15:43:15 +0000 (17:43 +0200)
src/MainWindow.cpp

index 692ff462257bcd2955d92f7e819ff2da6de8a379..668767a2db7f3072c26034b512982ed9af05e0e8 100755 (executable)
@@ -21,13 +21,12 @@ MainWindow::MainWindow() {
     mediaView = new MediaView(this);
     views->addWidget(mediaView);
 
-    // lazy initialized views
+    // lazily initialized views
     aboutView = 0;
     settingsView = 0;
 
     toolbarSearch = new SearchLineEdit(this);
     toolbarSearch->setFont(qApp->font());
-    // toolbarSearch->setMinimumWidth(200);
     connect(toolbarSearch, SIGNAL(search(const QString&)), searchView, SLOT(watch(const QString&)));
 
     // build ui
@@ -50,23 +49,6 @@ MainWindow::MainWindow() {
 
     setCentralWidget(views);
 
-    // top dock widget
-    /*
-    QLabel* message = new QLabel(this);
-    message->setText(QString("A new version of %1 is available.").arg(Constants::APP_NAME));
-    message->setMargin(10);
-    message->setAlignment(Qt::AlignCenter);
-    QPalette palette;
-    message->setBackgroundRole(QPalette::ToolTipBase);
-    message->setForegroundRole(QPalette::ToolTipText);
-    message->setAutoFillBackground(true);
-    QDockWidget *dockWidget = new QDockWidget("", this, 0);
-    dockWidget->setTitleBarWidget(0);
-    dockWidget->setWidget(message);
-    dockWidget->setFeatures(QDockWidget::DockWidgetClosable);
-    addDockWidget(Qt::TopDockWidgetArea, dockWidget);
-    */
-
 }
 
 MainWindow::~MainWindow() {
@@ -488,8 +470,14 @@ void MainWindow::stop() {
 
 void MainWindow::fullscreen() {
 
+    setUpdatesEnabled(false);
+
     if (m_fullscreen) {
-        fullscreenAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Return));
+        // use setShortucs instead of setShortcut
+        // the latter seems not to work
+        QList<QKeySequence> shortcuts;
+        shortcuts << QKeySequence(Qt::ALT + Qt::Key_Return);
+        fullscreenAct->setShortcuts(shortcuts);
         fullscreenAct->setText(tr("&Full Screen"));
         stopAct->setShortcut(QKeySequence(Qt::Key_Escape));
         if (m_maximized) showMaximized();
@@ -521,10 +509,13 @@ void MainWindow::fullscreen() {
 
     m_fullscreen = !m_fullscreen;
 
+    setUpdatesEnabled(true);
 }
 
 void MainWindow::compactView(bool enable) {
 
+    setUpdatesEnabled(false);
+
     // setUnifiedTitleAndToolBarOnMac(!enable);
     mediaView->setPlaylistVisible(!enable);
     mainToolBar->setVisible(!enable);
@@ -545,6 +536,7 @@ void MainWindow::compactView(bool enable) {
         stopAct->setShortcut(QKeySequence(Qt::Key_Escape));
     }
 
+    setUpdatesEnabled(true);
 }
 
 void MainWindow::searchFocus() {