MCPcopy Create free account
hub / github.com/KDE/okular / resizeEvent

Method resizeEvent

part/presentationwidget.cpp:914–947  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

912}
913
914void 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
949void PresentationWidget::enterEvent(QEnterEvent *e)
950{

Callers

nothing calls this directly

Calls 7

widthFunction · 0.85
heightFunction · 0.85
recalcGeometryMethod · 0.80
isActiveMethod · 0.80
stopMethod · 0.80
QSizeClass · 0.50
heightMethod · 0.45

Tested by

no test coverage detected