Add full screen

This commit is contained in:
2020-02-07 21:17:27 +01:00
parent 72935e9288
commit a23eeb4a26
2 changed files with 17 additions and 0 deletions
+15
View File
@@ -80,6 +80,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
viewMenu->addAction(tr("Zoom Out"), m_imageGL, SLOT(zoomOut()), QKeySequence::ZoomOut); 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("Best Fit"), m_imageGL, SLOT(bestFit()), QKeySequence("Ctrl+1"));
viewMenu->addAction(tr("100%"), m_imageGL, SLOT(oneToOne())); viewMenu->addAction(tr("100%"), m_imageGL, SLOT(oneToOne()));
viewMenu->addAction(tr("Fullscreen"), this, SLOT(toggleFullScreen()), QKeySequence::FullScreen);
menuBar()->addMenu(viewMenu); menuBar()->addMenu(viewMenu);
QMenu *selectMenu = new QMenu(tr("Select"), this); 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) void MainWindow::liveMode(bool active)
{ {
m_ringList->setLiveMode(active); m_ringList->setLiveMode(active);
+2
View File
@@ -20,6 +20,7 @@ class MainWindow : public QMainWindow
static int socketPair[2]; static int socketPair[2];
QSocketNotifier *socketNotifier; QSocketNotifier *socketNotifier;
QString _lastDir; QString _lastDir;
bool _maximized;
public: public:
MainWindow(QWidget *parent = 0); MainWindow(QWidget *parent = 0);
~MainWindow(); ~MainWindow();
@@ -40,6 +41,7 @@ protected slots:
void markAndNext(); void markAndNext();
void unmarkAndNext(); void unmarkAndNext();
void copyMarked(); void copyMarked();
void toggleFullScreen();
void liveMode(bool active); void liveMode(bool active);
void imageStats(bool imageStats); void imageStats(bool imageStats);
void peakFinder(bool findPeaks); void peakFinder(bool findPeaks);