From 858848be54c190d6896975cd42e1bd59e4886169 Mon Sep 17 00:00:00 2001 From: octaeder <102688820+octaeder@users.noreply.github.com> Date: Sun, 17 Dec 2023 22:36:33 +0100 Subject: [PATCH] always restore settings from normal window mode --- src/pdfviewer/PDFDocument.cpp | 12 ++++++++---- src/pdfviewer/PDFDocument.h | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pdfviewer/PDFDocument.cpp b/src/pdfviewer/PDFDocument.cpp index f5be9f6464..620dc26413 100644 --- a/src/pdfviewer/PDFDocument.cpp +++ b/src/pdfviewer/PDFDocument.cpp @@ -3378,6 +3378,7 @@ void PDFDocument::init(bool embedded) //connect(actionZoom_Out, SIGNAL(triggered()), pdfWidget, SLOT(zoomOut())); //connect(actionFull_Screen, SIGNAL(triggered(bool)), this, SLOT(toggleFullScreen(bool))); //connect(actionPresentation, SIGNAL(triggered(bool)), this, SLOT(toggleFullScreen(bool))); + wasFullScreen = false; connect(pdfWidget, SIGNAL(changedZoom(qreal)), this, SLOT(enableZoomActions(qreal))); connect(pdfWidget, SIGNAL(changedScaleOption(autoScaleOption)), this, SLOT(adjustScaleActions(autoScaleOption))); connect(pdfWidget, SIGNAL(syncClick(int,const QPointF&,bool)), this, SLOT(syncClick(int,const QPointF&,bool))); @@ -4473,10 +4474,12 @@ void PDFDocument::toggleFullScreen(bool fullscreen) { bool presentation = false; if (fullscreen) { - // entering full-screen mode - wasContinuous = actionContinuous->isChecked(); - wasShowToolBar = toolBar->isVisible(); - pdfWidget->saveState(); + // entering full-screen mode (maybe a second time when switching from fullscreen to presentation) + if (!wasFullScreen) { + wasContinuous = actionContinuous->isChecked(); + wasShowToolBar = toolBar->isVisible(); + pdfWidget->saveState(); + } statusBar()->hide(); toolBar->hide(); globalConfig->windowMaximized = isMaximized(); @@ -4525,6 +4528,7 @@ void PDFDocument::toggleFullScreen(bool fullscreen) exitFullscreen = nullptr; } } + wasFullScreen = fullscreen; } void PDFDocument::zoomFromAction() diff --git a/src/pdfviewer/PDFDocument.h b/src/pdfviewer/PDFDocument.h index 14d0311409..d86db2d1fd 100644 --- a/src/pdfviewer/PDFDocument.h +++ b/src/pdfviewer/PDFDocument.h @@ -709,6 +709,7 @@ private slots: bool dwVisOutline, dwVisFonts, dwVisInfo, dwVisSearch, dwVisOverview; bool wasContinuous; bool wasShowToolBar; + bool wasFullScreen; PDFSearchDock *dwSearch; PDFSearchResult lastSearchResult;