Skip to content

Commit

Permalink
always restore settings from normal window mode (#3431)
Browse files Browse the repository at this point in the history
  • Loading branch information
octaeder authored Dec 17, 2023
1 parent 526d079 commit c104645
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/pdfviewer/PDFDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -4525,6 +4528,7 @@ void PDFDocument::toggleFullScreen(bool fullscreen)
exitFullscreen = nullptr;
}
}
wasFullScreen = fullscreen;
}

void PDFDocument::zoomFromAction()
Expand Down
1 change: 1 addition & 0 deletions src/pdfviewer/PDFDocument.h
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ private slots:
bool dwVisOutline, dwVisFonts, dwVisInfo, dwVisSearch, dwVisOverview;
bool wasContinuous;
bool wasShowToolBar;
bool wasFullScreen;
PDFSearchDock *dwSearch;

PDFSearchResult lastSearchResult;
Expand Down

0 comments on commit c104645

Please sign in to comment.