1442 QObject::connect(&d->m_movieTimer, SIGNAL(finished()), this, SIGNAL(endAnimationCplt())); |
1442 QObject::connect(&d->m_movieTimer, SIGNAL(finished()), this, SIGNAL(endAnimationCplt())); |
1443 d->m_movieTimer.start(); |
1443 d->m_movieTimer.start(); |
1444 } |
1444 } |
1445 |
1445 |
1446 //! handle the display mode change |
1446 //! handle the display mode change |
1447 void GraphicsFilmstripFlow::displayModeChanged(QString& newMode) |
1447 void GraphicsFilmstripFlow::displayModeChanged(QSize sz) |
1448 { |
1448 { |
1449 Q_UNUSED(newMode); |
1449 //qDebug() << "FilmstripFlow::displayModeChanged: " << sz; |
1450 Q_ASSERT(d); |
1450 adjustFilmstripSize(sz); |
1451 QSize s = this->size().toSize(); |
|
1452 //qDebug() << "FilmstripFlow::displayModeChanged: " << s; |
|
1453 adjustFilmstripSize(s); |
|
1454 update(); |
1451 update(); |
1455 } |
1452 } |
1456 |
1453 |
1457 // ------------------------------------------------------- |
1454 // ------------------------------------------------------- |
1458 // FilmstripFlow: private functions |
1455 // FilmstripFlow: private functions |
1469 d->m_buffer = new QImage (w, h, QImage::Format_RGB32); |
1466 d->m_buffer = new QImage (w, h, QImage::Format_RGB32); |
1470 |
1467 |
1471 if (w >= h) { // landscape |
1468 if (w >= h) { // landscape |
1472 d->m_sideWindowSize = QSize(w * L_SIDE_WIDTH_P_C, w * L_SIDE_WIDTH_P_C / ratio); |
1469 d->m_sideWindowSize = QSize(w * L_SIDE_WIDTH_P_C, w * L_SIDE_WIDTH_P_C / ratio); |
1473 d->m_centerWindowSize = QSize(w * L_CENTER_WIDTH_P_C, w * L_CENTER_WIDTH_P_C / ratio); |
1470 d->m_centerWindowSize = QSize(w * L_CENTER_WIDTH_P_C, w * L_CENTER_WIDTH_P_C / ratio); |
1474 d->m_centerTopSpace = h * L_CENTER_TOP_SPACE_P_C; |
1471 // Calculate the center top space and side top space |
1475 d->m_sideTopSpace = h * L_SIDE_TOP_SPACE_P_C; |
1472 d->m_centerTopSpace =( h - d->m_centerWindowSize.height())/2; |
|
1473 d->m_sideTopSpace = (h - d->m_sideWindowSize.height())/2; |
1476 d->m_space = w * L_SPACE_P_C; |
1474 d->m_space = w * L_SPACE_P_C; |
1477 ix = (w * (1 + L_CENTER_WIDTH_P_C) - d->m_closeIcon->size().width() + FRAME_WIDTH)/2.0; |
1475 ix = (w * (1 + L_CENTER_WIDTH_P_C) - d->m_closeIcon->size().width() + FRAME_WIDTH)/2.0; |
1478 } else { // portrait |
1476 } else { // portrait |
1479 d->m_sideWindowSize = QSize(w * P_SIDE_WIDTH_P_C, w * P_SIDE_WIDTH_P_C / ratio); |
1477 d->m_sideWindowSize = QSize(w * P_SIDE_WIDTH_P_C, w * P_SIDE_WIDTH_P_C / ratio); |
1480 d->m_centerWindowSize = QSize(w * P_CENTER_WIDTH_P_C, w * P_CENTER_WIDTH_P_C / ratio); |
1478 d->m_centerWindowSize = QSize(w * P_CENTER_WIDTH_P_C, w * P_CENTER_WIDTH_P_C / ratio); |
1619 void GraphicsFilmstripFlow::resizeEvent(QGraphicsSceneResizeEvent* event) |
1617 void GraphicsFilmstripFlow::resizeEvent(QGraphicsSceneResizeEvent* event) |
1620 { |
1618 { |
1621 Q_ASSERT(d); |
1619 Q_ASSERT(d); |
1622 QGraphicsWidget::resizeEvent(event); |
1620 QGraphicsWidget::resizeEvent(event); |
1623 d->m_widgetSize = event->newSize().toSize(); |
1621 d->m_widgetSize = event->newSize().toSize(); |
1624 adjustFilmstripSize(d->m_widgetSize); |
1622 // Do not adjust the film strip size here. The widget size is |
|
1623 // used only to get the page thumbnails. Positioning |
|
1624 // of the thumbnails within the view is based on the size that |
|
1625 // WindowView provides. |
|
1626 // adjustFilmstripSize(d->m_widgetSize); |
1625 } |
1627 } |
1626 |
1628 |
1627 void GraphicsFilmstripFlow::mouseMoveEvent(QGraphicsSceneMouseEvent* event) |
1629 void GraphicsFilmstripFlow::mouseMoveEvent(QGraphicsSceneMouseEvent* event) |
1628 { |
1630 { |
1629 //qDebug() << "!!!!!!!!!!!!!!!!move event" << this->size(); |
1631 //qDebug() << "!!!!!!!!!!!!!!!!move event" << this->size(); |