| 390 | } |
| 391 | |
| 392 | void Viewer::updatePage() |
| 393 | { |
| 394 | if (continuousScroll) { |
| 395 | return; |
| 396 | } |
| 397 | |
| 398 | setActiveWidget(content); |
| 399 | |
| 400 | QPixmap *previousPage = currentPage; |
| 401 | if (doublePage) { |
| 402 | if (!doubleMangaPage) |
| 403 | currentPage = render->getCurrentDoublePage(); |
| 404 | else { |
| 405 | currentPage = render->getCurrentDoubleMangaPage(); |
| 406 | } |
| 407 | if (currentPage == nullptr) { |
| 408 | currentPage = render->getCurrentPage(); |
| 409 | } |
| 410 | } else { |
| 411 | currentPage = render->getCurrentPage(); |
| 412 | } |
| 413 | content->setPixmap(*currentPage); |
| 414 | updateContentSize(); |
| 415 | updateVerticalScrollBar(); |
| 416 | |
| 417 | if (goToFlow->isHidden()) |
| 418 | setFocus(Qt::ShortcutFocusReason); |
| 419 | else |
| 420 | goToFlow->setFocus(Qt::OtherFocusReason); |
| 421 | delete previousPage; |
| 422 | |
| 423 | if (currentPage->isNull()) |
| 424 | setPageUnavailableMessage(); |
| 425 | else |
| 426 | emit pageAvailable(true); |
| 427 | |
| 428 | emit backgroundChanges(); |
| 429 | |
| 430 | if (restoreMagnifyingGlass) { |
| 431 | restoreMagnifyingGlass = false; |
| 432 | showMagnifyingGlass(); |
| 433 | } |
| 434 | } |
| 435 | |
| 436 | void Viewer::updateContentSize() |
| 437 | { |
no test coverage detected