Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdf-viewer: restore settings from normal window mode after switching from fullscreen to presentation mode #3431

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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