From ab9478c4c212b2e99814d7a2ad989695108e3db3 Mon Sep 17 00:00:00 2001 From: baydam Date: Sun, 6 Mar 2016 03:04:11 +0000 Subject: [PATCH] The fullscreen button is activated only in dual screen mode --- MainWindow.cpp | 10 ++++++++++ MainWindow.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/MainWindow.cpp b/MainWindow.cpp index 7c0b565..202d19c 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -1660,12 +1660,14 @@ void MainWindow::createActions() outputFullScreenAction->setCheckable(true); // Don't be displayed by default outputFullScreenAction->setChecked(false); + outputFullScreenAction->setEnabled(QApplication::desktop()->screenCount() > 1); outputFullScreenAction->setShortcutContext(Qt::ApplicationShortcut); addAction(outputFullScreenAction); // Manage fullscreen/modal show of GL output window. connect(outputFullScreenAction, SIGNAL(toggled(bool)), outputWindow, SLOT(setFullScreen(bool))); // When closing the GL output window or hit ESC key, uncheck the action in menu. connect(outputWindow, SIGNAL(closed()), outputFullScreenAction, SLOT(toggle())); + connect(QApplication::desktop(), SIGNAL(screenCountChanged(int)), this, SLOT(updateOutputAction(int))); // Create hiden action for closing output window QAction *closeOutput = new QAction(tr("Close output"), this); closeOutput->setShortcut(Qt::Key_Escape); @@ -2906,6 +2908,14 @@ void MainWindow::pollOscInterface() #endif } +void MainWindow::updateOutputAction(int screen) +{ + if (screen > 1) + outputFullScreenAction->setEnabled(true); + else + outputFullScreenAction->setEnabled(false); +} + // void MainWindow::applyOscCommand(const QVariantList& command) // { // bool VERBOSE = true; diff --git a/MainWindow.h b/MainWindow.h index b7b9511..a88494d 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -109,7 +109,6 @@ private slots: // Widget callbacks. void handlePaintItemSelectionChanged(); -// void handleItemDoubleClicked(QListWidgetItem* item); void handleMappingItemSelectionChanged(); void handleMappingItemChanged(QListWidgetItem* item); void handleMappingIndexesMoved(); @@ -130,6 +129,7 @@ private slots: // Other. void windowModified(); void pollOscInterface(); + void updateOutputAction(int screen); public slots: