From a23eeb4a26a61d2d5893ba5b306ca0ab093ee074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Poizl?= Date: Fri, 7 Feb 2020 21:17:27 +0100 Subject: [PATCH] Add full screen --- mainwindow.cpp | 15 +++++++++++++++ mainwindow.h | 2 ++ 2 files changed, 17 insertions(+) diff --git a/mainwindow.cpp b/mainwindow.cpp index 055b28c..aa2809f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -80,6 +80,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) viewMenu->addAction(tr("Zoom Out"), m_imageGL, SLOT(zoomOut()), QKeySequence::ZoomOut); viewMenu->addAction(tr("Best Fit"), m_imageGL, SLOT(bestFit()), QKeySequence("Ctrl+1")); viewMenu->addAction(tr("100%"), m_imageGL, SLOT(oneToOne())); + viewMenu->addAction(tr("Fullscreen"), this, SLOT(toggleFullScreen()), QKeySequence::FullScreen); menuBar()->addMenu(viewMenu); QMenu *selectMenu = new QMenu(tr("Select"), this); @@ -322,6 +323,20 @@ void MainWindow::copyMarked() } } +void MainWindow::toggleFullScreen() +{ + if(isFullScreen()) + { + showNormal(); + if(_maximized)showMaximized(); + } + else + { + _maximized = isMaximized(); + showFullScreen(); + } +} + void MainWindow::liveMode(bool active) { m_ringList->setLiveMode(active); diff --git a/mainwindow.h b/mainwindow.h index f7207f0..565ea85 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -20,6 +20,7 @@ class MainWindow : public QMainWindow static int socketPair[2]; QSocketNotifier *socketNotifier; QString _lastDir; + bool _maximized; public: MainWindow(QWidget *parent = 0); ~MainWindow(); @@ -40,6 +41,7 @@ protected slots: void markAndNext(); void unmarkAndNext(); void copyMarked(); + void toggleFullScreen(); void liveMode(bool active); void imageStats(bool imageStats); void peakFinder(bool findPeaks);