| 912 | } |
| 913 | |
| 914 | void PresentationWidget::resizeEvent(QResizeEvent *re) |
| 915 | { |
| 916 | m_width = width(); |
| 917 | m_height = height(); |
| 918 | |
| 919 | // if by chance the new size equals the old, do not invalidate pixmaps and such.. |
| 920 | if (size() == re->oldSize()) { |
| 921 | return; |
| 922 | } |
| 923 | |
| 924 | // BEGIN Top toolbar |
| 925 | // tool bar height in pixels, make it large enough to hold the text fields with the page numbers |
| 926 | const int toolBarHeight = m_pagesEdit->height() * 1.5; |
| 927 | |
| 928 | m_topBar->setGeometry(0, 0, width(), toolBarHeight); |
| 929 | m_topBar->setIconSize(QSize(toolBarHeight * 0.75, toolBarHeight * 0.75)); |
| 930 | // END Top toolbar |
| 931 | |
| 932 | // BEGIN Content area |
| 933 | // update the frames |
| 934 | const float screenRatio = (float)m_height / (float)m_width; |
| 935 | for (PresentationFrame *frame : std::as_const(m_frames)) { |
| 936 | frame->recalcGeometry(m_width, m_height, screenRatio); |
| 937 | } |
| 938 | |
| 939 | invalidatePixmaps(); |
| 940 | |
| 941 | if (m_transitionTimer->isActive()) { |
| 942 | m_transitionTimer->stop(); |
| 943 | } |
| 944 | |
| 945 | generatePage(true /* no transitions */); |
| 946 | // END Content area |
| 947 | } |
| 948 | |
| 949 | void PresentationWidget::enterEvent(QEnterEvent *e) |
| 950 | { |